PDA

View Full Version : parsing string from hserin



xxxxxx
- 16th March 2009, 00:44
hello

i want to parse string from gsmbuffer variable like this


ip:
HSEROUT["AT+CMGL",13,10]'get the msg from phone

LCDOUT $FE,1,"query" 'show query on lcd

HSERIN 3000,IP,[WAIT("REC UNREAD"),skip 41,STR GSMBUFFER\16\13] 'wait for rec unread, and get the string gsmbuffer
LCDOUT $FE,1,str poruka\16 'show it on lcd



the idea is to send sms "XYZ" which simulates 3 output's, and that means there are all switched ON, and if i send sms "Xyz" then first output is ON and others are OFF...

help me with some guidelines!!!!

thx in advance

xxxxxx
- 16th March 2009, 10:41
any conscructive help is welcome :D....

the idea is to compare gsmbuffer string with XYZ letter combination !!!
just give me idea how to work this out!!!!

Melanie
- 16th March 2009, 14:12
The example here parses a string...

http://www.picbasic.co.uk/forum/showthread.php?t=573

xxxxxx
- 16th March 2009, 14:25
The example here parses a string...

http://www.picbasic.co.uk/forum/showthread.php?t=573 yes but i want to make it as simple as posible......like sms command ONN will turn on portb.6, and smsm comand OFF will shut it down ...any sugestion melanie?

Melanie
- 16th March 2009, 20:24
Yes. Do what the example does when you take away all the frills...

Feed your SMS message into an array buffer.

Then simply scan your buffer for the occurance of your keyword.

It doesn't get any simpler than that.

xxxxxx
- 17th March 2009, 07:24
:D frills :D.....okay i'am gonna try it!!! thx for encouragement :D

sahin5002
- 1st April 2009, 12:17
Send directly

at+cmgl="rec unread"

xxxxxx
- 2nd April 2009, 16:03
i solve this in a easy way :D

Luckyborg
- 2nd April 2009, 16:12
Good job :cool:

Why don't you post your easy solution for anyone else who has similar problems or just to help encourage anyone else who reads this thread and sees how you were able to solve your own problem?

David

xxxxxx
- 2nd April 2009, 18:42
Good job :cool:

Why don't you post your easy solution for anyone else who has similar problems or just to help encourage anyone else who reads this thread and sees how you were able to solve your own problem?

David
ws:
HSEROUT["AT+CMGL",13,10]' filter za query
LCDOUT $FE,1,"wait sms."

HSERIN 5000,ws,[WAIT("REC UNREAD"),skip 27,str TIME\6,skip 8,STR PORUKA\5\13]

pause 2000
I=0

gr[1]="U"
gr[2]="G"

istaporuka=1
FOR I=0 to 1
if gr[i+1]<>poruka[i+1] then istaporuka=0

next i

if istaporuka=1 then gosub s1

J=0

gr[1]="I"
gr[2]="G"

istaporuka1=1
FOR J=0 to 1
if poruka[J+1]<>gr[J+1] then istaporuka1=0
next J

if istaporuka1=1 then gosub s2
:D

--
www.mtskola.com (http://www.mtskola.com)