|
From: Kristof V. L. <kr...@co...> - 2004-04-04 22:45:23
|
Hi Stuart, Sanity check = ok :) In fact, this method fits definitely for the other parser classes as well.. You do need to add the channels and channel-length to the method I guess: virtual int read_line(char *line, DataCell* channels, uint numchannels)=0; so the method directly returns the channels in one go, right? Best, Kristof. http://www.comp.lancs.ac.uk/~kristof/ On Sat, 3 Apr 2004, Stuart Reeves wrote: > 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... |