Author Topic: How to identify between 2 idenditical devices? your opinion?  (Read 2194 times)

chedges

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
How to identify between 2 idenditical devices? your opinion?
« on: January 28, 2009, 03:41:53 pm »
HI,

I have a situation where I could potentially have two identical devices (printers) installed on my machine and I would need to be able
to tell which device I should be writing to via some kind of Id.

I can see the devices have VendorId, ProductId and SerialNo (this doesn't seem to be populated). As the devices are identical
I presume the ProductId and VendorId will be the same on both devices.

Is there some other identification Id that I could use to tell the two devices instances apart? I need to do this as my app will not have a UI
and no user intervention is allowed (NTService). This id needs to be persistent and not session based as it will be used as a permanent key to id the device!

Bit of a odd question, so I'm just wondering what you think?

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: How to identify between 2 idenditical devices? your opinion?
« Reply #1 on: January 29, 2009, 07:00:52 am »
Hello

You can try the following string properties of device:

nrHid1.HidDevice.InstanceId
nrHid1.HidDevice.NamePDO

I think they are unique.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

chedges

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: How to identify between 2 idenditical devices? your opinion?
« Reply #2 on: January 29, 2009, 08:54:58 am »
Excellent!

thanks again :)

hid1

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: How to identify between 2 idenditical devices? your opinion?
« Reply #3 on: July 22, 2009, 02:21:58 pm »
Hello Roman,

PDO means?  Sorry, current chm help cant explains it.  May be help file mising.

TnrHid component (nrComm Lib) properties in help copied another section?


nrHid  can read another USB device strings from device?  How?

our device  can store any custom string
« Last Edit: July 22, 2009, 03:13:17 pm by hid1 »

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: How to identify between 2 idenditical devices? your opinion?
« Reply #4 on: July 27, 2009, 10:33:01 am »
Hello

PDO is physical device object. You need read Microsoft DDK/WDK for understand it.

About device properties. You can take a look public interfaces of the TnrHidDevice and TnrDevice classes.
See HIDDemo sources.

Roman Novgorodov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.