storing variables in single array for transmission

Dependencies:   SDFileSystem dspmodified mbed

Fork of FTPGET_Merged by Pravin Magar

Revision:
2:e5b9aefbcdeb
Parent:
1:56e7680a6339
Child:
3:726f275f04ac
--- a/merged_code.cpp	Mon Feb 16 11:02:26 2015 +0000
+++ b/merged_code.cpp	Mon Feb 16 11:41:18 2015 +0000
@@ -629,7 +629,7 @@
 
 {
     int x = 0;
-    char removefile[100]="";
+    
     wait(10);
     ftp_connect(); 
     
@@ -707,10 +707,15 @@
                      else if(atoi(token) ==4)
                      {
                          //FOR DELETING THE SELECTED FILE
+                         char removefile[100]="";
                         pc.printf("\r\n Deleting....\r\n");
                         token = strtok(NULL,s);
-                        sprintf(removefile,"%s",token);
+                        sprintf(removefile,token);
                         pc.printf("Removefile is %s\r\n",removefile);
+                        pc.printf("\r\n Deleting requested file\r\n");
+                        remove(removefile);
+                        pc.printf("\r\n File Deleted\r\n");
+                            /*
                             if(removefile==NULL)
                             {
                                 pc.printf("\r\n NULL Condition\r\n");
@@ -721,43 +726,15 @@
                                 pc.printf("\r\n Deleting requested file\r\n");
                                 remove(removefile);
                                 pc.printf("\r\n File Deleted\r\n");
-                            }
+                            }*/
                       } 
+                      /*
                       else if(atoi(token)==5)
                       {
                         pc.printf("\r\n Remote Configuration\r\n");
                       }
-                       wait(5);
-                                        
-                        // For Request of multiple file path logic refer abc.text
-                    
-                    //
-                    
-                    //pc.printf("FTP Send function\r\n");
-                   // ftp_connect();
-                   
-                    //ftp_put(1);
-                    
-                    // FOR MAKING ABC.TXT FILE BLANK
-                    
-                    //wait(10);
-                    //ftp_connect();
-                    //wait(5);
-                    //sendATcommand("AT+FTPGETNAME=\"abc.txt\"", "OK", 5,0);
-                    //sendATcommand("AT+FTPGETPATH=\"/\"", "OK", 5,0);
-                    //sendATcommand("AT+FTPDELE=\"abc.txt\"", "OK", 5,0);
-                    /*
-                    if (strcmp(ftpget,mod_reset)==0)
-                    {
-                        pc.printf("Module reset\r\n");
-                        reset_mod();
-                    }
-                    else if (ftpget==NULL)
-                    {
-                        return;
-                    }
-                    
-                    
+                      // wait(5);
+                                      
                     FILE *fp1 = fopen("/sd/Query.txt","w");
                     fprintf(fp1,"%s",ftpget);
                     fclose(fp1);
@@ -776,16 +753,10 @@
      else
      {
         return;
-        //pc.printf("Error openning the FTP session");
-        //pc.printf("\r\n");
-        //pc.printf("\r\n Connecting again\r\n");
-        //downloadFTP();
      }
    
 }
 
-
-
 void FTP_Fun()
 {
     /*tid6 = osThreadGetId();