Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem dspmodified mbed
Diff: merged_code.cpp
- Revision:
- 5:11c455ebcc34
- Parent:
- 4:668d7227d060
- Child:
- 6:87c4ae320c7c
--- a/merged_code.cpp Tue Feb 17 10:18:49 2015 +0000
+++ b/merged_code.cpp Mon Mar 02 11:43:10 2015 +0000
@@ -35,7 +35,6 @@
char pathDCdetect[100] ="";
char pathfft[100]="";
//char putpathname[100]="";
-
char filenameAC[100] ="";
char filenameDC[100] ="";
char filenamefft[100] ="";
@@ -48,6 +47,7 @@
const char s[2] = "!"; // For FTPGET Function
char src[100]=""; // For FTPGET Function
char ftp_timestamp[100]=""; //For Timestamp.txt filename
+char ftpputpathname[100]=""; // For FTPPUTHPATH NAME
int m=0,mfinal;
int date, month, year, hour, minute, second,minuteold, secondold, temp = 0;
@@ -157,7 +157,8 @@
sprintf(hour_dir,"%s/%s%02d%02d%02d%02d",date_dir,sitename,year,month,date,hour);
sprintf(filepath,"%s/%s%02d%02d%02d%02d%02d%02d",hour_dir,sitename,year,month,date,hour,minute,second);
sprintf(filename,"%s%02d%02d%02d%02d%02d%02d",sitename,year,month,date,hour,minute,second);
- //sprintf(putpathname,
+ sprintf(ftpputpathname,"%s/%s%02d%02d/%s%02d%02d%02d",module_name,sitename,year,month,sitename,year,month,date); // For FTPPUTPATHNAME feature
+ //pc.printf("Ftpputpathname is %s\r\n",ftpputpathname); // For FTPPUTPATHNAME feature
gsmerr=0;
mkdir(main_dir,0777);
mkdir(month_dir,0777);
@@ -607,7 +608,7 @@
//pc.printf("\r\nftp_put attempt\n\r");
// pc.printf("\r\nChar count %d\n\r",char_cnt);
if(sendATcommand(command1,result1, 10,0)) {
- sprintf(command2,"%s/%s/\"", "AT+FTPPUTPATH=\"", module_name);
+ sprintf(command2,"%s/%s/\"", "AT+FTPPUTPATH=\"", ftpputpathname); // For FTPPUTPATHNAME Feature
//sprintf(result2,"%s", "OK");
sendATcommand(command2,"OK", 10,0);
if((sendATcommand("AT+FTPPUT=1", "OK", 10,2))==2) {
@@ -686,9 +687,7 @@
sprintf(dest,"%s",incoming_data);
pc.printf("\r\n Download finished");
wait(15);
-
- //memset(dest, '\0', sizeof(dest));
-
+
char *token;
token = strtok(dest, s);
token = strtok(NULL,s);
@@ -747,7 +746,7 @@
else
{
pc.printf("\r\n Deleting requested file\r\n");
- do_remove(removefile);
+ remove(removefile);
pc.printf("\r\n File Deleted\r\n");
}
}