Hi NavMicroSystems

Thanx for the point.
I still can’t understand some of your ideas, therefore I rewrote your program in a way that I think it should be. I wrote my questions like comments next to the lines which I can’t get. So could you please take a look and answer the questions.
And do you think that this program could be used with all Nokia phones with embedded modems, or it’s for the 62xx series only?

Regards



DEFINE OSC 20

DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 115200
DEFINE HSER_CLROERR 1

GSMbuffer var Byte [12]
Caller var Byte [12]
GSMtime var Byte [17]

‘Check the connection between the phone and PIC works. Should ‘give OK. Instead you’ve used ATZ, why?

Hserout [“AT”, 13, 10]
Pause 1000

HSerout ["AT+CMGF=1", 13, 10] 'Set Text Mode. Answer: OK
Pause 500

Hserout [“AT+CMGS=”, 34, “+359888123456”, 34, 13, 10] ‘Answer: >
‘Why have you put “,129” in addition. I think it’s not nessesary.

Pause 500

Hserout [“Test-message”, 13, 10]

‘Terminate the SMS by Control+Z
‘Here you send ASCII 26 => SUB. Is it equal with CTRL+Z?
Hserout [26]
‘Answer: +CMGS: 125 - the ord. number of the SMS (0-‘255)
Pause 500

' Check for new incomming Messages

HSerout ["AT", 13, 10] ‘Check the connection
Pause 1000

HSerout ["AT+CMGF=1", 13, 10]
Pause 1000

Loop:
‘list new unread messages
Hserout [“AT+CMGL=”, 34, “REC UNREAD”, 34, 13, 10]
‘Optionally: "REC READ", "ALL"
‘Or it must be HSerout ["AT+CMGL",13,10] ?

‘Answer in 3 lines should look like this:
‘+CMGL: 1,"REC UNREAD","+359888123456",,"04/07/21,08:03:05-00"
‘Test-message
‘OK

HSerin 5000, Loop, [Wait("UNREAD"), skip 3, STR Caller\12, skip 4, STR GSMTime\17, skip 4, STR GSMbuffer\12]
‘You ‘ve written skip 6 before STR GSMuffer\12 but I think it ‘should 'be skip 4? Then you used GSMBUFFER\16\13, which must be 'GSMbuffer\12. Am I right? What \16\13 does mean?

' --- Put your code to output the result here

' i.e. LCDOUT . . . .

‘Delete the processed SMS:
Hserout [“AT+CMGD=1”, 13, 10]

Goto Loop