1
0
mirror of synced 2024-11-24 06:40:11 +01:00

Disable Debug Logs for Serial

This commit is contained in:
Kylemc1413 2022-05-27 20:47:03 -04:00
parent 4053004c2a
commit 4f1af5e368

View File

@ -47,7 +47,7 @@ public class Serial : MonoBehaviour
{
Console.WriteLine($"Failed to Open Serial Ports: {ex}");
}
Debug.Log("Touch Serial Initializing..");
//Debug.Log("Touch Serial Initializing..");
SetSettingData_160();
SetSettingData_201();
SetSettingData_162();
@ -97,7 +97,7 @@ public class Serial : MonoBehaviour
{
if(StartUp)
{
Debug.Log("Sending Touch State");
//Debug.Log("Sending Touch State");
// Debug.Log("Sending Left");
SendTouch(ComL, TouchPackL);
// Debug.Log("Sending Right");
@ -143,34 +143,34 @@ public class Serial : MonoBehaviour
byte syncCheckSum = (byte)44;
syncbytes.Add(syncCheckSum);
Serial.Write(syncbytes.ToArray(), 0, syncbytes.Count);
Debug.Log($"GET SYNC BOARD VER {side}");
//Debug.Log($"GET SYNC BOARD VER {side}");
break;
case CMD_NEXT_READ:
//Response: corresponding read bytes + checksum
StartUp = false;
Debug.Log($"Side {side} NEXT READ {Convert.ToByte(data[2])}");
//Debug.Log($"Side {side} NEXT READ {Convert.ToByte(data[2])}");
switch (Convert.ToByte(data[2]))
{
case 0x30:
var bytes = ByteHelper.ConvertStringToByteArray(read1);
bytes.Add(ByteHelper.CalCheckSum(bytes.ToArray(), bytes.Count));
Debug.Log("Read 1");
//Debug.Log("Read 1");
Serial.Write(bytes.ToArray(), 0, bytes.Count);
break;
case 0x31:
var bytes2 = ByteHelper.ConvertStringToByteArray(read2);
bytes2.Add(ByteHelper.CalCheckSum(bytes2.ToArray(), bytes2.Count));
Debug.Log("Read 2");
//Debug.Log("Read 2");
Serial.Write(bytes2.ToArray(), 0, bytes2.Count);
break;
case 0x33:
var bytes3 = ByteHelper.ConvertStringToByteArray(read3);
bytes3.Add(ByteHelper.CalCheckSum(bytes3.ToArray(), bytes3.Count));
Debug.Log("Read 3");
//Debug.Log("Read 3");
Serial.Write(bytes3.ToArray(), 0, bytes3.Count);
break;
default:
Debug.Log("Extra Read");
//Debug.Log("Extra Read");
break;
}
break;
@ -187,21 +187,21 @@ public class Serial : MonoBehaviour
unitBytes.AddRange(ByteHelper.ConvertStringToByteArray(UNIT_BOARD_VER));
unitBytes.Add(unitCheckSum);
Serial.Write(unitBytes.ToArray(), 0, unitBytes.Count);
Debug.Log($"GET UNIT BOARD VER {side}");
//Debug.Log($"GET UNIT BOARD VER {side}");
break;
case CMD_MYSTERY1:
StartUp = false;
Serial.Write(SettingData_162, 0, 3);
Debug.Log($"MYSTERY 1 SIDE {side}");
//Debug.Log($"MYSTERY 1 SIDE {side}");
break;
case CMD_MYSTERY2:
StartUp = false;
Serial.Write(SettingData_148, 0, 3);
Debug.Log($"MYSTERY 2 SIDE {side}");
//Debug.Log($"MYSTERY 2 SIDE {side}");
break;
case CMD_START_AUTO_SCAN:
Serial.Write(SettingData_201.ToArray(), 0, 3);
Debug.Log($"START AUTO SCAN SIDE {side}");
//Debug.Log($"START AUTO SCAN SIDE {side}");
StartUp = true;
if (!_touchThread.IsAlive)
_touchThread.Start();
@ -214,7 +214,7 @@ public class Serial : MonoBehaviour
break;
case 154:
StartUp = false;
Debug.Log("BAD");
//Debug.Log("BAD");
break;
}
}