How to select which string to output
Posted on 2003-11-25
I'm helping my company to to code a simple c program that can select a particular string of characters to output to screen from a hardware (a GPS).
I'm using interrupts and have successfully output ALL the different strings from the GPS to the screen, but now I need to output only a user selected one.
The GPS output (strings of characters) is received via COM1/COM2 and stored in a buffer (done)
print the stored buffer to the screen (done)
select (String 1/2/3 etc) to output to screen (help!!!)
Each GPS string always end with a CRLF. The strings look like this:
$GPGGA,001101,0120.1867,N,10354.2943,E,1,04,02.7,00056,M,07,M,,*72 //string 1
$GPVTG,000,T,,M,000.0,N,000.0,K,A*13 //string 2
$GPGGA,001102,0120.1866,N,10354.2943,E,1,04,02.7,00056,M,07,M,,*70 //string 1 again
$GPVTG,000,T,,M,000.0,N,000.0,K,A*13 //string 2 and so on
In this case, there are only 2 different strings and I'd like to choose only one of them to output to screen. Please give some expert opinions on this. Thanks!