Classes | Typedefs | Functions
mip_cmd_queue functions [C]
Collaboration diagram for mip_cmd_queue functions [C]:

Classes

struct  mip_cmd_queue
 Holds a list of pending commands. More...
 

Typedefs

typedef struct mip_cmd_queue mip_cmd_queue
 Holds a list of pending commands. More...
 

Functions

timeout_type mip_cmd_queue_base_reply_timeout (const mip_cmd_queue *queue)
 Gets the base reply timeout for all commands. More...
 
void mip_cmd_queue_clear (mip_cmd_queue *queue)
 Clears the command queue. More...
 
void mip_cmd_queue_dequeue (mip_cmd_queue *queue, mip_pending_cmd *cmd)
 Removes a pending command from the queue. More...
 
void mip_cmd_queue_enqueue (mip_cmd_queue *queue, mip_pending_cmd *cmd)
 Queue a command to wait for replies. More...
 
void mip_cmd_queue_init (mip_cmd_queue *queue, timeout_type base_reply_timeout)
 Initializes a command queue. More...
 
void mip_cmd_queue_process_packet (mip_cmd_queue *queue, const mip_packet *packet, timestamp_type timestamp)
 Process an incoming packet and check for replies to pending commands. More...
 
void mip_cmd_queue_set_base_reply_timeout (mip_cmd_queue *queue, timeout_type timeout)
 Sets the base reply timeout for all commands. More...
 
void mip_cmd_queue_update (mip_cmd_queue *queue, timestamp_type timestamp)
 Call periodically to make sure commands time out if no packets are received. More...
 

Detailed Description

Note
This should be considered an "opaque" structure; its members should be considered an internal implementation detail. Avoid accessing them directly as they are subject to change in future versions of this software.

Typedef Documentation

◆ mip_cmd_queue

typedef struct mip_cmd_queue mip_cmd_queue

Holds a list of pending commands.

Currently only one command may be pending at a time.

Note
This should be considered an "opaque" structure; its members should be considered an internal implementation detail. Avoid accessing them directly as they are subject to change in future versions of this software.

Function Documentation

◆ mip_cmd_queue_base_reply_timeout()

timeout_type mip_cmd_queue_base_reply_timeout ( const mip_cmd_queue queue)

Gets the base reply timeout for all commands.

Returns
The minimum time to wait for a reply to any command.

Definition at line 481 of file mip_cmdqueue.c.

◆ mip_cmd_queue_clear()

void mip_cmd_queue_clear ( mip_cmd_queue queue)

Clears the command queue.

This must be called from the same thread context as the update function.

Parameters
queue

Definition at line 411 of file mip_cmdqueue.c.

◆ mip_cmd_queue_dequeue()

void mip_cmd_queue_dequeue ( mip_cmd_queue queue,
mip_pending_cmd cmd 
)

Removes a pending command from the queue.

Definition at line 238 of file mip_cmdqueue.c.

◆ mip_cmd_queue_enqueue()

void mip_cmd_queue_enqueue ( mip_cmd_queue queue,
mip_pending_cmd cmd 
)

Queue a command to wait for replies.

Parameters
queue
cmdListens for replies to this command.
Warning
The command must not be deallocated or go out of scope while the mip_cmd_status_is_finished returns false.

Definition at line 215 of file mip_cmdqueue.c.

◆ mip_cmd_queue_init()

void mip_cmd_queue_init ( mip_cmd_queue queue,
timeout_type  base_reply_timeout 
)

Initializes a command queue.

Parameters
queue
base_reply_timeoutThe minimum timeout given to all MIP commands. Additional time may be given to specific commands which take longer. This is intended to be used to accommodate long communication latencies, such as when using a TCP connection.

Definition at line 194 of file mip_cmdqueue.c.

◆ mip_cmd_queue_process_packet()

void mip_cmd_queue_process_packet ( mip_cmd_queue queue,
const mip_packet packet,
timestamp_type  timestamp 
)

Process an incoming packet and check for replies to pending commands.

Call this from the Mip_parser callback, passing the arguments directly.

Parameters
queue
packetThe received MIP packet. Assumed to be valid.
timestampThe time the packet was received

Definition at line 369 of file mip_cmdqueue.c.

◆ mip_cmd_queue_set_base_reply_timeout()

void mip_cmd_queue_set_base_reply_timeout ( mip_cmd_queue queue,
timeout_type  timeout 
)

Sets the base reply timeout for all commands.

The base reply timeout is the minimum time to wait for a reply. Takes effect for any commands queued after this function call.

Parameters
queue
timeout

Definition at line 471 of file mip_cmdqueue.c.

◆ mip_cmd_queue_update()

void mip_cmd_queue_update ( mip_cmd_queue queue,
timestamp_type  now 
)

Call periodically to make sure commands time out if no packets are received.

Call this during the device update if no calls to mip_cmd_queue_process_packet are made (e.g. because no packets were received). It is safe to call this in either case.

Parameters
queue
now

Definition at line 434 of file mip_cmdqueue.c.



microstrain_inertial_driver
Author(s): Brian Bingham, Parker Hannifin Corp
autogenerated on Wed Mar 22 2023 02:35:07