Discussion in "Embedded GSM Development" started by    kamal_nasir_2000    Dec 22, 2011.
Sun Jan 08 2012, 01:45 pm
#11
Thanks kirangowle and Ajay Bhargav for helping me and thanks kirangowle for reviwing the code i will try to test it.
Wed Jan 18 2012, 06:49 am
#12
void serial () interrupt 4 {
unsigned char ch;
if(RI){
ch = SBUF; //character is read
RI = 0; //clear flag
if((ch == Response[k]) || (k > 4))// what this condition means???
{
//if received character is there in Response or i is > 4 which means
// you already have the right string... how this iis>4 will determine that i alredy have the right string if(ch != 0x0D) // 0x0D means data received..
{
MyBuff[k++] = ch;// is the messege stored in mybuff[];
}
else
{
//seems like we have recieved our data
//Now stop and indicate that new message has received
MyBuff[k] = '\0';
NewMessage = 1;
k = 0;
}
}
else
{
msg1[abc]=ch;//received msg is stored.
abc++;
k = 0;
}
}
if(TI)
{
//if its a tx interrupt
//clear TI
TI = 0;
//set a flag to indicate tx has completed
TI_flag = 1;
}
}
Wed Jan 18 2012, 07:11 pm
#13

if((ch == Response[k]) || (k > 4))// what this condition means???


answer was underneath (the comments read them)
//if received character is there in Response or i is >
 4 which means
// you already have the right string...


how this iis>4 will determine that i alredy have the right string


data that comes from modem at time a new sms comes is "+CMTI" which is fix so once you get a constant string it mean you have the right data coming in buffer..

is the messege stored in mybuff[];


no, not the message.. but modem indicator string which tells us that new sms has come.
+CMTI: "SM", 1
where CMTI = new message indication
SM = sim memory, (ME for mobile/modem memory)
1 = can be any number here.. its the location on sim/mobile where message is stored. message later can be read using
AT+CMGR=1 (where 1 will be replaced by any number that comes with CMTI indication)

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Davidbab
Tue Apr 23 2024, 10:41 am
Richardrit
Tue Apr 23 2024, 09:54 am
HenryLaf
Mon Apr 22 2024, 03:50 pm
bleradrar
Mon Apr 22 2024, 06:38 am
ppu-pro_ka
Sun Apr 21 2024, 07:39 pm
Infewow
Sun Apr 21 2024, 06:30 pm
HumanTak
Sun Apr 21 2024, 12:26 pm
Zacharybus
Sun Apr 21 2024, 02:45 am