MIP_SDK
latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
|
Represents the status of a MIP command. More...
#include <mip_result.hpp>
Public Member Functions | |
constexpr | CmdResult () |
constexpr | CmdResult (C::mip_cmd_result result) |
~CmdResult ()=default | |
CmdResult & | operator= (const CmdResult &other)=default |
CmdResult & | operator= (C::mip_cmd_result other) |
operator const void * () const | |
bool | operator! () const |
constexpr bool | operator== (CmdResult other) const |
constexpr bool | operator!= (CmdResult other) const |
constexpr bool | operator== (C::mip_cmd_result other) const |
constexpr bool | operator!= (C::mip_cmd_result other) const |
const char * | name () const |
bool | isReplyCode () const |
bool | isStatusCode () const |
bool | isFinished () const |
bool | isAck () const |
Static Public Member Functions | |
static constexpr CmdResult | userResult (uint8_t n) |
static constexpr CmdResult | fromAckNack (uint8_t code) |
Public Attributes | |
C::mip_cmd_result | value = C::MIP_STATUS_NONE |
Static Public Attributes | |
static constexpr C::mip_cmd_result | STATUS_USER = C::MIP_STATUS_USER_START |
Values defined by user code must be less than or equal to this value. More... | |
static constexpr C::mip_cmd_result | STATUS_ERROR = C::MIP_STATUS_ERROR |
Command could not be executed (error sending/receiving) More... | |
static constexpr C::mip_cmd_result | STATUS_CANCELLED = C::MIP_STATUS_CANCELLED |
Command was canceled in software. More... | |
static constexpr C::mip_cmd_result | STATUS_TIMEDOUT = C::MIP_STATUS_TIMEDOUT |
Reply was not received before timeout expired. More... | |
static constexpr C::mip_cmd_result | STATUS_WAITING = C::MIP_STATUS_WAITING |
Waiting for command reply (timeout timer has started). More... | |
static constexpr C::mip_cmd_result | STATUS_QUEUED = C::MIP_STATUS_PENDING |
Command has been queued but the I/O update hasn't run yet. More... | |
static constexpr C::mip_cmd_result | STATUS_NONE = C::MIP_STATUS_NONE |
Command has been initialized but not queued yet. More... | |
static constexpr C::mip_cmd_result | ACK_OK = C::MIP_ACK_OK |
Command completed successfully. More... | |
static constexpr C::mip_cmd_result | NACK_COMMAND_UNKNOWN = C::MIP_NACK_COMMAND_UNKNOWN |
Command not supported. More... | |
static constexpr C::mip_cmd_result | NACK_INVALID_CHECKSUM = C::MIP_NACK_INVALID_CHECKSUM |
Reserved. More... | |
static constexpr C::mip_cmd_result | NACK_INVALID_PARAM = C::MIP_NACK_INVALID_PARAM |
A parameter was not a supported value. More... | |
static constexpr C::mip_cmd_result | NACK_COMMAND_FAILED = C::MIP_NACK_COMMAND_FAILED |
The device could not complete the command. More... | |
static constexpr C::mip_cmd_result | NACK_COMMAND_TIMEOUT = C::MIP_NACK_COMMAND_TIMEOUT |
Internal device timeout. Use MIP_STATUS_TIMEDOUT for command timeouts. More... | |
static constexpr C::mip_cmd_result | STATUS_PENDING = STATUS_QUEUED |
Represents the status of a MIP command.
This is the same as the mip_cmd_result enum, but with some convenient member functions and some operator overloads.
CmdResult is convertible to bool, allowing code like the following:
|
inlineconstexpr |
|
inlineconstexpr |
|
default |
|
inlinestaticconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinestaticconstexpr |
|
staticconstexpr |
Command completed successfully.
|
staticconstexpr |
The device could not complete the command.
|
staticconstexpr |
Internal device timeout. Use MIP_STATUS_TIMEDOUT for command timeouts.
|
staticconstexpr |
Command not supported.
|
staticconstexpr |
Reserved.
|
staticconstexpr |
A parameter was not a supported value.
|
staticconstexpr |
Command was canceled in software.
|
staticconstexpr |
Command could not be executed (error sending/receiving)
|
staticconstexpr |
Command has been initialized but not queued yet.
|
staticconstexpr |
|
staticconstexpr |
Command has been queued but the I/O update hasn't run yet.
|
staticconstexpr |
Reply was not received before timeout expired.
|
staticconstexpr |
Values defined by user code must be less than or equal to this value.
|
staticconstexpr |
Waiting for command reply (timeout timer has started).
C::mip_cmd_result mip::CmdResult::value = C::MIP_STATUS_NONE |