MIP_SDK
latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
59 void* _callback_object;
61 #ifdef MIP_ENABLE_DIAGNOSTICS
62 uint32_t _diag_bytes_read;
63 uint32_t _diag_bytes_skipped;
64 uint32_t _diag_packet_bytes;
65 uint32_t _diag_valid_packets;
66 uint32_t _diag_invalid_packets;
67 uint32_t _diag_timeouts;
68 #endif // MIP_ENABLE_DIAGNOSTICS
70 uint16_t _buffered_length;
77 #define MIP_PARSER_DEFAULT_TIMEOUT_MS 100
106 #ifdef MIP_ENABLE_DIAGNOSTICS
108 uint32_t mip_parser_diagnostic_bytes_read(
const mip_parser* parser);
109 uint32_t mip_parser_diagnostic_bytes_skipped(
const mip_parser* parser);
110 uint32_t mip_parser_diagnostic_packet_bytes(
const mip_parser* parser);
112 uint32_t mip_parser_diagnostic_valid_packets(
const mip_parser* parser);
113 uint32_t mip_parser_diagnostic_invalid_packets(
const mip_parser* parser);
114 uint32_t mip_parser_diagnostic_timeouts(
const mip_parser* parser);
116 #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_set_callback(mip_parser *parser, mip_packet_callback callback, void *callback_object)
mip_parser_set_callback
Definition: mip_parser.c:440
mip_timeout mip_parser_timeout(const mip_parser *parser)
Returns the packet timeout of the parser.
Definition: mip_parser.c:416
void * mip_parser_callback_object(const mip_parser *parser)
mip_parser_callback
Definition: mip_parser.c:466
void mip_parser_set_timeout(mip_parser *parser, mip_timeout timeout)
Changes the timeout of the MIP parser.
Definition: mip_parser.c:428
mip_timestamp mip_parser_current_timestamp(const mip_parser *parser)
Gets the timestamp of the last parsed packet.
Definition: mip_parser.c:489
void mip_parser_parse(mip_parser *parser, const uint8_t *input_buffer, size_t input_length, mip_timestamp timestamp)
Parse packets from a buffer.
Definition: mip_parser.c:183
Structure representing a MIP Packet.
Definition: mip_packet.h:50
microstrain::C::microstrain_embedded_timestamp mip_timeout
Definition: mip_types.h:16
void mip_parser_flush(mip_parser *parser)
Processes all previously buffered data.
Definition: mip_parser.c:370
MIP Parser state.
Definition: mip_parser.h:53
mip_packet_callback mip_parser_callback(const mip_parser *parser)
mip_parser_callback
Definition: mip_parser.c:453
void mip_parser_init(mip_parser *parser, mip_packet_callback callback, void *callback_object, mip_timeout timeout)
Initializes the MIP parser.
Definition: mip_parser.c:32
uint_least16_t mip_parser_get_write_ptr(mip_parser *parser, uint8_t **ptr_out)
Gets a pointer into which a small amount of data may be written for parsing.
Definition: mip_parser.c:403
void mip_parser_reset(mip_parser *parser)
Resets the MIP parser.
Definition: mip_parser.c:51
mip_timeout mip_timeout_from_baudrate(uint32_t baudrate)
Computes an appropriate packet timeout for a given serial baud rate.
Definition: mip_parser.c:580
microstrain::C::microstrain_embedded_timestamp mip_timestamp
Definition: mip_types.h:15
struct mip::C::mip_parser mip_parser
MIP Parser state.
void(* mip_packet_callback)(void *user, const mip_packet_view *packet, mip_timestamp timestamp)
Callback function which receives parsed MIP packets.
Definition: mip_parser.h:43