RP-01_Flutter/lib/CanLib/can_fd_msg.dart
2025-04-30 17:01:25 +08:00

24 lines
579 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'dart:ffi';
final class CanFdMsg extends Struct {
@Uint32()
external int id; // 报文ID,bit[30]-RTR,bit[31]-IDE,bit[28..0]-ID
@Uint8()
external int dlc; // 数据字节长度,可设置为-0,1,2,3,4,5,6,7,8,12,16,20,24,32,48,64
@Uint8()
external int flags; // bit[0]-BRS,bit[1]-ESI,bit[2]-FDF,bit[6..5]-Channel,bit[7]-RXD
@Uint8()
external int res0; // 保留
@Uint8()
external int res1; // 保留
@Uint32()
external int timeStamp; // 帧接收或者发送时的时间戳单位为10us
@Array<Uint8>(64)
external Array<Uint8> data;
}