#include <ResponseMessage.h>
Public Member Functions | |
ResponseMessage (vector< uint8_t > rsp) | |
ResponseMessage | operator= (ResponseMessage const &rvalue) |
uint16_t | getId () const |
uint8_t | getResponse () const |
uint8_t | getStatus () const |
string | getStatusMessage () const throw (CommandDependentStatusException) |
void | resetParamPointer () |
int8_t | getNextParamAsInt8 () |
uint8_t | getNextParamAsUInt8 () |
int16_t | getNextParamAsInt16 () |
uint16_t | getNextParamAsUInt16 () |
int32_t | getNextParamAsInt32 () |
uint32_t | getNextParamAsUInt32 () |
int64_t | getNextParamAsInt64 () |
uint64_t | getNextParamAsUInt64 () |
uint8_t | getChecksum () const |
int | getRespParamLen () const |
vector< uint8_t > | getParamBytes () const |
vector< uint8_t > | getBytes () const |
void | errorCheck () const throw (CommandChecksumFailedException, CommandDependentStatusException, CommandFailedException, CommandUnsupportedException, IOException) |
Static Public Attributes | |
static const int | HEADER_LEN = 6 |
static const int | FOOTER_LEN = 2 |
static const int | MSG_LEN_IDX = 1 |
static const int | CMD_ID_IDX = 2 |
static const int | RESPONSE_IDX = 4 |
static const int | STATUS_IDX = 5 |
static const int | CHECKSUM_RIDX = 2 |
static const uint8_t | RESP_SUCCESS = 0x00 |
static const uint8_t | RESP_FAILED = 0x01 |
static const uint8_t | RESP_UNSUPPORTED = 0x02 |
static const uint8_t | STATUS_UNSPECIFIED = 0x00 |
static const uint8_t | STATUS_UNSUPPORTED = 0x01 |
static const uint8_t | STATUS_INVALID_IN_CURRENT_CONFIG = 0x02 |
Definition at line 34 of file ResponseMessage.h.
annotatorcomm::ResponseMessage::ResponseMessage | ( | vector< uint8_t > | rsp | ) |
void annotatorcomm::ResponseMessage::errorCheck | ( | ) | const throw (CommandChecksumFailedException, CommandDependentStatusException, CommandFailedException, CommandUnsupportedException, IOException) |
Error check the response. If a problem is encountered, an exception is thrown. All problems can generically be caught with an IOException, or finer granularity can be choosen from the throws list below.
CommandChecksumFailedException | thrown if the checksum failed | |
CommandDependentStatusException | thrown on command dependent status code | |
CommandFailedException | thrown on command failure | |
CommandUnsupportedException | thrown on unsupported command | |
IOException | thrown for all other I/O failures |
vector<uint8_t> annotatorcomm::ResponseMessage::getBytes | ( | ) | const |
Get the response message's bytes.
uint8_t annotatorcomm::ResponseMessage::getChecksum | ( | ) | const |
Get the response checksum.
uint16_t annotatorcomm::ResponseMessage::getId | ( | ) | const |
Get the Command ID.
int16_t annotatorcomm::ResponseMessage::getNextParamAsInt16 | ( | ) |
Get the next parameter as a signed 16-bit integer.
int32_t annotatorcomm::ResponseMessage::getNextParamAsInt32 | ( | ) |
Get the next parameter as a signed 32-bit integer.
int64_t annotatorcomm::ResponseMessage::getNextParamAsInt64 | ( | ) |
Get the next parameter as a signed 64-bit integer.
int8_t annotatorcomm::ResponseMessage::getNextParamAsInt8 | ( | ) |
Get the next parameter as a signed 8-bit integer.
uint16_t annotatorcomm::ResponseMessage::getNextParamAsUInt16 | ( | ) |
Get the next parameter as an unsigned 16-bit integer.
uint32_t annotatorcomm::ResponseMessage::getNextParamAsUInt32 | ( | ) |
Get the next parameter as an unsigned 32-bit integer.
uint64_t annotatorcomm::ResponseMessage::getNextParamAsUInt64 | ( | ) |
Get the next parameter as an unsigned 64-bit integer.
uint8_t annotatorcomm::ResponseMessage::getNextParamAsUInt8 | ( | ) |
Get the next parameter as an unsigned 8-bit integer.
vector<uint8_t> annotatorcomm::ResponseMessage::getParamBytes | ( | ) | const |
Get the response message's parameter bytes.
uint8_t annotatorcomm::ResponseMessage::getResponse | ( | ) | const |
Get the response code.
int annotatorcomm::ResponseMessage::getRespParamLen | ( | ) | const |
Get the length of the response parameter bytes.
uint8_t annotatorcomm::ResponseMessage::getStatus | ( | ) | const |
Get the status code.
string annotatorcomm::ResponseMessage::getStatusMessage | ( | ) | const throw (CommandDependentStatusException) |
Get the status message as a human readable string.
CommandDependentStatusException | thrown on command dependent status |
ResponseMessage annotatorcomm::ResponseMessage::operator= | ( | ResponseMessage const & | rvalue | ) |
Overload assignment operator.
rvalue | right hand side |
void annotatorcomm::ResponseMessage::resetParamPointer | ( | ) |
Restart the parameter index.
const int annotatorcomm::ResponseMessage::CHECKSUM_RIDX = 2 [static] |
Checksum reverse index
Definition at line 72 of file ResponseMessage.h.
const int annotatorcomm::ResponseMessage::CMD_ID_IDX = 2 [static] |
Command ID index
Definition at line 57 of file ResponseMessage.h.
const int annotatorcomm::ResponseMessage::FOOTER_LEN = 2 [static] |
Length of the footer in bytes
Definition at line 46 of file ResponseMessage.h.
const int annotatorcomm::ResponseMessage::HEADER_LEN = 6 [static] |
Length of the header in bytes
Definition at line 41 of file ResponseMessage.h.
const int annotatorcomm::ResponseMessage::MSG_LEN_IDX = 1 [static] |
Message length index
Definition at line 52 of file ResponseMessage.h.
const uint8_t annotatorcomm::ResponseMessage::RESP_FAILED = 0x01 [static] |
Response Code: Failed to execute (but the Command ID was valid), see Status Code for details
Definition at line 82 of file ResponseMessage.h.
const uint8_t annotatorcomm::ResponseMessage::RESP_SUCCESS = 0x00 [static] |
Response Code: Success
Definition at line 77 of file ResponseMessage.h.
const uint8_t annotatorcomm::ResponseMessage::RESP_UNSUPPORTED = 0x02 [static] |
Response Code: Unsupported Command ID
Definition at line 87 of file ResponseMessage.h.
const int annotatorcomm::ResponseMessage::RESPONSE_IDX = 4 [static] |
Response code index
Definition at line 62 of file ResponseMessage.h.
const int annotatorcomm::ResponseMessage::STATUS_IDX = 5 [static] |
Status code index
Definition at line 67 of file ResponseMessage.h.
const uint8_t annotatorcomm::ResponseMessage::STATUS_INVALID_IN_CURRENT_CONFIG = 0x02 [static] |
Status Code: Invalid command in the current configuration
Definition at line 102 of file ResponseMessage.h.
const uint8_t annotatorcomm::ResponseMessage::STATUS_UNSPECIFIED = 0x00 [static] |
Status Code: Unspecified failure
Definition at line 92 of file ResponseMessage.h.
const uint8_t annotatorcomm::ResponseMessage::STATUS_UNSUPPORTED = 0x01 [static] |
Status Code: Unsupported command or subcommand
Definition at line 97 of file ResponseMessage.h.