properly print extended CAN ids (#4182)

* print ext ids correctly

* string format

* comment
This commit is contained in:
Matthew Kennedy 2022-05-18 13:55:14 -07:00 committed by GitHub
parent 592ec1cc82
commit 2ce57efd1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -69,11 +69,14 @@ static void printPacket(const size_t busIndex, const CANRxFrame &rx) {
// only print info if we're in can debug mode
int id = CAN_ID(rx);
// internet people use both hex and decimal to discuss packed IDs, for usability it's better to print both right here
efiPrintf("CAN_rx bus=%d %x(%d) %d: %02x %02x %02x %02x %02x %02x %02x %02x",
efiPrintf("CAN RX bus %d ID %x(%d) DLC %d: %02x %02x %02x %02x %02x %02x %02x %02x",
busIndex,
CAN_SID(rx),
CAN_SID(rx), rx.DLC, rx.data8[0], rx.data8[1], rx.data8[2], rx.data8[3],
id, id, // once in hex, once in dec
rx.DLC,
rx.data8[0], rx.data8[1], rx.data8[2], rx.data8[3],
rx.data8[4], rx.data8[5], rx.data8[6], rx.data8[7]);
}