Skip to content

Fix TimeDate SPN 962 day scaling#687

Open
sujandumaru wants to merge 1 commit into
Open-Agriculture:mainfrom
sujandumaru:fix-time-date-spn-962
Open

Fix TimeDate SPN 962 day scaling#687
sujandumaru wants to merge 1 commit into
Open-Agriculture:mainfrom
sujandumaru:fix-time-date-spn-962

Conversation

@sujandumaru
Copy link
Copy Markdown
Contributor

Describe your changes

Fixes #634

This updates the TimeDateInterface SPN 962 day conversion so the raw quarter-day-scaled value is decoded as the correct calendar day. Raw SPN 962 values like 37, 38, 39, and 40 now decode to day 10 with normalized quarterDays values 0, 1, 2, and 3.

The transmit path was also updated to use the inverse conversion, so sending day = 10 with quarterDays = 0/1/2/3 emits raw SPN 962 values 37/38/39/40.

I also added focused unit coverage for both receiving and sending SPN 962 values, and refactored the TimeDate tests to share common fixture setup and SPN 962 test cases.

How has this been tested?

cmake -S . -B build -DBUILD_TESTING=ON
cmake --build build
ctest --test-dir build -R TimeDateTest --output-on-failure
ctest --test-dir build --output-on-failure

Comment thread test/time_date_tests.cpp
@sujandumaru sujandumaru force-pushed the fix-time-date-spn-962 branch from 5b04e3b to 0fbfdac Compare May 25, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Time Date Interfaces processes day SPN (962) wrong

2 participants