|
|
View previous topic :: View next topic |
Author |
Message |
kamillas
Joined: 24 Oct 2011 Posts: 50
|
sms controller |
Posted: Mon Mar 12, 2012 6:41 am |
|
|
Hello,
I am working out a program that will send me a sms in my mobile phone, to me indicates an alarm system was triggered in my house, I downloaded courses on programming modules gsm :
1 - I found this code:
• To send a sms
Code: | //envoirSMS
void _UPSSMS()
{
fprintf(GSM, "AT\r\n"); // ??????????
delay_ms (500);
fprintf(GSM, "AT+CMGF=1\r\n"); // ??????????
delay_ms (500);
fprintf(GSM, "AT+CMGD=1\r\n");//delete the received message from memory possition 1
delay_ms(500);
fprintf(GSM, "at+cmgs=\"09276553965\"\r\n");// ????????
delay_ms(500);
fprintf(GSM, "TEST\n"); // ?????????????
putc(0x1A);// ???????????????
delay_ms(500);
state=0;
}
|
- I am looking for an explanation of the commands I have mid or question marks.
- Does this code (UPSSMS ()) is just to send a sms with gsm module.
2 - what I want the code to allow the mobile phone to read sms received.
Thank you for postulated explanations clear, so that I advance in my project |
|
|
tuananhbme
Joined: 03 Oct 2011 Posts: 1
|
sms controller |
Posted: Mon Mar 12, 2012 8:06 am |
|
|
For your 1st question:
The code is just to send a message "TEST" to the phone number: 09276553965
Code: |
void _UPSSMS()
{
fprintf(GSM, "AT\r\n"); // Test AT command
delay_ms (500);
fprintf(GSM, "AT+CMGF=1\r\n"); // Chose text mode
delay_ms (500);
fprintf(GSM, "AT+CMGD=1\r\n");//delete the received message from memory possition 1
delay_ms(500);
fprintf(GSM, "at+cmgs=\"09276553965\"\r\n");// phone number to send
delay_ms(500);
fprintf(GSM, "TEST\n"); // Text message
putc(0x1A);// Print (Ctr+Z) to send message
delay_ms(500);
state=0;
} |
You can find more about AT Commands in Google.
+ For the 2nd question: You can take a look at this topic:
http://www.ccsinfo.com/forum/viewtopic.php?t=42527 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|