Documentation ¶
Overview ¶
@@ @ Author : Eacher @ Date : 2023-09-06 10:48:53 @ LastEditTime : 2023-09-11 08:01:05 @ LastEditors : Eacher @ --------------------------------------------------------------------------------< @ Description : @ --------------------------------------------------------------------------------< @ FilePath : /20yyq/packet/can/frame.go @@
Index ¶
Constants ¶
View Source
const ( // SocketCAN frame 最大 bytes 长度 CanFrameLength = 0x10 // SocketCAN frame 数据最大 bytes 长度 CanDataLength = 0x08 // SocketCANFD frame 最大 bytes 长度 CanFDFrameLength = 0x48 // SocketCANFD frame 数据最大 bytes 长度 CanFDDataLength = 0x40 FlagExtended = 0x80000000 FlagRemote = 0x40000000 FlagError = 0x20000000 MaxExtended = 0x1FFFFFFF MaxStandard = 0x7FF )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct { Len uint8 Flags uint8 Res0 uint8 Res1 uint8 Data [CanFDDataLength]byte CanFd bool Extended bool Remote bool Error bool // contains filtered or unexported fields }
struct canfd_frame { canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ __u8 len; /* frame payload length in byte (0 .. 64) */ __u8 flags; /* additional flags for CAN FD */ __u8 __res0; /* reserved / padding */ __u8 __res1; /* reserved / padding */ __u8 data[64] __attribute__((aligned(8))); };
func NewCanFDFrame ¶ added in v0.1.2
func NewCanFDFrame(b [CanFDFrameLength]byte) (f Frame)
func NewCanFrame ¶ added in v0.1.2
func NewCanFrame(b [CanFrameLength]byte) (f Frame)
func (Frame) WireFormat ¶
Click to show internal directories.
Click to hide internal directories.