12 #include <hal/CANAPI.h>
13 #include <wpi/ArrayRef.h>
15 #include "frc/ErrorBase.h"
43 explicit CAN(
int deviceId);
54 CAN(
int deviceId,
int deviceManufacturer,
int deviceType);
68 void WritePacket(
const uint8_t* data,
int length,
int apiId);
139 static constexpr HAL_CANManufacturer kTeamManufacturer = HAL_CAN_Man_kTeamUse;
140 static constexpr HAL_CANDeviceType kTeamDeviceType =
141 HAL_CAN_Dev_kMiscellaneous;
144 HAL_CANHandle m_handle{HAL_kInvalidHandle};
CAN(int deviceId)
Create a new CAN communication interface with the specific device ID.
~CAN() override
Closes the CAN communication.
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
void WritePacket(const uint8_t *data, int length, int apiId)
Write a packet to the CAN device with a specific ID.
bool ReadPacketTimeout(int apiId, int timeoutMs, CANData *data)
Read a CAN packet.
void WritePacketRepeating(const uint8_t *data, int length, int apiId, int repeatMs)
Write a repeating packet to the CAN device with a specific ID.
High level class for interfacing with CAN devices conforming to the standard CAN spec.
Definition: CAN.h:34
bool ReadPacketLatest(int apiId, CANData *data)
Read a CAN packet.
bool ReadPacketNew(int apiId, CANData *data)
Read a new CAN packet.
Base class for most objects.
Definition: ErrorBase.h:74
bool ReadPeriodicPacket(int apiId, int timeoutMs, int periodMs, CANData *data)
Read a CAN packet.
void StopPacketRepeating(int apiId)
Stop a repeating packet with a specific ID.