Everyone,
as the Smart EQ BMS is pretty critical about too many polls coming in
sequence, and the throttling can only be applied globally, I've added a
per state time shift option to the poll entry definition (poll_pid_t).
The extension is backwards source compatible, so no existing poll
definitions need to be changed. To keep the memory overhead as low as
possible, I prepared this by changing the poll_pid_t to be packed.
With the packed struct, the extension only added ~600 bytes to the
firmware size.
Usage example for the Smart EQ:
Current/previous poll definitions for the cell resistances:
{ 0x79B, 0x7BB, VEHICLE_POLL_TYPE_OBDIIGROUP, 0x10, *{ 0,0,3601,601 }*, 0, ISOTP_STD }, // Cell Resistance P1 (Cells 1-48) { 0x79B, 0x7BB, VEHICLE_POLL_TYPE_OBDIIGROUP, 0x11, *{ 0,0,3601,601 }*, 0, ISOTP_STD }, // Cell Resistance P2 (Cells 49-96)
Shift the polling cycles by 30 seconds:
{ 0x79B, 0x7BB, VEHICLE_POLL_TYPE_OBDIIGROUP, 0x10, *{.ts={ { 0,0,3601,601 }, { 0,0,30,30 } }}*, 0, ISOTP_STD }, // Cell Resistance P1 (Cells 1-48) { 0x79B, 0x7BB, VEHICLE_POLL_TYPE_OBDIIGROUP, 0x11, *{.ts={ { 0,0,3601,601 }, { 0,0,30,30 } }}*, 0, ISOTP_STD }, // Cell Resistance P2 (Cells 49-96)
I thought about adding a macro as for the .xargs member, but that only adds to the line length.
The shifts also allow the polling intervals to be zero, in that case the entry is selected once per overall poll ticker cycle run (3600 seconds) and done at the shift offset from the cycle start.
@Michael Geddes: please have a look if I missed something -- thanks!
Regards, Michael
-- Michael Balzer * Am Rahmen 5 * D-58313 Herdecke Fon 02330 9104094 * Handy 0176 20698926