|
| | RefSerialTransmitter (Drivers *drivers) |
| |
| mockable modm::ResumableResult< void > | deleteGraphicLayer (Tx::DeleteGraphicOperation graphicOperation, uint8_t graphicLayer) |
| |
| mockable modm::ResumableResult< void > | sendRobotToRobotMsg (Tx::RobotToRobotMessage *robotToRobotMsg, uint16_t msgId, RobotId receiverId, uint16_t msgLen) |
| |
|
| mockable modm::ResumableResult< void > | sendGraphic (Tx::Graphic1Message *graphicMsg, bool configMsgHeader=true, bool sendMsg=true) |
| |
| mockable modm::ResumableResult< void > | sendGraphic (Tx::Graphic2Message *graphicMsg, bool configMsgHeader=true, bool sendMsg=true) |
| |
| mockable modm::ResumableResult< void > | sendGraphic (Tx::Graphic5Message *graphicMsg, bool configMsgHeader=true, bool sendMsg=true) |
| |
| mockable modm::ResumableResult< void > | sendGraphic (Tx::Graphic7Message *graphicMsg, bool configMsgHeader=true, bool sendMsg=true) |
| |
| mockable modm::ResumableResult< void > | sendGraphic (Tx::GraphicCharacterMessage *graphicMsg, bool configMsgHeader=true, bool sendMsg=true) |
| |
|
| static void | configGraphicGenerics (Tx::GraphicData *graphicData, const uint8_t *name, Tx::GraphicOperation operation, uint8_t layer, Tx::GraphicColor color) |
| |
| static void | configLine (uint16_t width, uint16_t startX, uint16_t startY, uint16_t endX, uint16_t endY, Tx::GraphicData *sharedData) |
| |
| static void | configRectangle (uint16_t width, uint16_t startX, uint16_t startY, uint16_t endX, uint16_t endY, Tx::GraphicData *sharedData) |
| |
| static void | configCircle (uint16_t width, uint16_t centerX, uint16_t centerY, uint16_t radius, Tx::GraphicData *sharedData) |
| |
| static void | configEllipse (uint16_t width, uint16_t centerX, uint16_t centerY, uint16_t xLen, uint16_t yLen, Tx::GraphicData *sharedData) |
| |
| static void | configArc (uint16_t startAngle, uint16_t endAngle, uint16_t width, uint16_t centerX, uint16_t centerY, uint16_t xLen, uint16_t yLen, Tx::GraphicData *sharedData) |
| |
| static void | configFloatingNumber (uint16_t fontSize, uint16_t decimalPrecision, uint16_t width, uint16_t startX, uint16_t startY, float value, Tx::GraphicData *sharedData) |
| |
| static void | configInteger (uint16_t fontSize, uint16_t width, uint16_t startX, uint16_t startY, int32_t value, Tx::GraphicData *sharedData) |
| |
| static void | configCharacterMsg (uint16_t fontSize, uint16_t width, uint16_t startX, uint16_t startY, const char *dataToPrint, Tx::GraphicCharacterMessage *sharedData) |
| |
| static void | configFrameHeader (DJISerial::FrameHeader *header, uint16_t msgLen) |
| |
| static void | configInteractiveHeader (Tx::InteractiveHeader *header, uint16_t cmdId, RobotId senderId, uint16_t receiverId) |
| |
| static bool | isBlueTeam (RobotId id) |
| |
Encapsulates logic for sending messages to the referee system. This includes sending robot-to-robot communication messages and UI drawing instructions to the RoboMaster client.
The instance member functions of this class that return a modm::ResumableResult<void> must be used in a protothread or resumable function. In other words, member functions such as sendGraphic must be in a call of PT_CALL or RF_CALL.
This transmitter allows the user to send data to the referee system from multiple protothreads. An instance of the ref serial transmitter should be instantiated for each protothread. If unique instances are not used, behavior is undefined.
| void tap::communication::serial::RefSerialTransmitter::configGraphicGenerics |
( |
Tx::GraphicData * |
graphicData, |
|
|
const uint8_t * |
name, |
|
|
Tx::GraphicOperation |
operation, |
|
|
uint8_t |
layer, |
|
|
Tx::GraphicColor |
color |
|
) |
| |
|
static |
Configures the graphicData with all data generic to the type of graphic being configured.
For sending graphics, the general schema is to create a Graphic<n>Message struct, configure the individual GraphicData structs in the graphic message using the configGraphicGenerics and then config<Line|Rectangle|Circle|etc.> functions. Finally, send the graphic message using sendGraphic.
For example, to configure and send a line graphic (refSerialTransmitter is a pointer to a RefSerialTransmitter object):
Graphic1Message msg;
&msg.graphicData,
"\x00\x00\x01",
RefSerial::GRAPHIC_ADD,1,
YELLOW);
refSerialTransmitter->sendGraphic(&msg);
static void configLine(uint16_t width, uint16_t startX, uint16_t startY, uint16_t endX, uint16_t endY, Tx::GraphicData *sharedData)
Definition ref_serial_transmitter.cpp:50
static void configGraphicGenerics(Tx::GraphicData *graphicData, const uint8_t *name, Tx::GraphicOperation operation, uint8_t layer, Tx::GraphicColor color)
Definition ref_serial_transmitter.cpp:37
- Parameters
-
| [out] | graphicData | The structure where generic data will be stored. |
| [in] | name | The name of the graphic. |
| [in] | operation | The graphic operation to be done (add/remove, etc). |
| [in] | layer | The graphic layer the graphic will be located at. Must be between 0-9 |
| [in] | color | The color of the graphic. |