MIP_SDK  latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
Namespaces | Macros | Functions
mip_cmdqueue.c File Reference
#include "mip_cmdqueue.h"
#include "mip_field.h"
#include "mip_packet.h"
#include <string.h>
#include <assert.h>

Namespaces

 mip
 A collection of C++ classes and functions covering the full mip api.
 
 mip::C
 

Macros

#define MIP_REPLY_DESC_GLOBAL_ACK_NACK   0xF1
 
#define MIP_INDEX_REPLY_DESCRIPTOR   0
 
#define MIP_INDEX_REPLY_ACK_CODE   1
 

Functions

void mip::C::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. More...
 
void mip::C::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. More...
 
void mip::C::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. More...
 
void mip::C::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. More...
 
enum mip_cmd_result mip::C::mip_pending_cmd_status (const mip_pending_cmd *cmd)
 Returns the status of the pending command. More...
 
uint8_t mip::C::mip_pending_cmd_response_descriptor (const mip_pending_cmd *cmd)
 Returns the response descriptor. More...
 
const uint8_t * mip::C::mip_pending_cmd_response (const mip_pending_cmd *cmd)
 Returns the response payload pointer. More...
 
uint8_t mip::C::mip_pending_cmd_response_length (const mip_pending_cmd *cmd)
 Returns the length of the response data. More...
 
int mip::C::mip_pending_cmd_remaining_time (const mip_pending_cmd *cmd, mip_timestamp now)
 Determines how much time is remaining before the command times out. More...
 
bool mip::C::mip_pending_cmd_check_timeout (const mip_pending_cmd *cmd, mip_timestamp now)
 Checks if the command should time out. More...
 
void mip::C::mip_cmd_queue_init (mip_cmd_queue *queue, mip_timeout base_reply_timeout)
 Initializes a command queue. More...
 
void mip::C::mip_cmd_queue_enqueue (mip_cmd_queue *queue, mip_pending_cmd *cmd)
 Queue a command to wait for replies. More...
 
void mip::C::mip_cmd_queue_dequeue (mip_cmd_queue *queue, mip_pending_cmd *cmd)
 Removes a pending command from the queue. More...
 
void mip::C::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. More...
 
void mip::C::mip_cmd_queue_clear (mip_cmd_queue *queue)
 Clears the command queue. More...
 
void mip::C::mip_cmd_queue_update (mip_cmd_queue *queue, mip_timestamp now)
 Call periodically to make sure commands time out if no packets are received. More...
 
void mip::C::mip_cmd_queue_set_base_reply_timeout (mip_cmd_queue *queue, mip_timeout timeout)
 Sets the base reply timeout for all commands. More...
 
mip_timeout mip::C::mip_cmd_queue_base_reply_timeout (const mip_cmd_queue *queue)
 Gets the base reply timeout for all commands. More...
 

Macro Definition Documentation

◆ MIP_INDEX_REPLY_ACK_CODE

#define MIP_INDEX_REPLY_ACK_CODE   1

◆ MIP_INDEX_REPLY_DESCRIPTOR

#define MIP_INDEX_REPLY_DESCRIPTOR   0

◆ MIP_REPLY_DESC_GLOBAL_ACK_NACK

#define MIP_REPLY_DESC_GLOBAL_ACK_NACK   0xF1