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:
61:ce5ad0838227
Parent:
60:3bb9e9ba3205
Child:
62:7d2a844ed639
--- a/main.cpp	Tue Nov 14 12:03:36 2017 +0000
+++ b/main.cpp	Wed Nov 15 16:10:05 2017 +0000
@@ -359,7 +359,7 @@
     static uint8_t state=0;
     static uint8_t ecg_flag=0;                                  // ecg_flag to indicate the ecg test is already done for the same pid
     static uint8_t glc_flag=0;                                  // glc_flag to indicate the glc test is already done for the same pid
-    uint16_t heart_rate=0; 
+    //uint16_t heart_rate=0; 
 
     
     switch(state1)                                              // state for display screens
@@ -473,27 +473,9 @@
                 // send ECG test in progress messages to mobile application
                 poc2p0_send_device_msg_res(ECG_TEST_IN_PROGRESS_RES);
 
-                heart_rate=ecg(pid);                                            // capturing ecg
+                ecg(pid);                                            // capturing ecg
                 state1=0;
-                if (heart_rate==0)
-                {
-                    // send ECG lead off messages to mobile application
-                    poc2p0_send_device_msg_res(ECG_LEADOFF_RES);
-                    screen_ecg_lead();
-                }
-                else if(heart_rate==1)                                          // if heart rate goes above or below range display error // 10/7/17 nikita
-                {
-                    // send ECG result improper messages to mobile application
-                    poc2p0_send_device_msg_res(ECG_RESULT_IMPROPER_RES);
-                    screen_ecg_error();
-                }
-                else
-                {
-                    // send ECG final result messages to mobile application
-                    poc2p0_send_device_test_result_res (ECG_TEST_SUCCSS_RES, (uint32_t)heart_rate);
-                    screen_ecg_2(heart_rate);
-                    ecg_flag=1;
-                }
+                ecg_flag=1;
                 state=6;
                 eprom_write_8(30,1);
                 nstate=state;
@@ -731,6 +713,13 @@
     poc2p0_device_msg_res.chksum = checksum_struct((uint8_t *)&poc2p0_device_msg_res.cmd, (sizeof(poc2p0_device_msg_res)-1));
 
     //blue1.puts((const char *)&poc2p0_device_msg_res);
+    blue1.printf("%2x\n",poc2p0_device_msg_res.sos);
+    blue1.printf("%2x\n",poc2p0_device_msg_res.cmd);
+    blue1.printf("%2x\n",poc2p0_device_msg_res.length);
+    blue1.printf("%2x\n",poc2p0_device_msg_res.eos);
+    blue1.printf("%2x\n",poc2p0_device_msg_res.chksum);
+    blue1.printf("\n");
+    
     gc.printf("%2x\n",poc2p0_device_msg_res.sos);
     gc.printf("%2x\n",poc2p0_device_msg_res.cmd);
     gc.printf("%2x\n",poc2p0_device_msg_res.length);
@@ -738,7 +727,7 @@
     gc.printf("%2x\n",poc2p0_device_msg_res.chksum);
     gc.printf("\n");
     
-    gc.puts((const char *)&poc2p0_device_msg_res);
+    //gc.puts((const char *)&poc2p0_device_msg_res);
     
 }
 
@@ -834,7 +823,7 @@
     gc.printf("%2x",poc2p0_device_heartbeat_res.chksum);
     gc.printf("\n");
     
-    gc.puts((const char *)&poc2p0_device_heartbeat_res);
+    //gc.puts((const char *)&poc2p0_device_heartbeat_res);
 }
 
 // this command send final test result response to bluetooth device
@@ -854,6 +843,14 @@
     poc2p0_device_tst_result_res.chksum = checksum_struct((uint8_t *)&poc2p0_device_tst_result_res.cmd, (sizeof(poc2p0_device_tst_result_res)-1));
 
     //blue1.puts((const char *)&poc2p0_device_tst_result_res);
+    blue1.printf("%2x\n",poc2p0_device_tst_result_res.sos);
+    blue1.printf("%2x\n",poc2p0_device_tst_result_res.cmd);
+    blue1.printf("%2x\n",poc2p0_device_tst_result_res.length);
+    blue1.printf("%8x\n",poc2p0_device_tst_result_res.test_result);
+    blue1.printf("%2x\n",poc2p0_device_tst_result_res.eos);
+    blue1.printf("%2x\n",poc2p0_device_tst_result_res.chksum);
+    blue1.printf("\n");
+    
     gc.printf("%2x\n",poc2p0_device_tst_result_res.sos);
     gc.printf("%2x\n",poc2p0_device_tst_result_res.cmd);
     gc.printf("%2x\n",poc2p0_device_tst_result_res.length);
@@ -862,5 +859,5 @@
     gc.printf("%2x\n",poc2p0_device_tst_result_res.chksum);
     gc.printf("\n");
      
-    gc.puts((const char *)&poc2p0_device_tst_result_res);
+    //gc.puts((const char *)&poc2p0_device_tst_result_res);
 }