fix truncation bug

This commit is contained in:
Jake Visser 2017-07-19 18:33:30 -07:00
commit e7efeb1d61

View file

@ -192,7 +192,7 @@ namespace qcbadge.Controllers
//lets do some CRC things //lets do some CRC things
String crcData = advertData.Substring(6, 18); String crcData = advertData.Substring(6, 20);
System.Diagnostics.Debug.WriteLine("CRC to check: " + crcData.ToString()); System.Diagnostics.Debug.WriteLine("CRC to check: " + crcData.ToString());
ushort crcrsp = CCITT_CRC16(crcData); ushort crcrsp = CCITT_CRC16(crcData);
System.Diagnostics.Debug.WriteLine("CRC resp: " + crcrsp.ToString()); System.Diagnostics.Debug.WriteLine("CRC resp: " + crcrsp.ToString());
@ -206,7 +206,7 @@ namespace qcbadge.Controllers
String qcData = advertData.Substring(6, 18); String qcData = advertData.Substring(6, 20);
System.Diagnostics.Debug.WriteLine(qcData); System.Diagnostics.Debug.WriteLine(qcData);
String badgeIdStr = qcData.Substring(0, 4); String badgeIdStr = qcData.Substring(0, 4);
@ -220,7 +220,7 @@ namespace qcbadge.Controllers
System.Diagnostics.Debug.WriteLine(curIcon); System.Diagnostics.Debug.WriteLine(curIcon);
//Need to convert the int to a bit array //Need to convert the int to a bit array
String curIconArrStr = qcData.Substring(6, 12); String curIconArrStr = qcData.Substring(6, 14);
System.Diagnostics.Debug.WriteLine(curIconArrStr); System.Diagnostics.Debug.WriteLine(curIconArrStr);
long curIconArr = Convert.ToInt64(curIconArrStr, 16); long curIconArr = Convert.ToInt64(curIconArrStr, 16);
System.Diagnostics.Debug.WriteLine(curIconArr); System.Diagnostics.Debug.WriteLine(curIconArr);