openxc/cantranslator — pull request #106 by DaveMelcher (2013-04-15 17:33:12+00:00)
Title: Fuelfix

This fixes a bug with the Fuel_Consumed_Since_Restart and Odometer totals. The signal handlers were only getting called when the Send_Frequency and Send_Same values resulted in the Send flag being set to true. And the way we were calculating the total, we were losing the amounts when the handler wasn't called.

With this change, the signal handlers get called every packet. It shouldn't change the behavior, but authors of custom signal handlers need to be aware that it'll get run whether or not it will be sent.

In addition to the edits in canread.cpp, tests have been added to canread_tests.cpp to check that the handlers get called regardless of send_frequency.

There is also a note added to the signal handler documentation point out that the signal handlers get called for each CAN message.