MIP_SDK  v3.0.0
MicroStrain Communications Library for embedded systems
Modules | Typedefs | Enumerations | Functions
MIP C API

This module contains functions and classes for communicating with a MIP device in C. More...

Modules

 Mip Commands
 Contains all MIP command definitions.
 
 Mip Data
 Contains all MIP data definitions.
 
 Mip Command Handling
 Functions for processing command responses.
 
 Data Dispatch
 System for issuing callbacks from MIP packets or fields.
 
 Mip Fields
 Functions for processing received MIP fields.
 
 Mip Interface
 High-level C functions for controlling a MIP device.
 
 Mip Packet
 Functions for building and processing MIP packets.
 
 Mip Parser
 Functions for parsing MIP packets.
 

Typedefs

typedef enum mip::C::mip_cmd_result mip::C::mip_cmd_result
 Represents the status of a MIP command. More...
 

Enumerations

enum  mip::C::mip_cmd_result {
  mip::C::MIP_STATUS_USER_START = -10, mip::C::MIP_STATUS_ERROR = -6, mip::C::MIP_STATUS_CANCELLED = -5, mip::C::MIP_STATUS_TIMEDOUT = -4,
  mip::C::MIP_STATUS_WAITING = -3, mip::C::MIP_STATUS_PENDING = -2, mip::C::MIP_STATUS_NONE = -1, mip::C::MIP_ACK_OK = 0x00,
  mip::C::MIP_NACK_COMMAND_UNKNOWN = 0x01, mip::C::MIP_NACK_INVALID_CHECKSUM = 0x02, mip::C::MIP_NACK_INVALID_PARAM = 0x03, mip::C::MIP_NACK_COMMAND_FAILED = 0x04,
  mip::C::MIP_NACK_COMMAND_TIMEOUT = 0x05
}
 Represents the status of a MIP command. More...
 

Functions

bool mip::mip_is_valid_descriptor_set (uint8_t descriptor_set)
 Determines if the descriptor set is valid. More...
 
bool mip::mip_is_data_descriptor_set (uint8_t descriptor_set)
 Determines if the descriptor set represents some kind of data. More...
 
bool mip::mip_is_cmd_descriptor_set (uint8_t descriptor_set)
 Determines if the descriptor set contains commands. More...
 
bool mip::mip_is_reserved_descriptor_set (uint8_t descriptor_set)
 Determines if the descriptor is reserved for special purposes. More...
 
bool mip::mip_is_gnss_data_descriptor_set (uint8_t descriptor_set)
 Determines if the descriptor set represents some kind of GNSS data. More...
 
bool mip::mip_is_valid_field_descriptor (uint8_t field_descriptor)
 Determines if the field descriptor is valid. More...
 
bool mip::mip_is_cmd_field_descriptor (uint8_t field_descriptor)
 Determines if the field descriptor is a command. More...
 
bool mip::mip_is_reply_field_descriptor (uint8_t field_descriptor)
 Determines if the field descriptor is for an ack/nack reply. More...
 
bool mip::mip_is_response_field_descriptor (uint8_t field_descriptor)
 Determines if the field descriptor contains response data from a command. More...
 
bool mip::mip_is_reserved_cmd_field_descriptor (uint8_t field_descriptor)
 Determines if the field descriptor is reserved. More...
 
bool mip::mip_is_shared_data_field_descriptor (uint8_t field_descriptor)
 Determines if the field descriptor is from the shared data set. More...
 
void mip::insert_mip_function_selector (microstrain_serializer *serializer, enum mip_function_selector self)
 
void mip::extract_mip_function_selector (microstrain_serializer *serializer, enum mip_function_selector *self)
 
const char * mip::C::mip_cmd_result_to_string (enum mip_cmd_result result)
 Converts the command result to a string for debugging. More...
 
bool mip::C::mip_cmd_result_is_finished (enum mip_cmd_result status)
 Determines if the command has completed, timed out, been cancelled, or otherwise is no longer waiting for a response. More...
 
bool mip::C::mip_cmd_result_is_reply (enum mip_cmd_result result)
 Determines if the result is a reply from the device (i.e. mip_ack). More...
 
bool mip::C::mip_cmd_result_is_status (enum mip_cmd_result result)
 Determines if the result code was generated by this lib (i.e. mip_cmd_status). More...
 
bool mip::C::mip_cmd_result_is_user (enum mip_cmd_result result)
 Determines if the result code was generated by user software. More...
 
bool mip::C::mip_cmd_result_is_ack (enum mip_cmd_result result)
 Determines if the result is an ack (successful response from the device) More...
 

Detailed Description

This module contains functions and classes for communicating with a MIP device in C.

This module contains all of the C submodules.

Typedef Documentation

◆ mip_cmd_result

Represents the status of a MIP command.

Values that start with MIP_STATUS are status codes from this library. Values that start with MIP_(N)ACK represent replies from the device. Values at or below MIP_STATUS_USER_START (negative values) are reserved for status codes from user code.

See Mip Command Results

Enumeration Type Documentation

◆ mip_cmd_result

Represents the status of a MIP command.

Values that start with MIP_STATUS are status codes from this library. Values that start with MIP_(N)ACK represent replies from the device. Values at or below MIP_STATUS_USER_START (negative values) are reserved for status codes from user code.

See Mip Command Results

Enumerator
MIP_STATUS_USER_START 

Values defined by user code must be less than or equal to this value.

MIP_STATUS_ERROR 

