Prusa3d Marlin fork
|
#include <mmu2_protocol.h>
Public Member Functions | |
DecodeStatus | DecodeRequest (uint8_t c) |
DecodeStatus | DecodeResponse (uint8_t c) |
const RequestMsg | GetRequestMsg () const |
const ResponseMsg | GetResponseMsg () const |
void | ResetRequestDecoder () |
resets the internal request decoding state (typically after an error) | |
void | ResetResponseDecoder () |
resets the internal response decoding state (typically after an error) | |
Static Public Member Functions | |
static uint8_t | EncodeRequest (const RequestMsg &msg, uint8_t *txbuff) |
static uint8_t | EncodeWriteRequest (uint8_t address, uint16_t value, uint8_t *txbuff) |
static constexpr uint8_t | MaxRequestSize () |
static constexpr uint8_t | MaxResponseSize () |
static uint8_t | EncodeResponseCmdAR (const RequestMsg &msg, ResponseMsgParamCodes ar, uint8_t *txbuff) |
static uint8_t | EncodeResponseReadFINDA (const RequestMsg &msg, uint8_t findaValue, uint8_t *txbuff) |
static uint8_t | EncodeResponseQueryOperation (const RequestMsg &msg, ResponseCommandStatus rcs, uint8_t *txbuff) |
static uint8_t | EncodeResponseRead (const RequestMsg &msg, bool accepted, uint16_t value2, uint8_t *txbuff) |
Protocol class is responsible for creating/decoding messages in Rx/Tx buffer
Beware - in the decoding more, it is meant to be a statefull instance which works through public methods processing one input byte per call.
DecodeStatus modules::protocol::Protocol::DecodeRequest | ( | uint8_t | c | ) |
Takes the input byte c and steps one step through the state machine
DecodeStatus modules::protocol::Protocol::DecodeResponse | ( | uint8_t | c | ) |
Decodes response message in rxbuff
|
static |
Encodes request message msg into txbuff memory It is expected the txbuff is large enough to fit the message
|
static |
Encode generic response Command Accepted or Rejected
msg | source request message for this response |
ar | code of response parameter |
txbuff | where to format the message |
|
static |
Encode response to Query operation status
msg | source request message for this response |
code | status of operation (Processing, Error, Finished) |
value | related to status of operation(e.g. error code or progress) |
txbuff | where to format the message |
|
static |
Encode response to Read query
msg | source request message for this response |
accepted | true if the read query was accepted |
value2 | variable value |
txbuff | where to format the message |
|
static |
Encode response to Read FINDA query
msg | source request message for this response |
findaValue | 1/0 (on/off) status of FINDA |
txbuff | where to format the message |
|
static |
Encodes Write request message msg into txbuff memory It is expected the txbuff is large enough to fit the message
|
inline |
|
inline |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |