MIP_SDK
v3.0.0-187-g93c7302
MicroStrain Communications Library for embedded systems
|
void(* mip_dispatch_field_callback)(void *context, const mip_field_view *field, mip_timestamp timestamp)
Signature for field-level callbacks.
Definition: mip_dispatch.h:54
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
void * mip_interface_user_pointer(const mip_interface *device)
Retrieves the pointer set by mip_interface_set_user_pointer().
Definition: mip_interface.c:281
bool mip_interface_default_update(mip_interface *device, mip_timeout wait_time, bool from_cmd)
Polls the port for new data or command replies.
Definition: mip_interface.c:404
void mip_interface_set_update_function(mip_interface *device, mip_update_callback callback)
Sets the update function.
Definition: mip_interface.c:245
bool mip_interface_update(mip_interface *device, mip_timeout wait_time, bool from_cmd)
Call to process data from the device.
Definition: mip_interface.c:372
mip_cmd_result
Represents the status of a MIP command.
Definition: mip_result.h:27
mip_send_callback mip_interface_send_function(const mip_interface *device)
Gets the send function pointer.
Definition: mip_interface.c:197
bool mip_interface_recv_from_device(mip_interface *device, uint8_t *buffer, size_t max_length, mip_timeout wait_time, bool from_cmd, size_t *length_out, mip_timestamp *timestamp_out)
Checks for data at the port and reads it into buffer.
Definition: mip_interface.c:342
void mip_interface_input_bytes_from_device(mip_interface *device, const uint8_t *data, size_t length, mip_timestamp timestamp)
Passes data from the device into the parser.
Definition: mip_interface.c:495
bool 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.
Definition: mip_interface.c:690
enum mip_cmd_result 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.
Definition: mip_interface.c:634
void mip_interface_update_time(mip_interface *device, mip_timestamp timestamp)
Call this to ensure that pending commands time out properly.
Definition: mip_interface.c:528
struct mip::C::mip_interface mip_interface
State of the interface for communicating with a MIP device.
void mip_interface_parse_callback(void *device, const mip_packet_view *packet, mip_timestamp timestamp)
Wrapper around mip_interface_input_packet_from_device for use with mip_parser.
Definition: mip_interface.c:540
Holds a list of pending commands.
Definition: mip_cmdqueue.h:88
mip_update_callback mip_interface_update_function(const mip_interface *device)
Gets the update function pointer.
Definition: mip_interface.c:257
Structure representing a MIP Packet.
Definition: mip_packet.h:50
Holds the state of the MIP dispatch system.
Definition: mip_dispatch.h:130
void mip_interface_input_bytes_andor_time(mip_interface *device, const uint8_t *received_data, size_t data_length, mip_timestamp now)
This function takes care of processing received data and updating the current time.
Definition: mip_interface.c:473
microstrain::C::microstrain_embedded_timestamp mip_timeout
Definition: mip_types.h:16
void(* mip_dispatch_packet_callback)(void *context, const mip_packet_view *packet, mip_timestamp timestamp)
Signature for packet-level callbacks.
Definition: mip_dispatch.h:45
bool mip_interface_default_update_ext_buffer(mip_interface *device, mip_timeout wait_time, bool from_cmd, uint8_t *buffer, size_t buffer_size)
Polls the port for new data or command replies using a supplied buffer.
Definition: mip_interface.c:446
MIP Parser state.
Definition: mip_parser.h:53
void 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.
Definition: mip_interface.c:150
enum mip_cmd_result 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.
Definition: mip_interface.c:669
bool(* mip_recv_callback)(struct mip_interface *device, uint8_t *buffer, size_t max_length, mip_timeout wait_time, bool from_cmd, size_t *length_out, mip_timestamp *timestamp_out)
Called from mip_interface_recv_from_device() to receive data from the device port.
Definition: mip_interface.h:37
State of the interface for communicating with a MIP device.
Definition: mip_interface.h:44
bool 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).
Definition: mip_interface.c:323
void mip_interface_set_send_function(mip_interface *device, mip_send_callback callback)
Sets the send callback function.
Definition: mip_interface.c:185
mip_parser * mip_interface_parser(mip_interface *device)
Returns the MIP parser for the device.
Definition: mip_interface.c:289
Represents a command awaiting a reply from the device.
Definition: mip_cmdqueue.h:37
enum mip_cmd_result 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.
Definition: mip_interface.c:605
mip_cmd_queue * mip_interface_cmd_queue(mip_interface *device)
Returns the commmand queue for the device.
Definition: mip_interface.c:297
void mip_interface_input_packet_from_device(mip_interface *device, const mip_packet_view *packet, mip_timestamp timestamp)
Processes a pre-parsed packet for command replies and data.
Definition: mip_interface.c:510
void mip_interface_set_recv_function(mip_interface *device, mip_recv_callback callback)
Sets the receive callback function.
Definition: mip_interface.c:212
enum mip_cmd_result mip_interface_wait_for_reply(mip_interface *device, mip_pending_cmd *cmd)
Blocks until the pending command completes or times out.
Definition: mip_interface.c:561
mip_recv_callback mip_interface_recv_function(const mip_interface *device)
Gets the receive function pointer.
Definition: mip_interface.c:224
Handler information for MIP Packet or Field callbacks.
Definition: mip_dispatch.h:94
microstrain::C::microstrain_embedded_timestamp mip_timestamp
Definition: mip_types.h:15
bool(* mip_dispatch_extractor)(const mip_field_view *field, void *ptr)
Signature for extraction callbacks.
Definition: mip_dispatch.h:62
bool(* 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 fo...
Definition: mip_interface.h:36
bool(* mip_update_callback)(struct mip_interface *device, mip_timeout wait_time, bool from_cmd)
Callback function typedef for custom update behavior.
Definition: mip_interface.h:38
void 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.
Definition: mip_interface.c:740
void 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.
Definition: mip_interface.c:762
void 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.
Definition: mip_interface.c:717
void mip_interface_set_user_pointer(mip_interface *device, void *pointer)
Sets an optional user data pointer which can be retrieved later.
Definition: mip_interface.c:269