only keep newest message
Posted: Tue Jul 04, 2017 8:58 am
Hello,
I want to read gps coordinates over UART process them and then perform actions depending on the position.
This means that there are few "subsystems" involved:
* read a line
* pass this line to a nmea parsing library
* process the coordinates (find out if any actions should be taken)
* possibly do something based on the location.
As exercise I assume that every step could take an infinite amount of time.
Contrary to most (all?) examples I would like to discard intermediate values and always work on the latest received coordinates.
Also (again mostly as exercise) my goal is to avoid copying data as much as possible.
The data passed is:
- single characters from the UART to the line reader.
- a line from the line reader to the nmea parsing lib.
- gps coordinates from the nmea parsing lib to the processing code
What primitives would you use?
Regars
Christian
I want to read gps coordinates over UART process them and then perform actions depending on the position.
This means that there are few "subsystems" involved:
* read a line
* pass this line to a nmea parsing library
* process the coordinates (find out if any actions should be taken)
* possibly do something based on the location.
As exercise I assume that every step could take an infinite amount of time.
Contrary to most (all?) examples I would like to discard intermediate values and always work on the latest received coordinates.
Also (again mostly as exercise) my goal is to avoid copying data as much as possible.
The data passed is:
- single characters from the UART to the line reader.
- a line from the line reader to the nmea parsing lib.
- gps coordinates from the nmea parsing lib to the processing code
What primitives would you use?
Regars
Christian