MIP_SDK
latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
41 #ifndef MICROSTRAIN_PLATFORM_WINDOWS // Avoid name conflict with windows.h
57 operator const void*()
const {
return isAck() ? this :
nullptr; }
bool mip_cmd_result_is_reply(enum mip_cmd_result result)
Determines if the result is a reply from the device (i.e. mip_ack).
Definition: mip_result.c:55
@ MIP_STATUS_WAITING
Waiting for command reply (timeout timer has started).
Definition: mip_result.h:35
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
bool mip_cmd_result_is_finished(enum mip_cmd_result status)
Determines if the command has completed, timed out, been cancelled, or otherwise is no longer waiting...
Definition: mip_result.c:47
static constexpr C::mip_cmd_result NACK_INVALID_CHECKSUM
Reserved.
Definition: mip_result.hpp:36
mip_cmd_result
Represents the status of a MIP command.
Definition: mip_result.h:27
static constexpr C::mip_cmd_result NACK_INVALID_PARAM
A parameter was not a supported value.
Definition: mip_result.hpp:37
bool isAck() const
Definition: mip_result.hpp:71
const char * mip_cmd_result_to_string(enum mip_cmd_result result)
Converts the command result to a string for debugging.
Definition: mip_result.c:17
static constexpr C::mip_cmd_result STATUS_PENDING
Definition: mip_result.hpp:42
@ MIP_NACK_COMMAND_UNKNOWN
Command not supported.
Definition: mip_result.h:41
bool isReplyCode() const
Definition: mip_result.hpp:68
static constexpr C::mip_cmd_result STATUS_ERROR
Command could not be executed (error sending/receiving)
Definition: mip_result.hpp:27
bool operator!() const
Definition: mip_result.hpp:58
@ MIP_STATUS_PENDING
Command has been queued but the I/O update hasn't run yet.
Definition: mip_result.h:36
static constexpr C::mip_cmd_result STATUS_WAITING
Waiting for command reply (timeout timer has started).
Definition: mip_result.hpp:30
static constexpr CmdResult userResult(uint8_t n)
Definition: mip_result.hpp:54
@ MIP_NACK_COMMAND_TIMEOUT
Internal device timeout. Use MIP_STATUS_TIMEDOUT for command timeouts.
Definition: mip_result.h:45
static constexpr CmdResult fromAckNack(uint8_t code)
Definition: mip_result.hpp:55
@ MIP_NACK_COMMAND_FAILED
The device could not complete the command.
Definition: mip_result.h:44
bool isFinished() const
Definition: mip_result.hpp:70
constexpr bool operator!=(CmdResult other) const
Definition: mip_result.hpp:61
static constexpr C::mip_cmd_result STATUS_TIMEDOUT
Reply was not received before timeout expired.
Definition: mip_result.hpp:29
static constexpr C::mip_cmd_result STATUS_QUEUED
Command has been queued but the I/O update hasn't run yet.
Definition: mip_result.hpp:31
constexpr bool operator==(CmdResult other) const
Definition: mip_result.hpp:60
@ MIP_STATUS_TIMEDOUT
Reply was not received before timeout expired.
Definition: mip_result.h:34
@ MIP_STATUS_CANCELLED
Command was canceled in software.
Definition: mip_result.h:33
Represents the status of a MIP command.
Definition: mip_result.hpp:24
CmdResult & operator=(const CmdResult &other)=default
static constexpr C::mip_cmd_result STATUS_CANCELLED
Command was canceled in software.
Definition: mip_result.hpp:28
constexpr CmdResult(C::mip_cmd_result result)
Definition: mip_result.hpp:48
constexpr bool operator!=(C::mip_cmd_result other) const
Definition: mip_result.hpp:64
const char * name() const
Definition: mip_result.hpp:66
static constexpr C::mip_cmd_result NACK_COMMAND_UNKNOWN
Command not supported.
Definition: mip_result.hpp:35
@ MIP_STATUS_ERROR
Command could not be executed (error sending/receiving)
Definition: mip_result.h:32
bool mip_cmd_result_is_ack(enum mip_cmd_result result)
Determines if the result is an ack (successful response from the device)
Definition: mip_result.c:79
bool isStatusCode() const
Definition: mip_result.hpp:69
@ MIP_NACK_INVALID_PARAM
A parameter was not a supported value.
Definition: mip_result.h:43
bool mip_cmd_result_is_status(enum mip_cmd_result result)
Determines if the result code was generated by this lib (i.e. mip_cmd_status).
Definition: mip_result.c:63
static constexpr C::mip_cmd_result ACK_OK
Command completed successfully.
Definition: mip_result.hpp:34
constexpr bool operator==(C::mip_cmd_result other) const
Definition: mip_result.hpp:63
@ MIP_ACK_OK
Command completed successfully.
Definition: mip_result.h:40
static constexpr C::mip_cmd_result STATUS_USER
Values defined by user code must be less than or equal to this value.
Definition: mip_result.hpp:26
@ MIP_NACK_INVALID_CHECKSUM
Reserved.
Definition: mip_result.h:42
CmdResult & operator=(C::mip_cmd_result other)
Definition: mip_result.hpp:52
@ MIP_STATUS_USER_START
Values defined by user code must be less than or equal to this value.
Definition: mip_result.h:29
static constexpr C::mip_cmd_result STATUS_NONE
Command has been initialized but not queued yet.
Definition: mip_result.hpp:32
C::mip_cmd_result value
Definition: mip_result.hpp:45
@ MIP_STATUS_NONE
Command has been initialized but not queued yet.
Definition: mip_result.h:37
static constexpr C::mip_cmd_result NACK_COMMAND_TIMEOUT
Internal device timeout. Use MIP_STATUS_TIMEDOUT for command timeouts.
Definition: mip_result.hpp:39
constexpr CmdResult()
Definition: mip_result.hpp:47
static constexpr C::mip_cmd_result NACK_COMMAND_FAILED
The device could not complete the command.
Definition: mip_result.hpp:38