Relation between bus errors in CANAPI2 and CANAPI4
Posted: Mon 22. Mar 2021, 10:39
I am in the process of moving our software from CANAPI2 to CANAPI4 and am a bit puzzled about the meaning of the bus errors:
CANAPI2 had these:
CAN_ERR_BUSLIGHT = $0004; // Bus error: an error counter reached the 'light' limit
CAN_ERR_BUSHEAVY = $0008; // Bus error: an error counter reached the 'heavy' limit
CAN_ERR_BUSOFF = $0010; // Bus error: the CAN controller is in bus-off state
CANAPI4 has these:
CAN_ERR_BUSWARNING = $0008; // Bus error: an error counter reached the 'warning' limit
CAN_ERR_BUSPASSIVE = $40000; // Bus error: CAN controller is in Error Passive state
CAN_ERR_BUSOFF = $0010; // Bus error: CAN controller is in Bus-off state
So CAN_ERR_BUSWARNING seems to correspond to the old CAN_ERR_BUSHEAVY.
What happended to CAN_ERR_BUSLIGHT? Is there no longer a 'light' limit?
And what is CAN_ERR_BUSPASSIVE? Is that something totally new? From the description I would have assumed that this is an error state of the hardware.
I'm tempted to translate CAN_ERR_BUSLIGHT to CAN_ERR_BUSWARNING and CAN_ERR_BUSHEAVY to CAN_ERR_BUSPASSIVE but it seems wrong.
CANAPI2 had these:
CAN_ERR_BUSLIGHT = $0004; // Bus error: an error counter reached the 'light' limit
CAN_ERR_BUSHEAVY = $0008; // Bus error: an error counter reached the 'heavy' limit
CAN_ERR_BUSOFF = $0010; // Bus error: the CAN controller is in bus-off state
CANAPI4 has these:
CAN_ERR_BUSWARNING = $0008; // Bus error: an error counter reached the 'warning' limit
CAN_ERR_BUSPASSIVE = $40000; // Bus error: CAN controller is in Error Passive state
CAN_ERR_BUSOFF = $0010; // Bus error: CAN controller is in Bus-off state
So CAN_ERR_BUSWARNING seems to correspond to the old CAN_ERR_BUSHEAVY.
What happended to CAN_ERR_BUSLIGHT? Is there no longer a 'light' limit?
And what is CAN_ERR_BUSPASSIVE? Is that something totally new? From the description I would have assumed that this is an error state of the hardware.
I'm tempted to translate CAN_ERR_BUSLIGHT to CAN_ERR_BUSWARNING and CAN_ERR_BUSHEAVY to CAN_ERR_BUSPASSIVE but it seems wrong.