InertialCmdResponse
InertialCmdResponse
GenericInertialCommandResponse

Represents the response to a generic InertialNode command

Functions
InertialCmdResponse
InertialCmdResponse()

Creates an InertialCmdResponse with default values

InertialCmdResponse
InertialCmdResponse(
ResponsePattern::State state,
bool success,
InertialPacket::MipAckNack errorCode,
std::string cmdName
)

Creates an InertialCmdResponse with the given parameters

Parameters
state
ResponsePattern::State

The state of the response

success
bool

Whether or not the response was a success

errorCode
InertialPacket::MipAckNack

The MIP Ack/Nack error code received

cmdName
std::string

The name of the command that this response corresponds to

Variables
m_responseState
ResponsePattern::State m_responseState

The state of the response, which determines which exceptions are thrown, if any

m_success
bool m_success

Whether or not the response was a success

m_ackNack
InertialPacket::MipAckNack m_ackNack

The MIP ack/nack that was received with the packet

m_commandName
std::string m_commandName

The name of the command that this response corresponds to (to be used in error descriptions)

Functions
throwIfFailed
void throwIfFailed()

Throws an exeption if the response was a failure.

Exceptions
success
virtual bool success() const

Gets whether or not the command was a success.

Returns

true if the command was a success, false otherwise

Exceptions
errorCode
virtual InertialPacket::MipAckNack errorCode() const

Gets the MIP ack/nack error code that was returned

Returns

The MIP ack/nack error code as a <InertialPacket::MipAckNack>