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.
~CAN()
Closes the CAN communication.
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:177
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:174
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.
HAL_CANDeviceType
The CAN device type.
Definition: CANAPITypes.h:22
HAL_CANManufacturer
The CAN manufacturer ID.
Definition: CANAPITypes.h:56
@ HAL_CAN_Dev_kMiscellaneous
Miscellaneous.
Definition: CANAPITypes.h:44
@ HAL_CAN_Man_kTeamUse
Team use.
Definition: CANAPITypes.h:74
Definition: AprilTagPoseEstimator.h:15
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