Thanks a lot Jeff
   
  Regards
  Shruti

Jeff Loucks <[EMAIL PROTECTED]> wrote:
    Keeping in mind that not all devices have a serial number, I've used
the following for all platforms. If this doesn't produce a serial number,
  I've dropped back to a Bluetooth or WiFi MAC address, or an IMEI
  from a phone.
  -------------------------------------------
UInt32 companyID;
char serialNumber[32];
  FtrGet(sysFtrCreator,sysFtrNumOEMCompanyID,&companyID);
serialNumber[0] = 0;
if (companyID == 'hspr')
    {
    UInt16 size = sizeof(serialNumber);
    HsGetVersionString(hsVerStrSerialNo,platformInfo.serialNumber ,&size);
    }
else
    {
    UInt8 *p;
    UInt16 size;
    if (SysGetROMToken(0,sysROMTokenSnum,&p,&size) == 0 &&
            size > 0 && *p != 0xFF)
        {
        if (size > sizeof(serialNumber)-1) 
            size = sizeof(serialNumber)-1;
        MemMove(serialNumber,p,size);
        serialNumber[size] = 0;
        }
    }
-------------------------------------------


  On 2/23/07, Lukas Zeller <[EMAIL PROTECTED]> wrote:   Hi,

At 22:21 Uhr -0800 22.2.2007, you, Shruti Wadhwa wrote:
>I used the function PhnLibGetDeviceID (UInt16 refNum, CharPtr * 
>deviceId) to get the device ID of my Treo 650.
>What i noticed is that for two Treo 650 it is giving the same ID.
>
>Am i wrong somewhere ?
>Is there another way to get the Device ID ? I believe it is unique 

I've always used PhnLibCardInfo() instead of PhnLibGetDeviceID() as
the latter crashes e.g. on the Treo600.

In both cases, make sure you open the Phone lib (PhnLibOpen) before
trying to get the serial. In addition, I use a fallback to 
HsGetVersionString() in case the PhnLibCardInfo()  does not succeed.

So far, I haven't encountered duplicate device IDs with this implementation.

Best regards,
--
Lukas Zeller ( [EMAIL PROTECTED])
-
Synthesis AG, SyncML Solutions  & Sustainable Software Concepts
[EMAIL PROTECTED], http://www.synthesis.ch


--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/




-- 
CMRPigs
MRNotPigs
OSMR2Pigs
LILBMRPigs!
Jeff Loucks -- For information on using the PalmSource Developer Forums, or to 
unsubscribe, please see http://www.palmos.com/dev/support/forums/

 
---------------------------------
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.
-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to