EV3UartProtocolParserSensorSide
|
Classes | |
class | Parser |
struct | ParserReturn |
Enumerations | |
enum | State : uint8_t { State::STATE_START = 0, State::WAIT_HEADER = 0, State::WAIT_CHECKSUM = 1, State::STATE_END = 1 } |
enum | ParseResult : uint8_t { ParseResult::INSUFFICIENT_DATA, ParseResult::RECEIVED_INVALID_HEADER, ParseResult::RECEIVED_SYS_ACK, ParseResult::RECEIVED_SYS_NACK, ParseResult::RECEIVED_CMD_SELECT, ParseResult::RECEIVED_CMD_WRITE, ParseResult::RECEIVED_CMD_INVALID_FCS } |
Functions | |
constexpr uint8_t | two_pow (uint8_t val) |
constexpr State | next_state (State st) |
Variables | |
constexpr uint8_t | BUFFER_LEN { EV3UartGenerator::Framing::BUFFER_MIN } |
|
strong |
Enumeration listing the possible results from parsing an additional byte of data coming from the EV3, returned by Parser
Enumerator | |
---|---|
INSUFFICIENT_DATA | The parser does not currently have sufficient data to return a significant parsing result. More data should be passed to the Parser::update() function. |
RECEIVED_INVALID_HEADER | The parser received an invalid header byte, a byte that is not the header for any message that the EV3 can send to a sensor. The reasons for this could be:
|
RECEIVED_SYS_ACK | Parser received a SYS ACK message |
RECEIVED_SYS_NACK | Parser received a SYS ACK message |
RECEIVED_CMD_SELECT | Parser received a CMD SELECT message with good FCS |
RECEIVED_CMD_WRITE | Parser received a CMD WRITE message with good FCS |
RECEIVED_CMD_INVALID_FCS | Parser received a CMD message with invalid FCS |
Definition at line 142 of file EV3UartProtocolParserSensorSide.hpp.
|
strong |
Enumeration listing the states the parser state machine can be in
Enumerator | |
---|---|
STATE_START | Starting value for State values. |
WAIT_HEADER | Parser is waiting for the header byte. |
WAIT_CHECKSUM | Parser is waiting for the checksum byte. |
STATE_END | End value for State values. |
Definition at line 115 of file EV3UartProtocolParserSensorSide.hpp.
Increments the variable representing the current parser state machine state to the next state, wrapping around if necessary.
st | current state of the state machine |
Definition at line 130 of file EV3UartProtocolParserSensorSide.hpp.
References STATE_END, and STATE_START.
Referenced by EV3UartProtocolParserSensorSide::Parser::update().
constexpr uint8_t EV3UartProtocolParserSensorSide::two_pow | ( | uint8_t | val | ) |
Raises two to the power of val
val | what to raise two to the power of, in the range [0, 7] |
val
val
greater than 7
. Definition at line 108 of file EV3UartProtocolParserSensorSide.hpp.
Referenced by EV3UartProtocolParserSensorSide::Parser::payload_length().
constexpr uint8_t EV3UartProtocolParserSensorSide::BUFFER_LEN { EV3UartGenerator::Framing::BUFFER_MIN } |
Length of internally allocated buffer to store messages incoming from the EV3
Definition at line 98 of file EV3UartProtocolParserSensorSide.hpp.