storing variables in single array for transmission
Dependencies: SDFileSystem dspmodified mbed
Fork of FTPGET_Merged by
Diff: merged_code.cpp
- Revision:
- 4:668d7227d060
- Parent:
- 3:726f275f04ac
- Child:
- 5:11c455ebcc34
--- a/merged_code.cpp Tue Feb 17 07:37:15 2015 +0000 +++ b/merged_code.cpp Tue Feb 17 10:18:49 2015 +0000 @@ -54,7 +54,7 @@ unsigned long var = 0; unsigned long currentMillis = 0; int gsmerr=0; -//char pswd[100]= "*PSNWID:"; + time_t previous; @@ -354,17 +354,22 @@ { pc.printf("\r\n Deleting... \r\n"); DIR *d = opendir(fsrc); - struct dirent *p; - char path[100] = {0}; - while((p = readdir(d)) != NULL) { + if(d==NULL) + { + pc.printf("\r\n NULL Condition\r\n"); + return; + } + else + { + struct dirent *p; + char path[100] = {0}; + while((p = readdir(d)) != NULL) { strcpy(path, fsrc); - pc.printf("\r\n path1 is %s\r\n",path); strcat(path, "/"); - pc.printf("\r\n path2 is %s\r\n",path); strcat(path, p->d_name); - pc.printf("\r\n path3 is %s\r\n",path); remove(path); } + } closedir(d); remove(fsrc); } @@ -680,7 +685,7 @@ pc.printf("Incoming_Data is %s\r\n",incoming_data); sprintf(dest,"%s",incoming_data); pc.printf("\r\n Download finished"); - wait(20); + wait(15); //memset(dest, '\0', sizeof(dest));