ckshivaram
Advanced Member level 6
- Joined
- Apr 21, 2008
- Messages
- 5,060
- Helped
- 2,150
- Reputation
- 4,306
- Reaction score
- 2,088
- Trophy points
- 1,403
- Location
- villingen (Germany) / Bangalore
- Activity points
- 30,088
When a new message is received modem get at+CNMI indication (New Message Indication). You can Write program to send AT+CNMI and get response. when getting responseget it means new message is received. which will be stored in SIM, read the particular location.
If you dont know the location then clear the SIM messages then all incoming messages are stored in location 0. you can read that location and delete it so that all messages are stored in same location.
refer AT commands PDF for more details
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 #include <18F452.h> #use delay(clock=10000000) #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bi ts=8,stream=COM_B, ERRORS) msgEcho[0] = 'C'; msgEcho[1] = 'M'; msgEcho[2] = 'T'; msgEcho[3] = 'I'; msgEcho[4] = ':'; msgEcho[5] = ' '; msgEcho[6] = '"'; msgEcho[7] = 'S'; msgEcho[8] = 'M'; msgEcho[9] = '"'; msgEcho[10] = ','; while (True){ recieved = 1; delay_ms(4000); if (kbhit(COM_B)) { fputs("\nStarting...",COM_B); delay_ms(2000); a = fgetc(COM_B); if (a == '+') { delay_ms(2000); fputs("\nMessage Incoming...", COM_B); for (i=0;i<11;i++) { fputs("\nType in:", COM_B); delay_ms(3000); a = fgetc(COM_B); if(a != msgEcho[i]) { recieved = 0; break; } } } if (recieved == 1){ fputs("\nMessage recieved.", COM_B); } } else{fputs("\nMessage NOT recieved.", COM_B);} } }
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?