This is a part of code to read a sms, in "buffer" store phone number and sms.
In the main program I send to the gsm module AT+CNMI=2,2,0,0,0, the sms is routed directly to the serial port.
My english is not good I hope you can understand me
char buffer[60];
char b=0x00; // Last characters recived
int xbuff=0x00;
// Usart interrupt//////
#int_RDA
RDA_isr()
{
if(kbhit()){
b=getc();
if(b=='+'){//first character of the phone number
xbuff=0; //reset
}
buffer[xbuff++]=b; // add character to buffer
}
return 0;
}