接收串口字节数组时,高低字节位转UInt16,

byte[] recData = new byte[4]{0x12,0x34,0x45,0x44};

UInt16 m_BatteryLevel = (UInt16)((UInt16)rawData[10] | ((UInt16)rawData[11] << 8));

你可能感兴趣的:(接收串口字节数组时,高低字节位转UInt16,)