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

Classes

struct  mip_pending_cmd
 Represents a command awaiting a reply from the device. More...
 

Typedefs

typedef struct mip_pending_cmd mip_pending_cmd
 Represents a command awaiting a reply from the device. More...
 

Functions

bool mip_pending_cmd_check_timeout (const mip_pending_cmd *cmd, timestamp_type now)
 Checks if the command should time out. More...
 
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. More...
 
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_size, timeout_type additional_time)
 Initialize a pending mip commmand with all parameters. More...
 
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. More...
 
void mip_pending_cmd_init_with_timeout (mip_pending_cmd *cmd, uint8_t descriptor_set, uint8_t field_descriptor, timeout_type additional_time)
 Initialize a pending mip commmand with extra timeout time. More...
 
int mip_pending_cmd_remaining_time (const mip_pending_cmd *cmd, timestamp_type now)
 Determines how much time is remaining before the command times out. More...
 
const uint8_t * mip_pending_cmd_response (const mip_pending_cmd *cmd)
 Returns the response payload pointer. More...
 
uint8_t mip_pending_cmd_response_length (const mip_pending_cmd *cmd)
 Returns the length of the response data. More...
 
enum mip_cmd_result mip_pending_cmd_status (const mip_pending_cmd *cmd)
 Returns the status of the pending command. More...
 

Detailed Description

Typedef Documentation

◆ mip_pending_cmd

Represents a command awaiting a reply from the device.

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_pending_cmd_check_timeout()

bool mip_pending_cmd_check_timeout ( const mip_pending_cmd cmd,
timestamp_type  now 
)

Checks if the command should time out.

Parameters
cmd
nowCurrent time
Returns
true if the command should time out. Only possible for MIP_STATUS_WAITING.
false if the command should not time out.

Definition at line 170 of file mip_cmdqueue.c.

◆ mip_pending_cmd_init()

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.

Parameters
cmd
descriptor_setCommand descriptor set.
field_descriptorCommand field descriptor.

Definition at line 26 of file mip_cmdqueue.c.

◆ mip_pending_cmd_init_full()

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,
timeout_type  additional_time 
)

Initialize a pending mip commmand with all parameters.

Parameters
cmd
descriptor_setCommand descriptor set.
field_descriptorCommand field descriptor.
response_descriptorOptional response data descriptor. Use 0x00 if no data is expected.
response_bufferOptional buffer to hold response data, if any. If NULL, response_buffer_size must be 0.
response_buffer_sizeSize of the response buffer. The response will be limited to this size.
additional_timeAdditional time on top of the base reply timeout for this specific command.

Definition at line 86 of file mip_cmdqueue.c.

◆ mip_pending_cmd_init_with_response()

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.

Parameters
cmd
descriptor_setCommand descriptor set.
field_descriptorCommand field descriptor.
response_descriptorOptional response data descriptor. Use 0x00 if no data is expected.
response_bufferOptional buffer to hold response data, if any. If NULL, response_buffer_size must be 0.
response_buffer_sizeOptional buffer to hold response data, if any. If NULL, response_buffer_size must be 0.
response_buffer_sizeSize of the response buffer. The response will be limited to this size.

Definition at line 64 of file mip_cmdqueue.c.

◆ mip_pending_cmd_init_with_timeout()

void mip_pending_cmd_init_with_timeout ( mip_pending_cmd cmd,
uint8_t  descriptor_set,
uint8_t  field_descriptor,
timeout_type  additional_time 
)

Initialize a pending mip commmand with extra timeout time.

Parameters
cmd
descriptor_setCommand descriptor set.
field_descriptorCommand field descriptor.
additional_timeAdditional time on top of the base reply timeout for this specific command.

Definition at line 42 of file mip_cmdqueue.c.

◆ mip_pending_cmd_remaining_time()

int mip_pending_cmd_remaining_time ( const mip_pending_cmd cmd,
timestamp_type  now 
)

Determines how much time is remaining before the command times out.

For most cases you should instead call mip_pending_cmd_check_timeout() to know if the command has timed out or not.

Parameters
cmdThe command to check. Must be in MIP_STATUS_WAITING state.
nowThe current timestamp.
Warning
The command must be in the MIP_STATUS_WAITING state, otherwise the result is unspecified.
Returns
The time remaining before the command times out. The value will be negative if the timeout time has passed.

Definition at line 152 of file mip_cmdqueue.c.

◆ mip_pending_cmd_response()

const uint8_t* mip_pending_cmd_response ( const mip_pending_cmd cmd)

Returns the response payload pointer.

This function may only be called after the command finishes with an ACK.

Definition at line 116 of file mip_cmdqueue.c.

◆ mip_pending_cmd_response_length()

uint8_t mip_pending_cmd_response_length ( const mip_pending_cmd cmd)

Returns the length of the response data.

This function may only be called after the command finishes. If the command completed with a NACK, or if it timed out, the response length will be zero.

Definition at line 130 of file mip_cmdqueue.c.

◆ mip_pending_cmd_status()

enum mip_cmd_result mip_pending_cmd_status ( const mip_pending_cmd cmd)

Returns the status of the pending command.

See also
mip_cmd_status

Definition at line 106 of file mip_cmdqueue.c.



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