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:
57:e82d4bd6b2c0
Parent:
43:85a7f399cb9d
Child:
59:dadb88794375
--- a/bp.cpp	Fri Nov 03 07:16:44 2017 +0000
+++ b/bp.cpp	Fri Nov 10 11:58:38 2017 +0000
@@ -49,7 +49,8 @@
     uint8_t lead_reg=0;
     uint32_t concatenate_value2 = 0;    //int to uint32_t-Suhasini-21stJuly2017
     uint8_t chk = 1;    //unsigned char to uint8_t-Suhasini-21stJuly2017
-  
+    uint32_t bp_test_result = 0x00u;
+
     //Declaration of  Master structure
     
     BLEMsg_info *ptr_BLEMsg_info_bp, BLEMsg_info_bp; // A copy of master strcuture [ "BLEMsg_info" ] by name "BLEMsg_info_bp" is created
@@ -216,6 +217,9 @@
     
      if((SBP > MAX_SBP_THRESHOLD || SBP < MIN_SBP_THRESHOLD)  && (DBP > MAX_DBP_THRESHOLD || DBP < MIN_SBP_THRESHOLD))              // checking for range below and above and then displaying error
      {
+        // send BP result improper messages to mobile application
+        poc2p0_send_device_msg_res(BP_RESULT_IMPROPER_RES);
+
         screen_bp_error();             // checking for error out of range- nikita 10-7-17
         del_ppg_ecg_BPfile(pid);                          // Copy ECG and PPG data to BP file
         delete_subfiles(pid);     //added on 11/8/17 nikita
@@ -226,6 +230,14 @@
         create_single_BPfile(pid);                          // Copy ECG and PPG data to BP file
         structure_file(ptr_BLEMsg_info_bp, pid);            // Copy BP structure to main file
         bpfile_mainfile(pid);
+
+        bp_test_result = (uint16_t)(DBP);
+        bp_test_result = (bp_test_result << 16);
+        bp_test_result = (bp_test_result & 0xFF00u) | ((uint16_t)SBP);
+
+        // send BP final result messages to mobile application
+        poc2p0_send_device_test_result_res (BP_TEST_SUCCSS_RES, bp_test_result);
+
         screen_bp1(SBP,DBP);
         if(get_filecreated_status() == false)                           //if file is in write mode 
         {   
@@ -240,7 +252,11 @@
     // Add display sequence for Finger detect fail  //Added Nidhin 16/6/17 
     maxim_max30102_reset();
     bpr.printf("no finger detect\n");
-      screen_ecg_lead_bp_fingerdetect();
+
+    // send BP lead off and finger improper messages to mobile application
+    poc2p0_send_device_msg_res(BP_LEADOFF_FINGER_IMPROPER_RES);
+
+    screen_ecg_lead_bp_fingerdetect();
   }  //Added Nidhin 16/6/17 
      screen_ecg_bp() ; 
 }