Creates a GenericInertialCommandResponse with default values.
GenericInertialCommandResponse( |
| ) |
Creates a GenericInertialCommandResponse with the given parameters.
state ResponsePattern::State | The state of the response. |
success bool | Whether or not the command was a success. |
errorCode InertialPacket::MipAckNack | The MIP Ack/Nack error code received. |
cmdName std::string | The name of the command. |
data | The <ByteStream that holds the result data from the response (if any). |
static GenericInertialCommandResponse ResponseSuccess( |
| ) |
Creates a GenericInertialCommandResponse with a successful response.
cmdName std::string | The name of the command. |
data | The <ByteStream that holds the data from the response (if any). |
A GenericInertialCommandResponse representing a success response from the command.
static GenericInertialCommandResponse ResponseFail( |
| ) |
Creates a GenericInertialCommandResponse with a fail response.
errorState ResponsePattern::State | The state that caused the ResponseFail. |
errorCode InertialPacket::MipAckNack | The MIP Ack/Nack error code to set with the ResponseFail. |
cmdName std::string | The name of the command. |
A GenericInertialCommandResponse representing a failed response from the command.
Gets the data that was received from the response, if any.
A ByteStream that contains the data received from the response, if any.
Represents a base class for Inertial commands
static ByteStream buildCommand( |
| ) |
Builds the command for an Inertial command, and returns a ByteStream containing the bytes to send
descSetByte uint8 | The descriptor set byte for the command |
cmdByte uint8 | The command (field) byte for the command |
fieldData | A vector of bytes that make up the field data to be sent in the command (defaults to empty) |
A ByteStream containing the Inertial command packet built from the given bytes
static ByteStream buildCommand( |
| ) |
Builds the command for an Inertial command, and returns a ByteStream containing the bytes to send
commandId | The InertialTypes::Command for the command |
fieldData | A vector of bytes that make up the field data to be sent in the command (defaults to empty) |
A ByteStream containing the Inertial command packet built from the given bytes
Handles the response to the Inertial command
Whether or not an ack/nack response field is expected
Whether or not a data response field is expected
The name of the command
The GenericInertialCommandResponse that holds the result of the GenericInertialCommand
Gets the InertialTypes::Command for the Inertial command
Gets the data field byte that should be received with the data field (if any)
Gets the descriptor set byte for the Inertial command
Gets the command byte for the Inertial command
Gets the ack/nack byte that should be received with the ack/nack field
Response( |
| ) |
Creates a Ping Response object
collector std::weak_ptr<ResponseCollector> | The ResponseCollector used to register and unregister the response |
ackNackResponse bool | Whether or not an ack/nack response field is expected |
dataResponse bool | Whether or not a data response field is expected |
cmdName std::string | The name of the command (to be used in exceptions that may be thrown) |
virtual bool match( |
| ) override |
Checks if the InertialDataField passed in matches the expected response pattern's bytes
field const InertialDataField& | The InertialDataField in which to try to find the pattern |
true if the packet matches a response pattern, false otherwise
bool match_ackNack( |
| ) |
Checks if the InertialDataField matches the ACK/NACK field for this command (if one is even expected)
field const InertialDataField& | The InertialDataField in which to try to find the pattern |
true if the packet matches the expected response pattern, false otherwise
virtual bool match_data( |
| ) |
Checks if the InertialDataField matches the data field for this command (if one is even expected)
field const InertialDataField& | The InertialDataField in which to try to find the pattern |
true if the packet matches the expected response pattern, false otherwise
bool wait( |
| ) |
Waits for a certain amount of time for the response pattern to be matched
timeout uint64 | The maximum time (in milliseconds) to wait until the command times out and returns, if not found first |
true if the response pattern was matched, false otherwise
Gets the GenericInertialCommandResponse that holds the result of the response
A GenericInertialCommandResponse that holds the result of the response