Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/26/01 21:40
Read: times


 
#10341 - RE: serial data question
Where is AKA J? MIA?

This probably isn't as good as a binary tree search, whatever that is, but here goes.

I would buffer the entire string into indirect ram. Then, starting at the beginning of the buffer, first look for the $, then look for commas. When a $(comma) is found, load the address of the following character into a ram location. Use a table in ram for each of the arguments addresses. Do this until you find the end of the input string. It may be useful to replace the commas in the input string with NULLs, as strings are typically dealt with as NULL terminated. That will give you a bunch of null terminated strings. Then, after parsing, use some code to step through the arguments(using the table of pointers you generated when parsing the string), identifying the identifiers and converting the numeric data to whatever format you need. This will require a string comparison function and strings in ROM. This flexible approach also facilitates sending some of the GPS output directly to the LCD using routines written to read the string information from indirect ram and send them to the LCD. I would perform the parsing and string analysis in the main loop, with the characters buffered via the serial interrupt.

Hope this makes sense. This is how I parse command lines for Hyperterminal interfaces, sort of.

Cory Spackman

List of 7 messages in thread
TopicAuthorDate
serial data question            01/01/70 00:00      
RE: serial data question            01/01/70 00:00      
RE: serial data question            01/01/70 00:00      
RE: serial data question            01/01/70 00:00      
RE: serial data question            01/01/70 00:00      
RE: serial data question            01/01/70 00:00      
RE: serial data question            01/01/70 00:00      

Back to Subject List