-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the Date in case it's before 2020 due to lapped old GPS. #271
base: master
Are you sure you want to change the base?
Conversation
The only problem I see would be parsing data that was captured before the rollover. For that we could have an environment variable to switch this optionally off, but I guess we'll cross that bridge if somebody needs it. |
Agreed. I first tried to fix it further upstream, but that made some tests fail where Date is use to tell age of certain info. |
Can I interest you in adding a test for this? see test/129029.js |
Thank you for this code! I have the same problem with the old GPS on my boat. |
I checked your conversion code an its indeed one day wrong. I think its better to base the calculation on ms, this code works correctly:
|
I'm not sure the above works. In case the date is corrected, the timestamp will be now() and the data in the packet will remain old and reaches SignalK, right? |
In case of old GPS, the Date part of the pgn will be < 2020. This corrects that, as this pgn should not give a Date < 2020.