Changes done in ECG and BT

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of merged_code2_20sept_2017_4th_oct_2017 by nikita teggi

Revision:
46:162ed3f051b2
Parent:
45:067673dae242
Child:
47:3716dd41dba6
diff -r 067673dae242 -r 162ed3f051b2 bt.cpp
--- a/bt.cpp	Tue Sep 12 10:08:04 2017 +0000
+++ b/bt.cpp	Wed Sep 13 06:06:41 2017 +0000
@@ -149,11 +149,11 @@
                         
                          total_samples=0;   
                          sd_read1(bt_file1);               // read the sd card file
-                         mc.printf("sd file opened to read data in it\n");
+                       //  mc.printf("sd file opened to read data in it\n");
                          myBleMsg->bt_msg=bt_file1;         //copy the contents to the structure
                          send_structure();                                // send the initial string
                          blue.printf("\n");   
-                         mc.printf("sent initial string\n");                    
+                       //  mc.printf("sent initial string\n");                    
                          total_samples= myBleMsg->bt_msg.num_samples.num_sample_ppg_dummy+myBleMsg->bt_msg.num_samples.num_sample_ecg_OTtyp;
                          state_tx =0;
                          state_rx =2;
@@ -193,7 +193,7 @@
         blue.scanf("%02x", &chksum_rx);
         break;
     } 
-    mc.printf("%02x%02x%08x%02x%02x", sos_rx,ack_rx,length_rx,eos_rx,chksum_rx); 
+ //   mc.printf("%02x%02x%08x%02x%02x", sos_rx,ack_rx,length_rx,eos_rx,chksum_rx); 
     
      switch(state_rx)
          {
@@ -232,6 +232,7 @@
                       
                         state_tx=2;
                         setpos1(file_pointer_position);
+                        sd_close();                                                     //file closed which was opened earlier because it opens again in bt_send case 1
              
                         }
                     //blue.scanf("%02x%02x%08x%02x",&sos_rx,&ack_rx,&eos_rx,&chksum_rx);