export test

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of Int_Demo_09May2017_Suhasini_HRavg_Nikita_ili9341 by nikita teggi

Revision:
19:1650bbc923cc
Parent:
17:22a87e12fb3a
Child:
20:7c64e6ecad76
--- a/sdcard.cpp	Fri Jun 09 09:22:32 2017 +0000
+++ b/sdcard.cpp	Fri Jun 09 17:12:21 2017 +0000
@@ -126,6 +126,82 @@
     fprintf(fp,"%d\n", value);
  }
  
+ 
+ void sd_open_read(int32_t pid)          // opening the file for read
+ {
+     
+  char buffer1[32];
+   sprintf(buffer1,"/sd/%d.csv",pid);
+  fp = fopen(buffer1,"r"); 
+  if (fp==NULL)
+  {
+      snd.printf("no");
+      }
+      
+      else 
+      {
+          snd.printf("yes");
+          }
+ }
+ 
+ void sd_read(uint32_t  *v1, int size)          //reading the data from the openend file
+ {
+     fread(v1,sizeof(v1),size,fp);
+ }
+
+void setpos()
+{
+     //fseek ( fp , 1 , SEEK_SET );
+     rewind (fp);
+}
+
+void setpos1(uint32_t position)
+{
+     fseek ( fp , position, SEEK_SET );
+     //rewind (fp);
+}
+
+
+int file_size()    
+   {
+     int file_length;
+     fseek (fp, 0, SEEK_END);
+     file_length=ftell(fp);
+     file_length=sizeof(char)*file_length;
+        rewind(fp);
+     return   file_length;
+     }  
+     
+     
+     int file_size1()    
+   {
+     int file_length;
+    // fseek (fp, 0, SEEK_END);
+
+     file_length=ftell(fp);
+      // file_length=sizeof(char)*file_length;
+      //  rewind(fp);
+     return   file_length;
+     }  
+  
+
+
+
+ 
+     void sd_read1(BLEMsg_info &f)
+{
+     fread(&f,sizeof(BLEMsg_info),1,fp);
+      //fscanf(fp,"%08x",&v1);
+}
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
  //------------------------------------------------------
   
 //FILE *sd_BP_ecgwrite (int value)      // writing data into the file NIDHIN