MIP SDK  0.0.1
MicroStrain Communications Library for embedded systems
Classes | Macros | Typedefs | Functions
mip_parser [C]

Functions for parsing MIP packets. More...

Collaboration diagram for mip_parser [C]:

Classes

struct  mip::C::mip_parser
 MIP Parser state. More...
 

Macros

#define MIPPARSER_UNLIMITED_PACKETS   0
 Specifies no limit when used as the max_packets argument to mip_parser_parse. More...
 
#define MIPPARSER_DEFAULT_TIMEOUT_MS   100
 Specifies the default timeout for a MIP parser, assuming timestamps are in milliseconds. More...
 

Typedefs

typedef bool(* mip::C::mip_packet_callback) (void *user, const mip_packet *packet, timestamp_type timestamp)
 Callback function which receives parsed MIP packets. More...
 
typedef struct mip::C::mip_parser mip::C::mip_parser
 MIP Parser state. More...
 

Functions

void mip::C::mip_parser_init (mip_parser *parser, uint8_t *buffer, size_t buffer_size, mip_packet_callback callback, void *callback_object, timestamp_type timeout)
 
bool mip::C::mip_parser_parse_one_packet_from_ring (mip_parser *parser, mip_packet *packet_out, timestamp_type timestamp)
 
remaining_count mip::C::mip_parser_parse (mip_parser *parser, const uint8_t *input_buffer, size_t input_count, timestamp_type timestamp, unsigned int max_packets)
 
void mip::C::mip_parser_reset (mip_parser *parser)
 
size_t mip::C::mip_parser_get_write_ptr (mip_parser *parser, uint8_t **ptr_out)
 
void mip::C::mip_parser_process_written (mip_parser *parser, size_t count, timestamp_type timestamp, unsigned int max_packets)
 
timeout_type mip::C::mip_parser_timeout (const mip_parser *parser)
 
void mip::C::mip_parser_set_timeout (mip_parser *parser, timeout_type timeout)
 
void mip::C::mip_parser_set_callback (mip_parser *parser, mip_packet_callback callback, void *callback_object)
 
mip_packet_callback mip::C::mip_parser_callback (const mip_parser *parser)
 
void * mip::C::mip_parser_callback_object (const mip_parser *parser)
 
timestamp_type mip::C::mip_parser_last_packet_timestamp (const mip_parser *parser)
 
timeout_type mip::C::mip_timeout_from_baudrate (uint32_t baudrate)
 

Detailed Description

Functions for parsing MIP packets.

See Mip Parser

Typical usage:

Macro Definition Documentation

◆ MIPPARSER_DEFAULT_TIMEOUT_MS

#define MIPPARSER_DEFAULT_TIMEOUT_MS   100

Specifies the default timeout for a MIP parser, assuming timestamps are in milliseconds.

◆ MIPPARSER_UNLIMITED_PACKETS

#define MIPPARSER_UNLIMITED_PACKETS   0

Specifies no limit when used as the max_packets argument to mip_parser_parse.

Typedef Documentation

◆ mip_packet_callback

typedef bool(* mip::C::mip_packet_callback) (void *user, const mip_packet *packet, timestamp_type timestamp)

Callback function which receives parsed MIP packets.

Parameters
userA user-specified pointer which will be given the callback_object parameter which was previously passed to mip_parser_init.
PacketA pointer to the MIP packet. Do not store this pointer as it will be invalidated after the callback returns.
timestampThe approximate time the packet was parsed.

◆ mip_parser

MIP Parser state.

Note
This should be considered an "opaque" structure; its members should be considered an internal implementation detail. Avoid accessing them directly as they are subject to change in future versions of this software.

Function Documentation

◆ mip_parser_callback()

mip_packet_callback mip::C::mip_parser_callback ( const mip_parser parser)

◆ mip_parser_callback_object()

void* mip::C::mip_parser_callback_object ( const mip_parser parser)

◆ mip_parser_get_write_ptr()

size_t mip::C::mip_parser_get_write_ptr ( mip_parser parser,
uint8_t **  ptr_out 
)

◆ mip_parser_init()

void mip::C::mip_parser_init ( mip_parser parser,
uint8_t *  buffer,
size_t  buffer_size,
mip_packet_callback  callback,
void *  callback_object,
timestamp_type  timeout 
)

◆ mip_parser_last_packet_timestamp()

timestamp_type mip::C::mip_parser_last_packet_timestamp ( const mip_parser parser)

◆ mip_parser_parse()

remaining_count mip::C::mip_parser_parse ( mip_parser parser,
const uint8_t *  input_buffer,
size_t  input_count,
timestamp_type  timestamp,
unsigned int  max_packets 
)

◆ mip_parser_parse_one_packet_from_ring()

bool mip::C::mip_parser_parse_one_packet_from_ring ( mip_parser parser,
mip_packet packet_out,
timestamp_type  timestamp 
)

◆ mip_parser_process_written()

void mip::C::mip_parser_process_written ( mip_parser parser,
size_t  count,
timestamp_type  timestamp,
unsigned int  max_packets 
)

◆ mip_parser_reset()

void mip::C::mip_parser_reset ( mip_parser parser)

◆ mip_parser_set_callback()

void mip::C::mip_parser_set_callback ( mip_parser parser,
mip_packet_callback  callback,
void *  callback_object 
)

◆ mip_parser_set_timeout()

void mip::C::mip_parser_set_timeout ( mip_parser parser,
timeout_type  timeout 
)

◆ mip_parser_timeout()

timeout_type mip::C::mip_parser_timeout ( const mip_parser parser)

◆ mip_timeout_from_baudrate()

timeout_type mip::C::mip_timeout_from_baudrate ( uint32_t  baudrate)