MIP_SDK
v3.0.0
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
60 uint16_t _expected_length;
63 void* _callback_object;
65 #ifdef MIP_ENABLE_DIAGNOSTICS
66 uint32_t _diag_bytes_read;
67 uint32_t _diag_bytes_skipped;
68 uint32_t _diag_packet_bytes;
69 uint32_t _diag_valid_packets;
70 uint32_t _diag_invalid_packets;
71 uint32_t _diag_timeouts;
72 #endif // MIP_ENABLE_DIAGNOSTICS
78 #define MIPPARSER_UNLIMITED_PACKETS 0
79 #define MIPPARSER_DEFAULT_TIMEOUT_MS 100
109 #ifdef MIP_ENABLE_DIAGNOSTICS
111 uint32_t mip_parser_diagnostic_bytes_read(
const mip_parser* parser);
112 uint32_t mip_parser_diagnostic_bytes_skipped(
const mip_parser* parser);
113 uint32_t mip_parser_diagnostic_packet_bytes(
const mip_parser* parser);
115 uint32_t mip_parser_diagnostic_valid_packets(
const mip_parser* parser);
116 uint32_t mip_parser_diagnostic_invalid_packets(
const mip_parser* parser);
117 uint32_t mip_parser_diagnostic_timeouts(
const mip_parser* parser);
119 #endif // MIP_ENABLE_DIAGNOSTICS
@ MIP_PACKET_LENGTH_MAX
Definition: mip_offsets.h:28
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
void mip_parser_process_written(mip_parser *parser, size_t count, mip_timestamp timestamp, unsigned int max_packets)
Notify the parser that data has been written to the pointer previously obtained via mip_parser_get_wr...
Definition: mip_parser.c:387
bool mip_parser_parse_one_packet_from_ring(mip_parser *parser, mip_packet_view *packet_out, mip_timestamp timestamp)
Parses a single packet from the internal buffer.
Definition: mip_parser.c:188
void mip_parser_set_callback(mip_parser *parser, mip_packet_callback callback, void *callback_object)
mip_parser_set_callback
Definition: mip_parser.c:287
mip_timestamp mip_parser_timeout(const mip_parser *parser)
Returns the packet timeout of the parser.
Definition: mip_parser.c:263
size_t mip_parser_parse(mip_parser *parser, const uint8_t *input_buffer, size_t input_count, mip_timestamp timestamp, unsigned int max_packets)
Parses packets from the input data buffer.
Definition: mip_parser.c:121
void * mip_parser_callback_object(const mip_parser *parser)
mip_parser_callback
Definition: mip_parser.c:313
Structure representing a MIP Packet.
Definition: mip_packet.h:50
Definition: byte_ring.h:7
microstrain::C::microstrain_embedded_timestamp mip_timeout
Definition: mip_types.h:16
bool(* mip_packet_callback)(void *user, const mip_packet_view *packet, mip_timestamp timestamp)
Callback function which receives parsed MIP packets.
Definition: mip_parser.h:45
MIP Parser state.
Definition: mip_parser.h:55
size_t mip_parser_get_write_ptr(mip_parser *parser, uint8_t **const ptr_out)
Obtain a pointer into which data may be read for processing.
Definition: mip_parser.c:368
mip_packet_callback mip_parser_callback(const mip_parser *parser)
mip_parser_callback
Definition: mip_parser.c:300
void mip_parser_reset(mip_parser *parser)
Resets the MIP parser.
Definition: mip_parser.c:59
void mip_parser_init(mip_parser *parser, uint8_t *buffer, size_t buffer_size, mip_packet_callback callback, void *callback_object, mip_timestamp timeout)
Initializes the MIP parser.
Definition: mip_parser.c:38
mip_timeout mip_timeout_from_baudrate(uint32_t baudrate)
Computes an appropriate packet timeout for a given serial baud rate.
Definition: mip_parser.c:481
microstrain::C::microstrain_embedded_timestamp mip_timestamp
Definition: mip_types.h:15
mip_timestamp mip_parser_last_packet_timestamp(const mip_parser *parser)
Gets the timestamp of the last parsed packet.
Definition: mip_parser.c:336
void mip_parser_set_timeout(mip_parser *parser, mip_timestamp timeout)
Changes the timeout of the MIP parser.
Definition: mip_parser.c:275
struct mip::C::mip_parser mip_parser
MIP Parser state.
struct mip::C::mip_packet_view mip_packet_view
Structure representing a MIP Packet.