0

I would like to receive the vehicle's CAN data to the socket CAN and send it to the server. (raw data)

Accordingly, CAN ID is very important in post-processing raw data sent to the server. The CAN data ID received by Candump and wireshark is only 3 digits, so it is difficult to distinguish which data it is. For example, although the CAN ID I need to receive is 0x1f532d10, only d10 is received and displayed from socketcan.

Is there any way to get the ID length as a whole?

candump

Andy J
  • 1,479
  • 6
  • 23
  • 40
youna
  • 39
  • 6
  • I'm under the impression that it should display correctly if an extended frame is seen. Are you sure that an extended frame is being sent? Also, possibly relevant, https://stackoverflow.com/q/57986218 – Hasturkun Jan 28 '21 at 10:11

1 Answers1

2

If you're using SocketCAN to send frames you need to set the "Extended Frame Format" bit in the can_id field of the can_frame struct, e.g.:

frame.can_id |= CAN_EFF_FLAG;
Andreas Magnusson
  • 7,321
  • 3
  • 31
  • 36