Sets a "pending transmit" handler for CAN messages used by jobs/diagnostics.
Allows test frameworks or diagnostic jobs to temporarily override outgoing CAN message transmission.
The provided callback is invoked before each CAN transmit.
undefined (to suppress/disable this transmission),
or a Promise resolving to any of the above.
Returns void
Example
setTxPending(async (msg) => { // E2E test: intercept message with ID 0x200 if (msg.id === 0x200) { // Replace transmit data for E2E injection returnBuffer.from([0xE2, 0xE2, 0xCA, 0xT1]); } // Block this transmission (do not send) returnundefined; });
Example
setTxPending((msg) => { // Only log, transmit as usual console.log("CAN TX:", msg); returnmsg.data; // will not alter data });
Sets a "pending transmit" handler for CAN messages used by jobs/diagnostics.
Allows test frameworks or diagnostic jobs to temporarily override outgoing CAN message transmission. The provided callback is invoked before each CAN transmit.