SERIN Formatting
KevSwannUK
Posts: 4
Hi All,
Can anyone help sed some light on this little data formatting problem I have. Basically I'm reciving some serial data from a GSM modem and I want to capture a specific part of the serial string.
Here is the string I am receiving...
+CMGR: “REC UNREAD”,”0146290800”,”98/10/01,18 :22 :11+00”,<CR><LF>ABCdefGHI OK
The section I need to get is the phone number 0146290800 only without the " symbol.. the best I can come up with is:
I know I want do do something like:
PNumber VAR Word
Serin RxD, B4800, [noparse][[/noparse]wait("+CMGR:"), wait(",") , SKIP 1, PNumber\???]
I'm not certain what I need to put after the PNumber. As the number always ends with a " how do I set this to be the end marker? It seems simple with any other character "*" for eample, but is """ valid?
Thanks in advance
Kevin
Can anyone help sed some light on this little data formatting problem I have. Basically I'm reciving some serial data from a GSM modem and I want to capture a specific part of the serial string.
Here is the string I am receiving...
+CMGR: “REC UNREAD”,”0146290800”,”98/10/01,18 :22 :11+00”,<CR><LF>ABCdefGHI OK
The section I need to get is the phone number 0146290800 only without the " symbol.. the best I can come up with is:
I know I want do do something like:
PNumber VAR Word
Serin RxD, B4800, [noparse][[/noparse]wait("+CMGR:"), wait(",") , SKIP 1, PNumber\???]
I'm not certain what I need to put after the PNumber. As the number always ends with a " how do I set this to be the end marker? It seems simple with any other character "*" for eample, but is """ valid?
Thanks in advance
Kevin
Comments
if you know that the phone number is always 10 digits long, you can just put
PNumber\10
Basic stamp will stop recording digits/characters at 10 bytes.
Unfortunatly the number can be any lenght from 8 to 16 numbers... Any other ideas?
Regards
Kev
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Yes that is what I have looked at, but is ... PNumber\"""] valid? i.e. can·" be used as an end character?
Thanks
Kev
It worked for me using your test input.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
·