Lines Matching refs:tok
117 Token tok; in nmea_tokenizer_get() local
121 tok.p = tok.end = dummy; in nmea_tokenizer_get()
123 tok = t->tokens[index]; in nmea_tokenizer_get()
125 return tok; in nmea_tokenizer_get()
249 nmea_reader_update_time( NmeaReader* r, Token tok ) in nmea_reader_update_time() argument
256 if (tok.p + 6 > tok.end) in nmea_reader_update_time()
268 hour = str2int(tok.p, tok.p+2); in nmea_reader_update_time()
269 minute = str2int(tok.p+2, tok.p+4); in nmea_reader_update_time()
270 seconds = str2float(tok.p+4, tok.end); in nmea_reader_update_time()
288 Token tok = date; in nmea_reader_update_date() local
291 if (tok.p + 6 != tok.end) { in nmea_reader_update_date()
292 D("date not properly formatted: '%.*s'", tok.end-tok.p, tok.p); in nmea_reader_update_date()
295 day = str2int(tok.p, tok.p+2); in nmea_reader_update_date()
296 mon = str2int(tok.p+2, tok.p+4); in nmea_reader_update_date()
297 year = str2int(tok.p+4, tok.p+6) + 2000; in nmea_reader_update_date()
300 D("date not properly formatted: '%.*s'", tok.end-tok.p, tok.p); in nmea_reader_update_date()
313 convert_from_hhmm( Token tok ) in convert_from_hhmm() argument
315 double val = str2float(tok.p, tok.end); in convert_from_hhmm()
331 Token tok; in nmea_reader_update_latlong() local
333 tok = latitude; in nmea_reader_update_latlong()
334 if (tok.p + 6 > tok.end) { in nmea_reader_update_latlong()
335 D("latitude is too short: '%.*s'", tok.end-tok.p, tok.p); in nmea_reader_update_latlong()
338 lat = convert_from_hhmm(tok); in nmea_reader_update_latlong()
342 tok = longitude; in nmea_reader_update_latlong()
343 if (tok.p + 6 > tok.end) { in nmea_reader_update_latlong()
344 D("longitude is too short: '%.*s'", tok.end-tok.p, tok.p); in nmea_reader_update_latlong()
347 lon = convert_from_hhmm(tok); in nmea_reader_update_latlong()
364 Token tok = altitude; in nmea_reader_update_altitude() local
366 if (tok.p >= tok.end) in nmea_reader_update_altitude()
370 r->fix.altitude = str2float(tok.p, tok.end); in nmea_reader_update_altitude()
380 Token tok = bearing; in nmea_reader_update_bearing() local
382 if (tok.p >= tok.end) in nmea_reader_update_bearing()
386 r->fix.bearing = str2float(tok.p, tok.end); in nmea_reader_update_bearing()
396 Token tok = speed; in nmea_reader_update_speed() local
398 if (tok.p >= tok.end) in nmea_reader_update_speed()
402 r->fix.speed = str2float(tok.p, tok.end); in nmea_reader_update_speed()
424 Token tok; in nmea_reader_parse() local
438 Token tok = nmea_tokenizer_get(tzer,n); in nmea_reader_parse() local
439 D("%2d: '%.*s'", n, tok.end-tok.p, tok.p); in nmea_reader_parse()
444 tok = nmea_tokenizer_get(tzer, 0); in nmea_reader_parse()
445 if (tok.p + 5 > tok.end) { in nmea_reader_parse()
446 D("sentence id '%.*s' too short, ignored.", tok.end-tok.p, tok.p); in nmea_reader_parse()
451 tok.p += 2; in nmea_reader_parse()
452 if ( !memcmp(tok.p, "GGA", 3) ) { in nmea_reader_parse()
469 } else if ( !memcmp(tok.p, "GSA", 3) ) { in nmea_reader_parse()
471 } else if ( !memcmp(tok.p, "RMC", 3) ) { in nmea_reader_parse()
496 tok.p -= 2; in nmea_reader_parse()
497 D("unknown sentence '%.*s", tok.end-tok.p, tok.p); in nmea_reader_parse()