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:
48:f90edb35a20e
Parent:
47:3716dd41dba6
Child:
52:7d9ff7781bdc
diff -r 3716dd41dba6 -r f90edb35a20e bt.cpp
--- a/bt.cpp	Wed Sep 13 11:24:19 2017 +0000
+++ b/bt.cpp	Fri Sep 15 07:38:47 2017 +0000
@@ -54,12 +54,13 @@
                   file_start=0;           
                   count_send=0;  total_samples=0;  
                   file_pointer_position=0;
-    mc.printf("bt_pid = %d\n",get_btpid());
+                 mc.printf("bt_pid = %d\n",get_btpid());
                 if(get_filepid()>get_btpid())                           //check for pid and bluetooth pid by reading from file
                 {
                     send_initial_string(); 
                     blue.printf("\n"); 
-                    file=sd_open_read(get_btpid());
+                    file=sd_open_read(get_btpid());                         // open the file for reading
+                    total_file_size=file_size();                           // determined the file size 
                     state_rx = 1;  
                 }
                          
@@ -73,7 +74,7 @@
                    
        case 2:   total_samples=0; 
                  //file=sd_open_read(get_btpid());  
-                 total_file_size=file_size() ;                           // determined the file size 
+                // total_file_size=file_size() ;                           // determined the file size 
                  sd_read1(bt_file1);                                    // read the sd card file
                  mc.printf("sd file opened to read data in it\n");
                  myBleMsg->bt_msg=bt_file1;                              //copy the contents to the structure
@@ -136,7 +137,7 @@
                   break;        
                
          
-        case 4:   total_file_size_sent=file_size1();
+        case 4:  // total_file_size_sent=file_size1();
                  if(total_file_size_sent==total_file_size)          // if the total file size is same as total file size
                      {                                         // then there is no more data to send in that particular file
                     
@@ -214,7 +215,7 @@
                       { 
                        
                         state_tx=1;
-                       sd_close();
+                        sd_close();
                       }
                    break;