|
|
@@ -212,19 +212,18 @@ public class ArrowSerialPort : MonoBehaviour
|
|
|
private void OnDeviceButton(byte[] bytes)
|
|
|
{
|
|
|
Debug.Log($"{PortName} 收到设备按键消息!");
|
|
|
- var check = bytes[1] + bytes[2] + bytes[3];//校验:命令+长度+数据内容
|
|
|
+ var check = bytes[1] + bytes[2] + bytes[3];
|
|
|
+ //校验:命令+长度+数据内容
|
|
|
//if (check != bytes[4])
|
|
|
//{
|
|
|
// LOG("OnDeviceButton 数据校验错误!");
|
|
|
//}
|
|
|
//else
|
|
|
- if (bytes[3] == 0x01 || bytes[3] == 0x02 || bytes[3] == 0x03)
|
|
|
- {
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(UserSettings.ins.selectDevicesName))
|
|
|
//开机
|
|
|
RequestDeviceIno();
|
|
|
- return;
|
|
|
- }
|
|
|
- SerialPortHelper.aim?.Invoke(bytes);
|
|
|
+ SerialPortHelper.aim?.Invoke(bytes);
|
|
|
}
|
|
|
|
|
|
#endregion
|