MIP_SDK
v3.0.0
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
25 Parser(uint8_t* buffer,
size_t bufferSize,
bool (*callback)(
void*,
const PacketView*,
Timestamp),
void* callbackObject,
Timeout timeout) {
C::mip_parser_init(
this, buffer, bufferSize, (
C::mip_packet_callback)callback, callbackObject,
timeout); }
29 template<
class T,
bool (T::*Callback)(const PacketView&, Timestamp)>
36 size_t parse(
const uint8_t* inputBuffer,
size_t inputCount,
Timestamp timestamp,
unsigned int maxPackets=0) {
return C::mip_parser_parse(
this, inputBuffer, inputCount, timestamp, maxPackets); }
66 template<
class T,
bool (T::*Callback)(const PacketView&, Timestamp)>
71 return (
static_cast<T*
>(obj)->*Callback)(
PacketView(pkt), timestamp);
102 template<
class Function>
110 if( !reader(ptr, maxCount, &count, ×tamp) )
113 assert(count <= maxCount);
Parser(uint8_t *buffer, size_t bufferSize, Timeout timeout)
Definition: mip_parser.hpp:27
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
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
void setCallback(T &object)
Initializes the MIP Parser.
Definition: mip_parser.hpp:67
Parser(uint8_t *buffer, size_t bufferSize, bool(*callback)(void *, const PacketView *, Timestamp), void *callbackObject, Timeout timeout)
Initializes the MIP parser.
Definition: mip_parser.hpp:25
bool parseMipDataFromSource(C::mip_parser &parser, Function reader, size_t maxPackets)
Read data from a source into the internal parsing buffer.
Definition: mip_parser.hpp:103
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
Structure representing a MIP Packet.
Definition: mip_packet.h:50
Parser(uint8_t *buffer, size_t bufferSize, C::mip_packet_callback callback, void *callbackObject, Timeout timeout)
Initializes the MIP parser.
Definition: mip_parser.hpp:23
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
size_t parse(const uint8_t *inputBuffer, size_t inputCount, Timestamp timestamp, unsigned int maxPackets=0)
Parses packets from the input data buffer.
Definition: mip_parser.hpp:36
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
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
microstrain::EmbeddedTimestamp Timestamp
Definition: mip_types.h:50
microstrain::EmbeddedTimeout Timeout
Definition: mip_types.h:51
void reset()
Resets the MIP parser.
Definition: mip_parser.hpp:33
Timeout timeout() const
Returns the packet timeout of the parser.
Definition: mip_parser.hpp:39
void mip_parser_set_timeout(mip_parser *parser, mip_timestamp timeout)
Changes the timeout of the MIP parser.
Definition: mip_parser.c:275
C++ class representing a view of a MIP packet.
Definition: mip_packet.hpp:35
C++ class representing a MIP parser.
Definition: mip_parser.hpp:19
void setTimeout(Timeout timeout)
Changes the timeout of the MIP parser.
Definition: mip_parser.hpp:41