Command could not be executed (error sending/receiving)

MIP_STATUS_CANCELLED 

Command was canceled in software.

MIP_STATUS_TIMEDOUT 

Reply was not received before timeout expired.

MIP_STATUS_WAITING 

Waiting for command reply (timeout timer has started).

MIP_STATUS_PENDING 

Command has been queued but the I/O update hasn't run yet.

MIP_STATUS_NONE 

Command has been initialized but not queued yet.

MIP_ACK_OK 

Command completed successfully.

MIP_NACK_COMMAND_UNKNOWN 

Command not supported.

MIP_NACK_INVALID_CHECKSUM 

Reserved.

MIP_NACK_INVALID_PARAM 

A parameter was not a supported value.

MIP_NACK_COMMAND_FAILED 

The device could not complete the command.

MIP_NACK_COMMAND_TIMEOUT 

Internal device timeout. Use MIP_STATUS_TIMEDOUT for command timeouts.

Function Documentation

◆ extract_mip_function_selector()

void mip::extract_mip_function_selector ( microstrain_serializer *  serializer,
enum mip_function_selector *  self 
)

◆ insert_mip_function_selector()

void mip::insert_mip_function_selector ( microstrain_serializer *  serializer,
enum mip_function_selector  self 
)

◆ mip_cmd_result_is_ack()

bool mip::C::mip_cmd_result_is_ack ( enum mip_cmd_result  result)

Determines if the result is an ack (successful response from the device)

◆ mip_cmd_result_is_finished()

bool mip::C::mip_cmd_result_is_finished ( enum mip_cmd_result  status)

Determines if the command has completed, timed out, been cancelled, or otherwise is no longer waiting for a response.

◆ mip_cmd_result_is_reply()

bool mip::C::mip_cmd_result_is_reply ( enum mip_cmd_result  result)

Determines if the result is a reply from the device (i.e. mip_ack).

◆ mip_cmd_result_is_status()

bool mip::C::mip_cmd_result_is_status ( enum mip_cmd_result  result)

Determines if the result code was generated by this lib (i.e. mip_cmd_status).

◆ mip_cmd_result_is_user()

bool mip::C::mip_cmd_result_is_user ( enum mip_cmd_result  result)

Determines if the result code was generated by user software.

◆ mip_cmd_result_to_string()

const char * mip::C::mip_cmd_result_to_string ( enum mip_cmd_result  result)

Converts the command result to a string for debugging.

Parameters
resultAny value.
Returns
A constant string.

◆ mip_is_cmd_descriptor_set()

bool mip::mip_is_cmd_descriptor_set ( uint8_t  descriptor_set)

Determines if the descriptor set contains commands.

Parameters
descriptor_set
Returns
true if the descriptor set contains commands.

◆ mip_is_cmd_field_descriptor()

bool mip::mip_is_cmd_field_descriptor ( uint8_t  field_descriptor)

Determines if the field descriptor is a command.

Parameters
field_descriptor
Returns
true if the field descriptor represents a command.

◆ mip_is_data_descriptor_set()

bool mip::mip_is_data_descriptor_set ( uint8_t  descriptor_set)

Determines if the descriptor set represents some kind of data.

Parameters
descriptor_set
Returns
true if the descriptor set represents data.

◆ mip_is_gnss_data_descriptor_set()

bool mip::mip_is_gnss_data_descriptor_set ( uint8_t  descriptor_set)

Determines if the descriptor set represents some kind of GNSS data.

Parameters
descriptor_set
Returns
true if the descriptor set represents GNSS data.

◆ mip_is_reply_field_descriptor()

bool mip::mip_is_reply_field_descriptor ( uint8_t  field_descriptor)

Determines if the field descriptor is for an ack/nack reply.

Parameters
field_descriptor
Returns
true if the field descriptor represents an ack/nack reply code.

◆ mip_is_reserved_cmd_field_descriptor()

bool mip::mip_is_reserved_cmd_field_descriptor ( uint8_t  field_descriptor)

Determines if the field descriptor is reserved.

The descriptor set is assumed to be a command set.

Parameters
field_descriptor
Returns
true if the associated field is neither a command nor response.

◆ mip_is_reserved_descriptor_set()

bool mip::mip_is_reserved_descriptor_set ( uint8_t  descriptor_set)

Determines if the descriptor is reserved for special purposes.

Parameters
descriptor_set
Returns
true if the descriptor set is reserved.

◆ mip_is_response_field_descriptor()

bool mip::mip_is_response_field_descriptor ( uint8_t  field_descriptor)

Determines if the field descriptor contains response data from a command.

The descriptor set is assumed to be a command set.

Parameters
field_descriptor
Returns
true if the associated field contains response data.

◆ mip_is_shared_data_field_descriptor()

bool mip::mip_is_shared_data_field_descriptor ( uint8_t  field_descriptor)

Determines if the field descriptor is from the shared data set.

The descriptor set is assumed to be a data set.

Parameters
field_descriptor
Returns
true if the associated field is from the shared data set.

◆ mip_is_valid_descriptor_set()

bool mip::mip_is_valid_descriptor_set ( uint8_t  descriptor_set)

Determines if the descriptor set is valid.

Parameters
descriptor_set
Returns
true if the descriptor set is valid.

◆ mip_is_valid_field_descriptor()

bool mip::mip_is_valid_field_descriptor ( uint8_t  field_descriptor)

Determines if the field descriptor is valid.

Parameters
field_descriptor
Returns
true if the field descriptor is valid.