From 7c54126c6997a0665600d591fe326e6ab9c22ee4 Mon Sep 17 00:00:00 2001 From: Jake Visser Date: Thu, 6 Jul 2017 00:01:43 -0700 Subject: [PATCH] Data extracted... need to work out how to convert the bit array --- qcbadge/Controllers/HomeController.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/qcbadge/Controllers/HomeController.cs b/qcbadge/Controllers/HomeController.cs index 1d0757b..2514cd8 100644 --- a/qcbadge/Controllers/HomeController.cs +++ b/qcbadge/Controllers/HomeController.cs @@ -163,12 +163,25 @@ namespace qcbadge.Controllers System.Diagnostics.Debug.WriteLine("*************************************"); System.Diagnostics.Debug.WriteLine("*************************************"); System.Diagnostics.Debug.WriteLine("*************************************"); + String qcData = advertData.Substring(24, 20); System.Diagnostics.Debug.WriteLine(qcData); - int badgeId = Convert.ToInt32(qcData.Substring(0, 3), 16); + String badgeIdStr = qcData.Substring(0, 4); + System.Diagnostics.Debug.WriteLine(badgeIdStr); + int badgeId = Convert.ToInt32(badgeIdStr, 16); System.Diagnostics.Debug.WriteLine(badgeId); + String curIconStr = qcData.Substring(4, 2); + System.Diagnostics.Debug.WriteLine(curIconStr); + int curIcon = Convert.ToInt32(curIconStr, 16); + System.Diagnostics.Debug.WriteLine(curIcon); + + //Need to convert the int to a bit array + String curIconArrStr = qcData.Substring(8, 10); + System.Diagnostics.Debug.WriteLine(curIconArrStr); + ulong curIconArr = Convert.ToUInt64(curIconArrStr, 16); + System.Diagnostics.Debug.WriteLine(curIconArr); return StatusCode(200);