Samuel Guest
|
How can a send the sms i want and get the modem response |
Posted: Wed Apr 23, 2008 1:06 pm |
|
|
Code: | fprintf(GSM,"AT\r\n");
fgets(c,GSM);
while(!strcmp(c, pass)){
fgets(c,GSM);
delay_ms(500);
}
fprintf(GSM,"AT+CMGF=1\r\n");
fgets(c,GSM);
while(!strcmp(c, pass)){
fgets(c,GSM);
delay_ms(500);
}
//delay_ms(5000);
Mobile phone
fprintf(GSM,"AT+CPMS=\"ME\"\r\n");
delay_ms(5000);
fprintf(GSM,"AT+CMGD=3\r\n");
//deletes the text message at location3 so next command can be dealt with
fprintf(GSM,"AT+CMGS=\"+351968258828\"\r\n"); // sents the following text to this number
delay_ms(10000);
fprintf(GSM,"Shutdown Procedure Complete. Contact Authorities\r\n");
delay_ms(10000);
fputc(0x1A,GSM);
delay_ms(50000);
fprintf(GSM,"AT+CMSS=3\r\n");
fgets(c,GSM);
while(!strcmp(c, pass)){
fgets(c,GSM);
delay_ms(500);
} |
This is my code. I have 2 questions. I'm using the while() to get the acknowledge from the modem but it's not working, and the modem don't send the sms I want with that cmgw. Can someone help me pls? |
|