From eba14c8b1d4a1c43c100ae90a1cd809c63987fff Mon Sep 17 00:00:00 2001 From: Jake Visser Date: Thu, 20 Jul 2017 18:35:48 -0700 Subject: [PATCH] CRC should be ints or hex..not either or.. to int it is --- qcbadge/Controllers/HomeController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qcbadge/Controllers/HomeController.cs b/qcbadge/Controllers/HomeController.cs index 687e217..aa57eb6 100644 --- a/qcbadge/Controllers/HomeController.cs +++ b/qcbadge/Controllers/HomeController.cs @@ -204,8 +204,9 @@ namespace qcbadge.Controllers byte crc8res = (byte)(recbytes[0] ^ recbytes[1]); System.Diagnostics.Debug.WriteLine("CRC the byte: " + crc8res); String crcFinal = advertData.Substring(26, 2); + int crcFinalInt = Convert.ToInt32(crcFinal, 16); - if(crcFinal.Equals(crc8res)) + if (crcFinalInt == crc8res) { String qcData = advertData.Substring(6, 22); System.Diagnostics.Debug.WriteLine(qcData);