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