MIP_SDK
latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
40 uint8_t* _response_buffer;
46 uint8_t _descriptor_set;
47 uint8_t _field_descriptor;
48 uint8_t _response_descriptor;
50 uint8_t _response_buffer_size;
51 uint8_t _response_length;
93 #ifdef MIP_ENABLE_DIAGNOSTICS
94 uint16_t _diag_cmds_queued;
95 uint16_t _diag_cmds_acked;
96 uint8_t _diag_cmds_nacked;
97 uint8_t _diag_cmds_timedout;
98 uint8_t _diag_cmds_failed;
99 #endif // MIP_ENABLE_DIAGNOSTICS
117 #ifdef MIP_ENABLE_DIAGNOSTICS
118 uint16_t mip_cmd_queue_diagnostic_cmds_queued(
const mip_cmd_queue* queue);
119 uint16_t mip_cmd_queue_diagnostic_cmds_failed(
const mip_cmd_queue* queue);
120 uint16_t mip_cmd_queue_diagnostic_cmds_successful(
const mip_cmd_queue* queue);
122 uint16_t mip_cmd_queue_diagnostic_cmd_acks(
const mip_cmd_queue* queue);
123 uint16_t mip_cmd_queue_diagnostic_cmd_nacks(
const mip_cmd_queue* queue);
124 uint16_t mip_cmd_queue_diagnostic_cmd_timeouts(
const mip_cmd_queue* queue);
125 uint16_t mip_cmd_queue_diagnostic_cmd_errors(
const mip_cmd_queue* queue);
126 #endif // MIP_ENABLE_DIAGNOSTICS
const uint8_t * mip_pending_cmd_response(const mip_pending_cmd *cmd)
Returns the response payload pointer.
Definition: mip_cmdqueue.c:128
struct mip::C::mip_cmd_queue mip_cmd_queue
Holds a list of pending commands.
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
void mip_cmd_queue_process_packet(mip_cmd_queue *queue, const mip_packet_view *packet, mip_timestamp timestamp)
Process an incoming packet and check for replies to pending commands.
Definition: mip_cmdqueue.c:381
mip_cmd_result
Represents the status of a MIP command.
Definition: mip_result.h:27
void mip_cmd_queue_clear(mip_cmd_queue *queue)
Clears the command queue.
Definition: mip_cmdqueue.c:423
bool mip_pending_cmd_check_timeout(const mip_pending_cmd *cmd, mip_timestamp now)
Checks if the command should time out.
Definition: mip_cmdqueue.c:182
mip_timeout mip_cmd_queue_base_reply_timeout(const mip_cmd_queue *queue)
Gets the base reply timeout for all commands.
Definition: mip_cmdqueue.c:493
Holds a list of pending commands.
Definition: mip_cmdqueue.h:88
int mip_pending_cmd_remaining_time(const mip_pending_cmd *cmd, mip_timestamp now)
Determines how much time is remaining before the command times out.
Definition: mip_cmdqueue.c:164
Structure representing a MIP Packet.
Definition: mip_packet.h:50
void mip_cmd_queue_enqueue(mip_cmd_queue *queue, mip_pending_cmd *cmd)
Queue a command to wait for replies.
Definition: mip_cmdqueue.c:227
microstrain::C::microstrain_embedded_timestamp mip_timeout
Definition: mip_types.h:16
struct mip::C::mip_pending_cmd mip_pending_cmd
Represents a command awaiting a reply from the device.
void mip_cmd_queue_dequeue(mip_cmd_queue *queue, mip_pending_cmd *cmd)
Removes a pending command from the queue.
Definition: mip_cmdqueue.c:250
uint8_t mip_pending_cmd_response_length(const mip_pending_cmd *cmd)
Returns the length of the response data.
Definition: mip_cmdqueue.c:142
enum mip_cmd_result mip_pending_cmd_status(const mip_pending_cmd *cmd)
Returns the status of the pending command.
Definition: mip_cmdqueue.c:110
void mip_pending_cmd_init_full(mip_pending_cmd *cmd, uint8_t descriptor_set, uint8_t field_descriptor, uint8_t response_descriptor, uint8_t *response_buffer, uint8_t response_buffer_size, mip_timeout additional_time)
Initialize a pending mip commmand with all parameters.
Definition: mip_cmdqueue.c:90
void mip_pending_cmd_init(mip_pending_cmd *cmd, uint8_t descriptor_set, uint8_t field_descriptor)
Initialize a pending command with no reponse data or additional time.
Definition: mip_cmdqueue.c:32
void mip_cmd_queue_set_base_reply_timeout(mip_cmd_queue *queue, mip_timeout timeout)
Sets the base reply timeout for all commands.
Definition: mip_cmdqueue.c:483
Represents a command awaiting a reply from the device.
Definition: mip_cmdqueue.h:37
void mip_cmd_queue_update(mip_cmd_queue *queue, mip_timestamp now)
Call periodically to make sure commands time out if no packets are received.
Definition: mip_cmdqueue.c:446
uint8_t mip_pending_cmd_response_descriptor(const mip_pending_cmd *cmd)
Returns the response descriptor.
Definition: mip_cmdqueue.c:118
void mip_cmd_queue_init(mip_cmd_queue *queue, mip_timeout base_reply_timeout)
Initializes a command queue.
Definition: mip_cmdqueue.c:206
void mip_pending_cmd_init_with_response(mip_pending_cmd *cmd, uint8_t descriptor_set, uint8_t field_descriptor, uint8_t response_descriptor, uint8_t *response_buffer, uint8_t response_buffer_size)
Initialize a pending mip commmand with expected response data.
Definition: mip_cmdqueue.c:68
microstrain::C::microstrain_embedded_timestamp mip_timestamp
Definition: mip_types.h:15
void mip_pending_cmd_init_with_timeout(mip_pending_cmd *cmd, uint8_t descriptor_set, uint8_t field_descriptor, mip_timeout additional_time)
Initialize a pending mip commmand with extra timeout time.
Definition: mip_cmdqueue.c:48