CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

sms controller

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kamillas



Joined: 24 Oct 2011
Posts: 50

View user's profile Send private message

sms controller
PostPosted: Mon Mar 12, 2012 6:41 am     Reply with quote

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

View user's profile Send private message

sms controller
PostPosted: Mon Mar 12, 2012 8:06 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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