created separate function for hex to char

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of SS_SensePOC2P0_11Dec2017_USERPID by rashmi v

Revision:
58:b75255e6e4c3
Parent:
57:e82d4bd6b2c0
Child:
59:dadb88794375
--- a/main.cpp	Fri Nov 10 11:58:38 2017 +0000
+++ b/main.cpp	Sat Nov 11 11:40:36 2017 +0000
@@ -110,7 +110,7 @@
     timer_battery.start();
     timer_debug.start();
     gc.printf("enter message to go into debug mode\n");
-
+    
    while(1)
    {
     
@@ -131,7 +131,7 @@
         else
         {
             EnableTouch();
-            gc.printf("c");
+            //gc.printf("c");
             switch(main_state)                                              // main state machine
              {
                 case GET_TOUCH_DISP_STATE:
@@ -729,7 +729,7 @@
 
     poc2p0_device_msg_res.chksum = checksum_struct((uint8_t *)poc2p0_device_msg_res.cmd, (sizeof(poc2p0_device_msg_res)-2));
 
-    //blue1.puts((const char *)&poc2p0_device_msg_res);
+    blue1.puts((const char *)&poc2p0_device_msg_res);
     gc.puts((const char *)&poc2p0_device_msg_res);
     
 }
@@ -737,6 +737,7 @@
 // this command response to heartbeat message request send by bluetooth device
 void poc2p0_send_device_heartbeat_msg_res(uint8_t curr_touch_state)
 {
+    gc.printf("hEATBEAT RQ\n");
     poc2p0_device_heartbeat_response    poc2p0_device_heartbeat_res = {0x00u};
 
     // RTC operations
@@ -778,7 +779,7 @@
     }
     else
     {
-        poc2p0_device_heartbeat_res.device_state = TOUCH_STATE_HOME_SCREEN;
+        poc2p0_device_heartbeat_res.device_state = 0x00u;
     }
     
     //poc2p0_device_heartbeat_res.device_state = device_state;
@@ -792,6 +793,40 @@
     poc2p0_device_heartbeat_res.chksum = checksum_struct((uint8_t *)poc2p0_device_heartbeat_res.cmd, (sizeof(poc2p0_device_heartbeat_res)-2));
 
     //blue1.puts((const char *)&poc2p0_device_heartbeat_res);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.sos);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.cmd);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.length);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.date_time.date);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.date_time.month);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.date_time.year);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.date_time.hour);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.date_time.mins);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.date_time.sec);
+    blue1.printf("%8x",poc2p0_device_heartbeat_res.pid);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.did);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.device_state);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.battery_status);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.eos);
+    blue1.printf("%2x",poc2p0_device_heartbeat_res.chksum);
+    blue1.printf("\n");
+    
+    gc.printf("%2x",poc2p0_device_heartbeat_res.sos);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.cmd);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.length);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.date_time.date);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.date_time.month);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.date_time.year);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.date_time.hour);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.date_time.mins);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.date_time.sec);
+    gc.printf("%8x",poc2p0_device_heartbeat_res.pid);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.did);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.device_state);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.battery_status);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.eos);
+    gc.printf("%2x",poc2p0_device_heartbeat_res.chksum);
+    gc.printf("\n");
+    
     gc.puts((const char *)&poc2p0_device_heartbeat_res);
 }
 
@@ -811,6 +846,6 @@
 
     poc2p0_device_tst_result_res.chksum = checksum_struct((uint8_t *)poc2p0_device_tst_result_res.cmd, (sizeof(poc2p0_device_tst_result_res)-2));
 
-    //blue1.puts((const char *)&poc2p0_device_tst_result_res);
+    blue1.puts((const char *)&poc2p0_device_tst_result_res);
     gc.puts((const char *)&poc2p0_device_tst_result_res);
 }