|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <ref_serial.hpp>


Public Member Functions | |
| RefSerial (Drivers *drivers) | |
| mockable | ~RefSerial ()=default |
| void | messageReceiveCallback (const ReceivedSerialMessage &completeMessage) override |
| mockable bool | getRefSerialReceivingData () const |
| mockable const Rx::RobotData & | getRobotData () const |
| mockable const Rx::GameData & | getGameData () const |
| mockable RobotId | getRobotIdBasedOnCurrentRobotTeam (RobotId id) |
| mockable void | attachRobotToRobotMessageHandler (uint16_t msgId, RobotToRobotMessageHandler *handler) |
| mockable bool | acquireTransmissionSemaphore () |
| mockable void | releaseTransmissionSemaphore (uint32_t sentMsgLen) |
| bool | operatorBlinded () const |
Public Member Functions inherited from tap::communication::serial::DJISerial | |
| DJISerial (Drivers *drivers, Uart::UartPort port, bool isRxCRCEnforcementEnabled=true) | |
| mockable | ~DJISerial ()=default |
| mockable void | initialize () |
| mockable void | updateSerial () |
Static Public Member Functions | |
| static bool | heatAndLimitValid (uint16_t heat, uint16_t heatLimit) |
Static Public Member Functions inherited from tap::communication::serial::RefSerialData | |
| static bool | isBlueTeam (RobotId id) |
Additional Inherited Members | |
Public Attributes inherited from tap::communication::serial::DJISerial | |
| struct tap::communication::serial::DJISerial::FrameHeader | modm_packed |
| struct tap::communication::serial::DJISerial::SerialMessage | modm_packed |
Static Public Attributes inherited from tap::communication::serial::DJISerial | |
| static const uint16_t | SERIAL_RX_BUFF_SIZE = 1024 |
| static const uint16_t | SERIAL_HEAD_BYTE = 0xA5 |
Protected Attributes inherited from tap::communication::serial::DJISerial | |
| Drivers * | drivers |
A class designed to communicate with the 2021 version of the RoboMaster referee system. Supports decoding various referee serial message types. Also supports sending custom UI messages to the referee serial and sending custom robot to robot communication.
For information about the protocol that this serial parser/decoder uses, view RoboMaster's ref serial website: https://www.robomaster.com/en-US/products/components/referee (in the Document Download tab).
Drivers to interact with this class (you shouldn't be declaring your own RefSerial object).Receive information from the referee serial by continuously calling messageReceiveCallback. Access data sent by the referee serial by calling getRobotData or getGameData.
RX message type defines, referred to as "Command ID"s in the RoboMaster Ref System Protocol Appendix. Ignored message types commented out because they are not handled by this parser yet. They are values that are used in message headers to indicate the type of message we have received.
Current Ref Serial Version: 1.7.0 Updated March 2025.
| tap::communication::serial::RefSerial::RefSerial | ( | Drivers * | drivers | ) |
Constructs a RefSerial class connected to bound_ports::REF_SERIAL_UART_PORT with CRC enforcement enabled.
DjiSerial
|
default |
|
inline |
Used by RefSerialTransmitter. Attempts to acquire transmission semaphore.
| void tap::communication::serial::RefSerial::attachRobotToRobotMessageHandler | ( | uint16_t | msgId, |
| RobotToRobotMessageHandler * | handler | ||
| ) |
| const RefSerialData::Rx::GameData & tap::communication::serial::RefSerial::getGameData | ( | ) | const |
Returns a reference to the most up to date game data struct.
| bool tap::communication::serial::RefSerial::getRefSerialReceivingData | ( | ) | const |
| const RefSerialData::Rx::RobotData & tap::communication::serial::RefSerial::getRobotData | ( | ) | const |
Returns a reference to the most up to date robot data struct.
| RefSerial::RobotId tap::communication::serial::RefSerial::getRobotIdBasedOnCurrentRobotTeam | ( | RobotId | id | ) |
Returns a robot id that is of the same color of this robot's ID. This allows you to specify you want to send to one robot and then based on your team it will be sent to the correct robot (your team not the enemy team's robot).
|
inlinestatic |
|
overridevirtual |
Handles the types of messages defined above in the RX message handlers section.
Implements tap::communication::serial::DJISerial.
| bool tap::communication::serial::RefSerial::operatorBlinded | ( | ) | const |
|
inline |