MIP_SDK
latest-2-g34f3e39
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(struct mip_interface *device, mip_timeout wait_time, bool from_cmd)
Polls the port for new data or command replies.
Definition: mip_interface.c:398
void mip_interface_set_update_function(mip_interface *device, mip_update_callback callback)
Sets the update function.
Definition: mip_interface.c:245
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_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:603
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:547
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 for use with mip_parser.
Definition: mip_interface.c:453
bool 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.
Definition: mip_interface.c:342
Holds a list of pending commands.
Definition: mip_cmdqueue.h:88
bool mip_interface_update(struct mip_interface *device, mip_timeout wait_time, bool from_cmd)
Call to process data from the device.
Definition: mip_interface.c:372
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
bool(* 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.
Definition: mip_interface.h:37
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
MIP Parser state.
Definition: mip_parser.h:53
void 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.
Definition: mip_interface.c:425
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:582
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:518
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_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:474
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:653
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:675
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:630
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
void 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.
Definition: mip_interface.c:440