MIP_SDK
v3.0.0
MicroStrain Communications Library for embedded systems
|
Classes | |
struct | mip::C::mip_pending_cmd |
Represents a command awaiting a reply from the device. More... | |
Typedefs | |
typedef struct mip::C::mip_pending_cmd | mip::C::mip_pending_cmd |
Represents a command awaiting a reply from the device. More... | |
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... | |
typedef struct mip::C::mip_pending_cmd mip::C::mip_pending_cmd |
Represents a command awaiting a reply from the device.
bool mip::C::mip_pending_cmd_check_timeout | ( | const mip_pending_cmd * | cmd, |
mip_timestamp | now | ||
) |
Checks if the command should time out.
cmd | |
now | Current time |
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.
cmd | |
descriptor_set | Command descriptor set. |
field_descriptor | Command field descriptor. |
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.
cmd | |
descriptor_set | Command descriptor set. |
field_descriptor | Command field descriptor. |
response_descriptor | Optional response data descriptor. Use 0x00 if no data is expected. |
response_buffer | Optional buffer to hold response data, if any. If NULL, response_buffer_size must be 0. |
response_buffer_size | Size of the response buffer. The response will be limited to this size. |
additional_time | Additional time on top of the base reply timeout for this specific command. |
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.
cmd | |
descriptor_set | Command descriptor set. |
field_descriptor | Command field descriptor. |
response_descriptor | Optional response data descriptor. Use 0x00 if no data is expected. |
response_buffer | Optional buffer to hold response data, if any. If NULL, response_buffer_size must be 0. |
response_buffer_size | Size of the response buffer. The response will be limited to this size. |
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.
cmd | |
descriptor_set | Command descriptor set. |
field_descriptor | Command field descriptor. |
additional_time | Additional time on top of the base reply timeout for this specific command. |
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.
For most cases you should instead call mip_pending_cmd_check_timeout() to know if the command has timed out or not.
cmd | The command to check. Must be in MIP_STATUS_WAITING state. |
now | The current timestamp. |
const uint8_t * mip::C::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.
uint8_t mip::C::mip_pending_cmd_response_descriptor | ( | const mip_pending_cmd * | cmd | ) |
Returns the response descriptor.
uint8_t mip::C::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.
enum mip_cmd_result mip::C::mip_pending_cmd_status | ( | const mip_pending_cmd * | cmd | ) |
Returns the status of the pending command.