Closed jmattioni closed 6 months ago
On that function it uses default value for format and as I see declaration is
bool AddTimeField(double GPSTime, const char *Format="%09.2f");
Where do you have "%06f"
The reference is in function NMEA0183SetRMC, which I see doesn't use a format override. Sorry, I must have put the format override in the AddTimeField call myself. For GPRMC messages, most examples I've found don't include fractional seconds so the GPS time field length would always be 6 padded with zeros and no decimal. What was in my copy of the code was a format override of "%06f", which failed to pad zeros. I changed it to "%06.0f" and it worked.
Devices should also handle time given in 2 decimals.
RMC:
$--RMC,hhmmss.ss,A,ddmm.mm,a,dddmm.mm,a,x.x,x.x,xxxx,x.x,ahh
You're right. I just confirmed that the Yamaha 6Y80-01 square gauge on my bench works with the library default format.
Thanks.
Traced this to function NMEA0183SetRMC - the AddTimeField call in this function is passing format "%06f", which fails to add leading zeros to the formatted time value. Passing "%06.0f" fixed the problem.