Rodemfr / MicronetToNMEA

A NMEA 0183 converter for Raymarine's wireless instruments ... and much more !
GNU General Public License v3.0
21 stars 8 forks source link

Data precision in HDG and VHW sentences #64

Closed tvr256 closed 1 year ago

tvr256 commented 1 year ago

According to the NMEA spec, heading, variation and water speed should all be reported to 1 decimal place in the NMEA HDG and VHW sentences. Currently MicronetToNMEA uses 0 decimal places for heading and variation, and 2 decimal places for water speed.

My Git skills are non-existent so I won't try to provide a patch. But the following fields should be changed in DataBridge.cpp:

Line 813: "$INVHW,,T,%.0f,M,%.2f,N,,K" should read "$INVHW,,T,%.1f,M,%.1f,N,,K" Line 817: "$INVHW,,T,%.0f,M,,N,,K" should read "$INVHW,,T,%.1f,M,,N,,K" Line 821: "$INVHW,,T,%.0f,M,,N,,K" should read "$INVHW,,T,%.1f,M,,N,,K" Line 842: "$INHDG,%.0f,,,%.0f,%c" should read "$INHDG,%.1f,,,%.1f,%c"

Also a very minor point - the comments in BoardConfig.h refer to the wrong NMEA sentence names:

(SPD, LOG) should read (VHW, VLW) (XDG) should read (XDR) (STP) should read (MTW)

Rodemfr commented 1 year ago

Easy to fix, will be done tonight.

Rodemfr commented 1 year ago

Done & tested with OpenCPN