MIP_SDK  latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
Classes | Namespaces | Typedefs | Functions
mip_interface.h File Reference
#include "mip_parser.h"
#include "mip_cmdqueue.h"
#include "mip_dispatch.h"
#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Classes

struct  mip::C::mip_interface
 State of the interface for communicating with a MIP device. More...
 

Namespaces

 mip
 A collection of C++ classes and functions covering the full mip api.
 
 mip::C
 

Typedefs

typedef bool(* mip::C::mip_send_callback) (struct mip_interface *device, const uint8_t *data, size_t length)
 Called from mip_interface_send_to_device() to send data to the device port. The application should forward the data to the device port (e.g. a serial port, TCP connection, etc). More...
 
typedef bool(* mip::C::mip_recv_callback) (struct mip_interface *device, mip_timeout wait_time, bool from_cmd, mip_timestamp *timestamp_out)
 Called from mip_interface_recv_from_device() to receive data from the device port. More...
 
typedef bool(* mip::C::mip_update_callback) (struct mip_interface *device, mip_timeout wait_time, bool from_cmd)
 Callback function typedef for custom update behavior. More...
 
typedef struct mip::C::mip_interface mip::C::mip_interface
 State of the interface for communicating with a MIP device. More...
 

Functions

void mip::C::mip_interface_init (mip_interface *device, mip_timeout parse_timeout, mip_timeout base_reply_timeout, mip_send_callback send, mip_recv_callback recv, mip_update_callback update, void *user_pointer)
 Initialize the mip_interface components. More...
 
bool mip::C::mip_interface_send_to_device (mip_interface *device, const uint8_t *data, size_t length)
 Sends data to the port (i.e. from this library to the physical device). More...
 
bool mip::C::mip_interface_recv_from_device (mip_interface *device, mip_timeout wait_time, bool from_cmd, mip_timestamp *timestamp_out)
 Checks for data at the port and reads it into buffer. More...
 
bool mip::C::mip_interface_update (struct mip_interface *device, mip_timeout wait_time, bool from_cmd)
 Call to process data from the device. More...
 
bool mip::C::mip_interface_default_update (struct mip_interface *device, mip_timeout wait_time, bool from_cmd)
 Polls the port for new data or command replies. More...
 
void mip::C::mip_interface_input_bytes (mip_interface *device, const uint8_t *data, size_t length, mip_timestamp timestamp)
 Passes data from the device into the parser. More...
 
void mip::C::mip_interface_input_packet (mip_interface *device, const mip_packet_view *packet, mip_timestamp timestamp)
 Processes a pre-parsed packet for command replies and data. More...
 
void mip::C::mip_interface_parse_callback (void *device, const mip_packet_view *packet, mip_timestamp timestamp)
 Wrapper around mip_interface_input_packet for use with mip_parser. More...
 
enum mip_cmd_result mip::C::mip_interface_wait_for_reply (mip_interface *device, mip_pending_cmd *cmd)
 Blocks until the pending command completes or times out. More...
 
enum mip_cmd_result mip::C::mip_interface_run_command (mip_interface *device, uint8_t descriptor_set, uint8_t cmd_descriptor, const uint8_t *cmd_data, uint8_t cmd_length)
 Runs a command using a pre-serialized payload. More...
 
enum mip_cmd_result mip::C::mip_interface_run_command_with_response (mip_interface *device, uint8_t descriptor_set, uint8_t cmd_descriptor, const uint8_t *cmd_data, uint8_t cmd_length, uint8_t response_descriptor, uint8_t *response_buffer, uint8_t *response_length_inout)
 Runs a command using a pre-serialized payload. More...
 
enum mip_cmd_result mip::C::mip_interface_run_command_packet (mip_interface *device, const mip_packet_view *packet, mip_pending_cmd *cmd)
 Similar to mip_interface_start_command_packet but waits for the command to complete. More...
 
bool mip::C::mip_interface_start_command_packet (mip_interface *device, const mip_packet_view *packet, mip_pending_cmd *cmd)
 Queues the command and sends the packet. Does not wait for completion. More...
 
void mip::C::mip_interface_register_packet_callback (mip_interface *device, mip_dispatch_handler *handler, uint8_t descriptor_set, bool after_fields, mip_dispatch_packet_callback callback, void *user_data)
 Registers a callback for packets of the specified descriptor set. More...
 
void mip::C::mip_interface_register_field_callback (mip_interface *device, mip_dispatch_handler *handler, uint8_t descriptor_set, uint8_t field_descriptor, mip_dispatch_field_callback callback, void *user_data)
 Registers a callback for packets of the specified descriptor set. More...
 
void mip::C::mip_interface_register_extractor (mip_interface *device, mip_dispatch_handler *handler, uint8_t descriptor_set, uint8_t field_descriptor, mip_dispatch_extractor extractor, void *field_ptr)
 Registers a callback for packets of the specified descriptor set. More...
 
void mip::C::mip_interface_set_recv_function (mip_interface *device, mip_recv_callback callback)
 Sets the receive callback function. More...
 
void mip::C::mip_interface_set_send_function (mip_interface *device, mip_send_callback callback)
 Sets the send callback function. More...
 
void mip::C::mip_interface_set_update_function (mip_interface *device, mip_update_callback callback)
 Sets the update function. More...
 
void mip::C::mip_interface_set_user_pointer (mip_interface *device, void *pointer)
 Sets an optional user data pointer which can be retrieved later. More...
 
mip_recv_callback mip::C::mip_interface_recv_function (const mip_interface *device)
 Gets the receive function pointer. More...
 
mip_send_callback mip::C::mip_interface_send_function (const mip_interface *device)
 Gets the send function pointer. More...
 
mip_update_callback mip::C::mip_interface_update_function (const mip_interface *device)
 Gets the update function pointer. More...
 
void * mip::C::mip_interface_user_pointer (const mip_interface *device)
 Retrieves the pointer set by mip_interface_set_user_pointer(). More...
 
mip_parser * mip::C::mip_interface_parser (mip_interface *device)
 Returns the MIP parser for the device. More...
 
mip_cmd_queue * mip::C::mip_interface_cmd_queue (mip_interface *device)
 Returns the commmand queue for the device. More...