|
|
@@ -54,13 +54,10 @@ public class SerialPortExample : MonoBehaviour
|
|
|
serialPortUtility.Open();
|
|
|
|
|
|
LOG($"{PortName} 串口打开");
|
|
|
- // if (PortName.Contains("/dev/ttyS0"))
|
|
|
- // {
|
|
|
- //拉取二维码
|
|
|
- RequestUrl(dataIndex);
|
|
|
- //拉取后台数据
|
|
|
- ReqSettingData();
|
|
|
- // }
|
|
|
+ //拉取二维码
|
|
|
+ RequestUrl(dataIndex);
|
|
|
+ //拉取后台数据
|
|
|
+ ReqSettingData();
|
|
|
#endif
|
|
|
#if UNITY_EDITOR
|
|
|
TestBackUrl();
|
|
|
@@ -126,9 +123,6 @@ public class SerialPortExample : MonoBehaviour
|
|
|
|
|
|
void OnUrlPayResponse(byte[] bytes)
|
|
|
{
|
|
|
- if (!PortName.Contains("/dev/ttyS0"))
|
|
|
- return;
|
|
|
-
|
|
|
//计算校验值
|
|
|
byte tempResponseCheck = 0;
|
|
|
for (int i = 2; i < bytes.Length - 1; i++)
|
|
|
@@ -321,9 +315,6 @@ public class SerialPortExample : MonoBehaviour
|
|
|
{
|
|
|
if (bytes[1] == 0x55)//旧
|
|
|
{
|
|
|
- // if (!PortName.Contains("/dev/ttyS8"))
|
|
|
- // return;
|
|
|
-
|
|
|
if (bytes[4] == 0xA6)//投币
|
|
|
{
|
|
|
Debug.Log("旧版投币数量:" + bytes[4]);
|
|
|
@@ -336,9 +327,6 @@ public class SerialPortExample : MonoBehaviour
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- // if (!PortName.Contains("/dev/ttyS0"))
|
|
|
- // return;
|
|
|
-
|
|
|
//0x04:为按键是否按下的命令
|
|
|
if (bytes[1] == 0x04)//退出
|
|
|
{
|