Quote Originally Posted by Ziki
thx for the info ...sorry for late reply ....bz lately with exam .......in the #6 post u put :

If buf(6)<>"4" then wait_for_command
if buf(6)<>"1" then wait_for_command
If buf(6)<>"7" then wait_for_command
If buf(6)<>"6" then wait_for_command

do i need to store the recieve message( Alarm arm 0AD09417658DE0685E56D
)into the buffer 1st ...?

Yes, make buf(XX) large enough for your longest message, but remember that a message has a huge 60 chars plus overhead, dont store those, you have to read them, but dont store them, and then simply read what you want with a for next loop.

use serin with a timeout so if the message is short, it will keep going, and also if the message is short, you need to skip any further serin commands, IE






for z=0 to 90
buf(z)="*"
next

error_flag=0

for n=1 to 20 digits

get_back_in_loop:

if error_flag=0
SERIN portb.7,t1200,1000,comserr,combuf(z)
endif

next

goto finished read


comserr:

error_flag=1

goto get_back_in_loop

finished_read:


OK so we have now read the string in (in a dirty horrible looking way) so you can now process it as you need

You will have to write another routine, to call (gosub) before that, to read the first 46 or so chars, then you can read the next 12 and save them as there are the originating phone number, you may want to check that for an authentic message sender, then dump another 20 as they are time/date etc, unless you want to do something with them.

remember it screws phone numbers / time date etc up too, so a phone number of 1234 becomes 2143, stupid damn system.