GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 15-Mar-2009, 20:24
flyboya flyboya is offline
New Member
 
Join Date: Mar 2009
Posts: 1
flyboya is on a distinguished road

Programming PIC board to send SMS messages


I have a PIC board with built in GSM capability (must insert valid SIM card into board) that I'm programming for a senior design project. The board came bundled with code, however the code didn't seem to be correct because I can not get the damn thing to send a text message. If you look at the code, the send_sms function along with many of the other functions were set up with the use of a web form in mind (as a means of data input (phone number and message content). However, I simply want to hard code the sms number and message and have the board send a text once it's powered on. You can see that's what I tried to do in the send_sms function, but there is something not right. I'm thinking its my AT command syntax. Any help would be greatly appreciated since I'm not a programmer but I do have to complete this task.

CPP / C++ / C Code:
int send_sms(char * number,char * message,int timeout)
{
int tmt=timeout;
//int k=sizeof(LCDText);
/*
tmp[0]='A';
tmp[1]='T';
tmp[2]='+';
tmp[3]='C';
tmp[4]='M';
tmp[5]='G';
tmp[6]='S';
tmp[7]='=';
tmp[8]='"';
tmp[9]='+';
//memcpy(tmp+10,LCDText,number_length);
memcpy(tmp+10, number, number_length);
tmp[number_length+10]='"';
tmp[number_length+11]='\0';
*/
//SendUART2(tmp);
//SendUART2("AT+CMGF=1");
//SendUART2("AT+CMGS=\"9086161265\"");
//SendUART3(message);
SendUART("AT");
SendUART("AT+CMGF=1");
SendUART("AT+CMGS=\"+19086161265\"");
SendUART3("TEST");

//add handle for custom GSM number
a=65535;
//while(--a!=0);
if (rx_counter != 0)
{
while(!(proba == '>')) //HERE sending SMS works
proba=getchar_UART(70000);
SendUART3(message);
}//end sending
//if(!waitplus(7000))
return 0;
do
{
proba=getchar_UART(70000);
a=a;
}
while((proba != 10)&& (--timeout!=0)); //skip first line, read message text on second line
if(!waitOK())
return 0;


a=65535;

return 1;
}
|
Last edited by admin : 16-Mar-2009 at 02:11. Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming a message board pavelkoo Web Design Forum 3 11-Jan-2007 14:03
C++ and DLL programming of a USB experiment interface board h3ro C++ Forum 4 20-Sep-2006 16:06
sudoku C++, need lots of help :S 3shtar C++ Forum 3 06-Apr-2006 11:10
[Program/Tutorial] Sockets to send messages L7Sqr C Programming Language 0 27-Jul-2005 12:27

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:52.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.