Uniqe identification of devices

  • Thread starter Thread starter Thore Berntsen
  • Start date Start date
T

Thore Berntsen

I have a C# application that runs on about 500 Pocket PC's (Intermec), and
when I talk to these Pocket PC's I need to know which Pocket PC I'm talking
to. Is there any way I can do this. Is there a unique identification in the
OS ? I think I have read something about this somewhere but I can't find
it.

Thore Berntsen
Norway
 
No, there's nothing in the OS itself that is unique. If the device has any
sort of wired or wireless Ethernet, the Ethernet address is globally unique,
so you could extract that. It's a six-byte value. Alternatively, you could
put a serial number in each device yourself (registry, maybe).

Paul T.
 
Thore,

There is an unmanaged DLL called "psuuid0c.dll" in the Intermec 700 Color
Development Tools that provides functions to return the serial number, MAC
address (of built-in Ethernet adapter) and UUID of an Intermec 700 Series
device. It is fairly easy to P/Invoke these functions, though you need to
know the C++ mangled names of the functions (I used the Dependency Checker
tool from the Windows Platform SDK to find these names, as it can load WinCE
binaries and show the exported symbols).

GetSerNum is exported as ?GetSerNum@@YAHPAGK@Z
GetMACaddr is exported as ?GetMACaddr@@YAHPAGK@Z
GetUUID is exported as ?GetUUID@@YAHPAEK@Z

Here is one way to get the serial number in C#. It should match the serial
number printed on the back of the device itself.

[DllImport("psuuid0c.dll", EntryPoint="?GetSerNum@@YAHPAGK@Z")]
public static extern int GetSerNum(StringBuilder SerNum, int len);

public string GetSerialNumber()
{
StringBuilder serNum = new StringBuilder(new string('\0', 12));
int result = GetSerNum(serNum, 12);
// TODO: raise exception if result is not 6 (700 Color) or 16 (700 Mono)
return serNum.ToString();
}

Just make sure psuuid0c.dll is in the app directory or \Windows and this
should work.

Hope that helps,
Darren

PS To get the 700 Color developer tools package mentioned above, plus other
development tools including the Intermec .NET SDK, you need to register for
access to the Intermec Developers Library:

http://home.intermec.com/eprise/main/Intermec/Content/Support/DevelopersSupport/IDL_Support
 
Like to add that these methods be available in the next .NET SDK release.

Ronald.

Darren Beckley said:
Thore,

There is an unmanaged DLL called "psuuid0c.dll" in the Intermec 700 Color
Development Tools that provides functions to return the serial number, MAC
address (of built-in Ethernet adapter) and UUID of an Intermec 700 Series
device. It is fairly easy to P/Invoke these functions, though you need to
know the C++ mangled names of the functions (I used the Dependency Checker
tool from the Windows Platform SDK to find these names, as it can load WinCE
binaries and show the exported symbols).

GetSerNum is exported as ?GetSerNum@@YAHPAGK@Z
GetMACaddr is exported as ?GetMACaddr@@YAHPAGK@Z
GetUUID is exported as ?GetUUID@@YAHPAEK@Z

Here is one way to get the serial number in C#. It should match the serial
number printed on the back of the device itself.

[DllImport("psuuid0c.dll", EntryPoint="?GetSerNum@@YAHPAGK@Z")]
public static extern int GetSerNum(StringBuilder SerNum, int len);

public string GetSerialNumber()
{
StringBuilder serNum = new StringBuilder(new string('\0', 12));
int result = GetSerNum(serNum, 12);
// TODO: raise exception if result is not 6 (700 Color) or 16 (700 Mono)
return serNum.ToString();
}

Just make sure psuuid0c.dll is in the app directory or \Windows and this
should work.

Hope that helps,
Darren

PS To get the 700 Color developer tools package mentioned above, plus other
development tools including the Intermec .NET SDK, you need to register for
access to the Intermec Developers Library:

http://home.intermec.com/eprise/main/Intermec/Content/Support/DevelopersSupport/IDL_Support

Thore Berntsen said:
I have a C# application that runs on about 500 Pocket PC's (Intermec), and
when I talk to these Pocket PC's I need to know which Pocket PC I'm talking
to. Is there any way I can do this. Is there a unique identification in the
OS ? I think I have read something about this somewhere but I can't find
it.

Thore Berntsen
Norway
 
Back
Top