storing variables in single array for transmission
Dependencies: SDFileSystem dspmodified mbed
Fork of FTPGET_Merged by
Diff: merged_code.cpp
- Revision:
- 11:63f48533dc6f
- Parent:
- 10:9184e2fb5974
--- a/merged_code.cpp Mon Mar 09 13:17:46 2015 +0000 +++ b/merged_code.cpp Wed Mar 11 06:40:21 2015 +0000 @@ -9,7 +9,7 @@ #define freq 1 #define fft_points 16384 #define dur_sec 16.384 -#define module_name "TST2" //enter module name here +#define module_name "NTFT" //enter module name here Serial pc(USBTX, USBRX); Serial gsm(D1, D0); @@ -53,6 +53,7 @@ char timestampname[30]=""; char timestamppath[30]=""; int maxfreq = 0; // For Timestamp Function +unsigned char CtrlZ = 0x1A; // For SMS Function int m=0,mfinal; int date, month, year, hour, minute, second,minuteold, secondold, temp = 0; @@ -174,7 +175,7 @@ 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(ftpputpathname,"%s/%02d%02d/%02d%02d%02d",module_name,year,month,year,month,date); // For FTPPUTPATHNAME feature + sprintf(ftpputpathname,"%s/%02d%02d/%02d/%02d",module_name,year,month,date,hour); // For FTPPUTPATHNAME feature //pc.printf("Ftpputpathname is %s\r\n",ftpputpathname); // For FTPPUTPATHNAME feature gsmerr=0; mkdir(main_dir,0777); @@ -639,11 +640,11 @@ wait(3); if(sendATcommand("AT+FTPTYPE=\"I\"", "OK", 5,0)) { - if(sendATcommand("AT+FTPSERV=\"ftp.ipage.com\"", "OK", 10,0)) + if(sendATcommand("AT+FTPSERV=\"ftp.panchsheel.biz\"", "OK", 10,0)) { - if(sendATcommand("AT+FTPUN=\"hdwwrite\"", "OK\r", 10,0)) + if(sendATcommand("AT+FTPUN=\"hardware@panchsheel.biz\"", "OK\r", 10,0)) { - if(sendATcommand("AT+FTPPW=\"Ghdu@3i\"", "OK\r", 10,0)) return 1; + if(sendATcommand("AT+FTPPW=\"DAStest123\"", "OK\r", 10,0)) return 1; } } } @@ -908,6 +909,20 @@ //} } +//--------------------------------------------------------------------------------------------------// +// SMS FUNCTION // +//--------------------------------------------------------------------------------------------------// + +void sms() { + pc.printf("\r\n Hi I am sending sms"); + sendATcommand("AT+CMGF=1\r", "OK", 10,0); + sendATcommand("AT+CMGS=\"09896389883\"\r", "OK", 5,0); + gsm.printf("Hi Hows You"); // Enter the sms here in this place + gsm.printf("%c", CtrlZ); + +} + + //----------------------------------------------------- MAIN LOOP ----------------------------------------------------------- int main()