40 explicit CAN(
int deviceId);
51 CAN(
int deviceId,
int deviceManufacturer,
int deviceType);
High level class for interfacing with CAN devices conforming to the standard CAN spec.
Definition CAN.h:31
bool ReadPacketNew(int apiId, CANData *data)
Read a new CAN packet.
int WritePacketRepeatingNoError(const uint8_t *data, int length, int apiId, int repeatMs)
Write a repeating packet to the CAN device with a specific ID.
bool ReadPacketTimeout(int apiId, int timeoutMs, CANData *data)
Read a CAN packet.
bool ReadPacketLatest(int apiId, CANData *data)
Read a CAN packet.
CAN(int deviceId, int deviceManufacturer, int deviceType)
Create a new CAN communication interface with a specific device ID, manufacturer and device type.
CAN & operator=(CAN &&)=default
static constexpr HAL_CANDeviceType kTeamDeviceType
Team device type.
Definition CAN.h:172
static uint64_t GetTimestampBaseTime()
Reads the current value of the millisecond-resolution timer that CANData timestamps are based on.
static constexpr HAL_CANManufacturer kTeamManufacturer
Team manufacturer.
Definition CAN.h:169
int WriteRTRFrameNoError(int length, int apiId)
Write an RTR frame to the CAN device with a specific ID.
void StopPacketRepeating(int apiId)
Stop a repeating packet with a specific ID.
int WritePacketNoError(const uint8_t *data, int length, int apiId)
Write a packet to the CAN device with a specific ID.
CAN(int deviceId)
Create a new CAN communication interface with the specific device ID.
void WritePacketRepeating(const uint8_t *data, int length, int apiId, int repeatMs)
Write a repeating packet to the CAN device with a specific ID.
void WriteRTRFrame(int length, int apiId)
Write an RTR frame to the CAN device with a specific ID.
void WritePacket(const uint8_t *data, int length, int apiId)
Write a packet to the CAN device with a specific ID.
A move-only C++ wrapper around a HAL handle.
Definition Types.h:96
HAL_CANDeviceType
The CAN device type.
Definition CANAPITypes.h:22
HAL_CANManufacturer
The CAN manufacturer ID.
Definition CANAPITypes.h:60
@ HAL_CAN_Dev_kMiscellaneous
Miscellaneous.
Definition CANAPITypes.h:44
@ HAL_CAN_Man_kTeamUse
Team use.
Definition CANAPITypes.h:78
uint8_t data[8]
Contents of the CAN packet.
Definition CAN.h:14
uint64_t timestamp
CAN frame timestamp in milliseconds.
Definition CAN.h:18
int32_t length
Length of packet in bytes.
Definition CAN.h:16