简体   繁体   中英

Motorola MC55 Unique ID

In Motorola MC55, I'd like to get the factory or unique id or serial no of the scanner. How to code it in vb.net?

You could P/Invoke to get the DeviceUniqueID of the device

 //DeviceID for Win Mobile >= 5.0
    [DllImport("coredll.dll")]
    private extern static int GetDeviceUniqueID([In, Out] byte[] appdata, int cbApplictionData, int dwDeviceIDVersion,
                                                [In, Out] byte[] deviceIDOuput, out uint pcbDeviceIDOutput);




  private static string getDeviceID()
    {
            string appString = "Your App Name";
            byte[] appData = new byte[appString.Length];
            for (int count = 0; count < appString.Length; count++)
            {
                appData[count] = (byte)appString[count];
            }

            int appDataSize = appData.Length;
            byte[] DeviceOutput = new byte[20];
            uint SizeOut = 20;
            GetDeviceUniqueID(appData, appDataSize, 1, DeviceOutput, out SizeOut);

            string idString = "";
            for (int i = 0; i < DeviceOutput.Length; i++)
            {
                if (i == 4 || i == 6 || i == 8 || i == 10)
                    idString = String.Format("{0}-{1}", idString, DeviceOutput[i].ToString("x2"));
                else
                    idString = String.Format("{0}{1}", idString, DeviceOutput[i].ToString("x2"));
            }
            return idString;

    }

EDIT: NOTE this is a C# solution sorry at first i did not see that you wanted VB solution, but for anyone wanting a C# solution, this should work for you.

Since its a piece of mobile equipment it will have an IMEI number, so how about that? You can retreive it with ATD*#06# or AT++CGSN .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM