MIP_SDK
v3.0.0-425-g6df21bd
MicroStrain Communications Library for embedded systems
|
Functions | |
bool | mip_format_packet_bytes (char *buffer, size_t buffer_size, size_t *index, const mip_packet_view *packet) |
Format MIP packet bytes to a string. More... | |
bool | mip_format_packet (char *buffer, size_t buffer_size, size_t *index, const mip_packet_view *packet) |
Format a MIP packet to a human-readable string. More... | |
bool | mip_format_field (char *buffer, size_t buffer_size, size_t *index, const mip_field_view *field) |
Format a MIP field to a human-readable string. More... | |
void | mip_log_packet (const mip_packet_view *packet, microstrain_log_level level) |
Print a MIP packet to the microstrain logging system. More... | |
void | mip_log_field (const mip_field_view *field, microstrain_log_level level) |
Print a MIP field to the microstrain logging system. More... | |
void | mip_log_packet_verbose (const mip_packet_view *packet, microstrain_log_level level) |
Prints the details of a MIP packet to the microstrain logging system. More... | |
bool mip_format_field | ( | char * | buffer, |
size_t | buffer_size, | ||
size_t * | index, | ||
const mip_field_view * | field | ||
) |
Format a MIP field to a human-readable string.
The string will identify the field descriptor and payload bytes.
buffer | Pointer to character buffer where string data will be stored. If this is NULL, this function will only compute the required buffer size (set buffer_size = 0 in this case). | |
buffer_size | Number of characters the buffer can hold, including the NULL terminator. Must be 0 if buffer is NULL. | |
[in,out] | index | Position in buffer where string data will be written. It will be updated with the new index and will point to the new NULL terminator position. If insufficient space is available in buffer, index will still be updated even if it exceeds buffer_size. |
field | Field to be printed. There are no restrictions on the field view other than it being initialized; even a view where mip_field_is_valid returns false is allowed. |
bool mip_format_packet | ( | char * | buffer, |
size_t | buffer_size, | ||
size_t * | index, | ||
const mip_packet_view * | packet | ||
) |
Format a MIP packet to a human-readable string.
The string will identify the packet descriptor set and the field descriptor and payload for each field in the packet.
buffer | Pointer to character buffer where string data will be stored. If this is NULL, this function will only compute the required buffer size (set buffer_size = 0 in this case). | |
buffer_size | Number of characters the buffer can hold, including the NULL terminator. Must be 0 if buffer is NULL. | |
[in,out] | index | Position in buffer where string data will be written. It will be updated with the new index and will point to the new NULL terminator position. If insufficient space is available in buffer, index will still be updated even if it exceeds buffer_size. |
packet | Packet to be printed. There are no restrictions on the packet view other than it being initialized; even a view where mip_packet_is_sane returns false is allowed. |
bool mip_format_packet_bytes | ( | char * | buffer, |
size_t | buffer_size, | ||
size_t * | index, | ||
const mip_packet_view * | packet | ||
) |
Format MIP packet bytes to a string.
The bytes will be grouped by header, field, and checksum. For example, a reset comm speed command would print like this: 75650104 04090501 f2bb
buffer | Pointer to character buffer where string data will be stored. If this is NULL, this function will only compute the required buffer size (set buffer_size = 0 in this case). | |
buffer_size | Number of characters the buffer can hold, including the NULL terminator. Must be 0 if buffer is NULL. | |
[in,out] | index | Position in buffer where string data will be written. It will be updated with the new index and will point to the new NULL terminator position. If insufficient space is available in buffer, index will still be updated even if it exceeds buffer_size. |
packet | Packet to be printed. There are no restrictions on the packet view other than it being initialized; even a view where mip_packet_is_sane returns false is allowed. |
void mip_log_field | ( | const mip_field_view * | field, |
microstrain_log_level | level | ||
) |
Print a MIP field to the microstrain logging system.
field | Field to be printed. There are no restrictions on the field view other than it being initialized; even a view where mip_field_is_valid returns false is allowed. |
level | Logging level passed to the microstrain log callback. If the current log level is less than this value, nothing is printed. |
void mip_log_packet | ( | const mip_packet_view * | packet, |
microstrain_log_level | level | ||
) |
Print a MIP packet to the microstrain logging system.
packet | Packet to be printed. There are no restrictions on the packet view other than it being initialized; even a view where mip_packet_is_sane returns false is allowed. |
level | Logging level passed to the microstrain log callback. If the current log level is less than this value, nothing is printed. |
void mip_log_packet_verbose | ( | const mip_packet_view * | packet, |
microstrain_log_level | level | ||
) |
Prints the details of a MIP packet to the microstrain logging system.
packet | Packet to be printed. There are no restrictions on the packet view other than it being initialized; even a view where mip_packet_is_sane returns false is allowed. |
level | Logging level passed to the microstrain log callback. If the current log level is less than this value, nothing is printed. |