rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
can_rx.h File Reference

Functions

void printCANRxFrame (const size_t busIndex, const CANRxFrame &rx)
 
uint32_t getFourBytesLsb (const CANRxFrame &frame, int offset)
 
uint16_t getTwoBytesLsb (const CANRxFrame &frame, int offset)
 
uint16_t getTwoBytesMsb (const CANRxFrame &frame, int offset)
 

Function Documentation

◆ getFourBytesLsb()

uint32_t getFourBytesLsb ( const CANRxFrame frame,
int  offset 
)

Definition at line 143 of file can_rx.cpp.

143 {
144 return (frame.data8[offset + 3] << 24) +
145 (frame.data8[offset + 2] << 16) +
146 (frame.data8[offset + 1] << 8) +
147 frame.data8[offset];
148}
uint8_t data8[8]
Frame data.
Definition can_mocks.h:55
uint16_t offset
Definition tunerstudio.h:0

Referenced by processCanRequestCalibration().

Here is the caller graph for this function:

◆ getTwoBytesLsb()

uint16_t getTwoBytesLsb ( const CANRxFrame frame,
int  offset 
)

Definition at line 150 of file can_rx.cpp.

150 {
151 return (frame.data8[offset + 1] << 8) + frame.data8[offset];
152}

Referenced by getShiftedLSB_intel(), processBMW_e46(), processBMW_e90(), and processCanUserControl().

Here is the caller graph for this function:

◆ getTwoBytesMsb()

uint16_t getTwoBytesMsb ( const CANRxFrame frame,
int  offset 
)

Definition at line 154 of file can_rx.cpp.

154 {
155 return (frame.data8[offset] << 8) + frame.data8[offset + 1];
156}

Referenced by processNissan(), and processNissanSecondVss().

Here is the caller graph for this function:

◆ printCANRxFrame()

void printCANRxFrame ( const size_t  busIndex,
const CANRxFrame rx 
)

this build-in CAN sniffer is very basic but that's our CAN sniffer

Definition at line 29 of file can_rx.cpp.

29 {
30 // only print info if we're in can debug mode
31
32 int id = CAN_ID(rx);
33
34 if (CAN_ISX(rx)) {
35 // print extended IDs in hex only
36 efiPrintf("CAN%d RX: ID %07x DLC %d: %02x %02x %02x %02x %02x %02x %02x %02x",
37 busIndex + 1,
38 id,
39 rx.DLC,
40 rx.data8[0], rx.data8[1], rx.data8[2], rx.data8[3],
41 rx.data8[4], rx.data8[5], rx.data8[6], rx.data8[7]);
42 } else {
43 // internet people use both hex and decimal to discuss packed IDs, for usability it's better to print both right here
44 efiPrintf("CAN%d RX: ID %03x(%d) DLC %d: %02x %02x %02x %02x %02x %02x %02x %02x",
45 busIndex + 1,
46 id, id, // once in hex, once in dec
47 rx.DLC,
48 rx.data8[0], rx.data8[1], rx.data8[2], rx.data8[3],
49 rx.data8[4], rx.data8[5], rx.data8[6], rx.data8[7]);
50 }
51}
uint8_t DLC
Data length.
Definition can_mocks.h:42

Referenced by processCanRxMessage(), IsoTpRx::readTimeout(), and CanStreamerState::receiveFrame().

Here is the caller graph for this function:

Go to the source code of this file.