ReadSerialNumber() 공개 메소드

public ReadSerialNumber ( byte &data ) : bool
data byte
리턴 bool
        private bool IsDeviceWithinBlink1mk2Range(HidDevice device)
        {
            byte[] serialBytes;

            var readSerial = device.ReadSerialNumber(out serialBytes);

            if (!readSerial)
            {
                return false;
            }

            return serialBytes[0] == 0x32;
        }
예제 #2
0
        static uint GetSerialNumber(HidDevice device)
        {
            byte[] sn;
            device.ReadSerialNumber(out sn);

            string snString = System.Text.Encoding.Unicode.GetString(sn).TrimEnd("\0".ToArray());
            return (Convert.ToUInt32(snString, 16) * 10);
        }
예제 #3
0
        private static Tuple<string, DeviceType> IdentityDevice(HidDevice device)
        {
            byte[] output;

            device.ReadSerialNumber(out output);

            var chars = (from o in output where o != 0 select (char) o).ToArray();

            var deviceType = DetermineDeviceType(output[0]);

            var serialNumber = string.Format("0x{0}", string.Join(string.Empty, chars));

            return Tuple.Create(serialNumber, deviceType);
        }