Skip to content

Commit

Permalink
CAN_SOCKETCANT header converted.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pix committed Jul 5, 2023
1 parent f460e06 commit 8dc548f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions can_socketcan.odin
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package odin_libpcap

import _c "core:c"

// SocketCAN header, as per libpcap doc/networking/can.txt

pcap_can_socketcan_hdr :: struct {
can_id: _c.uint32_t,
payload_length: _c.uint8_t,
fd_flags: _c.uint8_t,
reserved1: _c.uint8_t,
reserved2: _c.uint8_t,
}

// Bits in fd_flags:
CANFD_BRS :: 0x01 // bit rate switch (second bitrate for payload data)
CANFD_ESI :: 0x02 // error state indicator of the transmitting node
CANFD_FDF :: 0x04 // mark CAN FD for dual use of CAN format

0 comments on commit 8dc548f

Please sign in to comment.