|
From: Stuart R. <st...@Cs...> - 2004-04-03 16:07:36
|
I've implemented a basic NMEA parser with two basic methods: int parse_sentence(DataCell *channels, uint numchannels); int parse_sentence(DataCell *channels, uint numchannels, char *sentence); Essentially they get any NMEA string and parse the data into fields, performing a checksum etc. (The top method reads from a file.) What now needs to be done is to hook this up to SensorData implementors. This means that I would want to be retreiving a data string from a log file or RS232. For example, another method could be added to SensorData s.t.: virtual int read_line(char *line)=0; Implementors would make this method put a string version of the entire line (e.g. scanned from a file or taken from the RS232 port) into char *line so that the NMEA parser could be hooked up to it and put the relevant NMEA data into channels... Make sense? Don't know if this is the best way to get around this problem or not... later, Stuart --- digimail: st...@tr... electromagic-interweb: http://www.cs.nott.ac.uk/~str |