PDA

View Full Version : Parsing strings received serially.



ardhuru
- 7th June 2017, 11:11
Hi guys,

I Havent used PBP for quite a while, and I'm afraid my memory is getting rusty.

I need some help with string parsing.

I get a stream of data over the serial port in the format !Vxx=yy$

Where, !V are common start bytes, xx is a 2 digit integer in decimal, followed by "=", and followed by another decimal yyy which could be either single digit, double digit OR 3 digit. And lastly, "$".

I'll need to fork off to different subd, depending on the value of xx.

What would be the best way to do this?

Thanks in advance, guys!

richard
- 7th June 2017, 11:39
I Havent used PBP for quite a while, and I'm afraid my memory is getting rusty.

searching the forum still works

second item seems to cover it
http://www.picbasic.co.uk/forum/showthread.php?t=17632
http://www.picbasic.co.uk/forum/showthread.php?t=20953

ardhuru
- 7th June 2017, 13:14
searching the forum still works



Indeed it does; somehow did not stumble across the 2nd thread; Heckler's response looks pretty much what I needed.

Thanks for the pointer.

Best Regards,

Anand Dhuru