Author Topic: Get list of HID devices without using deviceBox  (Read 2674 times)

peterviau

  • Newbie
  • *
  • Posts: 1
    • View Profile
Get list of HID devices without using deviceBox
« on: September 23, 2009, 10:02:21 pm »
Is it possible to get a list of HID devices and select one using c# without using DeviceBox?

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Get list of HID devices without using deviceBox
« Reply #1 on: September 25, 2009, 03:10:55 am »
Hello

You can use following properties for access to device list:
Code: [Select]
nrHid1[i] - devices from device list
nrHid1.DeviceCount - device list length
nrHid1.DeviceIndex - index of selected (active) device
nrHid1.HidDevice - active device (same as: (NrHidDevice)nrHid1[nrHid1.DeviceIndex])

The following code choices second device:

Code: [Select]
nrHid1.DeviceIndex = 1; // zero based index
Roman Novgordov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

ChrBlack

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Get list of HID devices without using deviceBox
« Reply #2 on: October 27, 2009, 04:23:40 am »
Hello

You can use following properties for access to device list:
Code: [Select]
nrHid1[i] - devices from device list
nrHid1.DeviceCount - device list length
nrHid1.DeviceIndex - index of selected (active) device
nrHid1.HidDevice - active device (same as: (NrHidDevice)nrHid1[nrHid1.DeviceIndex])

The following code choices second device:

Code: [Select]
nrHid1.DeviceIndex = 1; // zero based index
Roman Novgordov


I had the same idea before that qestion. I've tried it without nrDeviceBox and nrHid1.DeviceIndex returns zero. It seems that nrDeviceBox have to be on form and have to be assigned with nrHid1 (set nrDeviceBox1.nrComm property to nrHid1). I have a sense that nrDeviceBox do some enumerating thing.