12 #include <hal/CANAPITypes.h>
13 #include <wpi/ArrayRef.h>
15 #include "frc/ErrorBase.h"
43 explicit CAN(
int deviceId);
54 CAN(
int deviceId,
int deviceManufacturer,
int deviceType);
62 CAN& operator=(
CAN&&) =
default;
71 void WritePacket(
const uint8_t* data,
int length,
int apiId);
135 static constexpr HAL_CANManufacturer kTeamManufacturer = HAL_CAN_Man_kTeamUse;
136 static constexpr HAL_CANDeviceType kTeamDeviceType =
137 HAL_CAN_Dev_kMiscellaneous;
140 hal::Handle<HAL_CANHandle> m_handle;
High level class for interfacing with CAN devices conforming to the standard CAN spec.
Definition: CAN.h:34
CAN(int deviceId)
Create a new CAN communication interface with the specific device ID.
~CAN() override
Closes the CAN communication.
bool ReadPacketTimeout(int apiId, int timeoutMs, CANData *data)
Read a CAN packet.
Base class for most objects.
Definition: ErrorBase.h:104
void StopPacketRepeating(int apiId)
Stop a repeating packet 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.
void WritePacketRepeating(const uint8_t *data, int length, int apiId, int repeatMs)
Write a repeating packet to the CAN device with a specific ID.
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
bool ReadPacketLatest(int apiId, CANData *data)
Read a CAN packet.
bool ReadPacketNew(int apiId, CANData *data)
Read a new CAN packet.