Enumerations | Functions
mip_dispatch.c File Reference
#include "mip_dispatch.h"
#include "mip_packet.h"
#include "mip_field.h"
#include <assert.h>
Include dependency graph for mip_dispatch.c:

Go to the source code of this file.

Enumerations

enum  mip_dispatch_type { MIP_DISPATCH_TYPE_PACKET_PRE = 1, MIP_DISPATCH_TYPE_PACKET_POST = 2, MIP_DISPATCH_TYPE_FIELD = 3, MIP_DISPATCH_TYPE_EXTRACT = 4 }
 Type of dispatch callback. More...
 

Functions

void mip_dispatch_handler_init_extractor (mip_dispatch_handler *handler, uint8_t descriptor_set, uint8_t field_descriptor, mip_dispatch_extractor extractor, void *field_ptr)
 Initialize the dispatch handler with an extraction callback. More...
 
void mip_dispatch_handler_init_field_handler (mip_dispatch_handler *handler, uint8_t descriptor_set, uint8_t field_descriptor, mip_dispatch_field_callback callback, void *user_data)
 Initialize the dispatch handler with a field callback. More...
 
void mip_dispatch_handler_init_packet_handler (mip_dispatch_handler *handler, uint8_t descriptor_set, bool post_callback, mip_dispatch_packet_callback callback, void *user_data)
 Initialize the dispatch handler with a packet callback. More...
 
bool mip_dispatch_handler_is_enabled (mip_dispatch_handler *handler)
 Determines if the handler is currently enabled. More...
 
void mip_dispatch_handler_set_enabled (mip_dispatch_handler *handler, bool enable)
 Enables or disables the handler. More...
 
static bool mip_dispatch_is_descriptor_match (uint8_t desc_set, uint8_t field_desc, uint8_t handler_desc_set, uint8_t handler_field_desc)
 Determines if the field matches the dispatcher. More...
 
static bool mip_dispatch_is_descriptor_set_match (uint8_t desc_set, uint8_t handler_desc_set)
 
void mip_dispatcher_add_handler (mip_dispatcher *self, mip_dispatch_handler *handler)
 Registers a handler in the dispatch system. More...
 
static void mip_dispatcher_call_field_callbacks (mip_dispatcher *self, const mip_field *field, mip_timestamp timestamp)
 Called to dispatch packet callback before and after field iteration. More...
 
static void mip_dispatcher_call_packet_callbacks (mip_dispatcher *self, const mip_packet *packet, mip_timestamp timestamp, bool post)
 Called to dispatch packet callback before and after field iteration. More...
 
void mip_dispatcher_dispatch_packet (mip_dispatcher *self, const mip_packet *packet, mip_timestamp timestamp)
 Called to dispatch the callbacks for a given packet. More...
 
void mip_dispatcher_init (mip_dispatcher *self)
 Initializes the mip_dispatcher object. More...
 
void mip_dispatcher_remove_all_handlers (mip_dispatcher *self)
 Removes all handlers from the dispatcher. More...
 
void mip_dispatcher_remove_handler (mip_dispatcher *self, mip_dispatch_handler *handler)
 Removes a handler from the dispatch system. More...
 

Enumeration Type Documentation

◆ mip_dispatch_type

Type of dispatch callback.

Enumerator
MIP_DISPATCH_TYPE_PACKET_PRE 

Packet callback, before field callbacks. Use handler._packet_callback.

MIP_DISPATCH_TYPE_PACKET_POST 

Packet callback, after field callbacks. Use handler._packet_callback.

MIP_DISPATCH_TYPE_FIELD 

Field callback. Use handler._field_callback.

MIP_DISPATCH_TYPE_EXTRACT 

Extraction callback. Use handler._extract_callback.

Definition at line 20 of file mip_dispatch.c.

Function Documentation

◆ mip_dispatch_is_descriptor_match()

static bool mip_dispatch_is_descriptor_match ( uint8_t  desc_set,
uint8_t  field_desc,
uint8_t  handler_desc_set,
uint8_t  handler_field_desc 
)
static

Determines if the field matches the dispatcher.

Parameters
desc_setPacket descriptor set.
field_descField descriptor.
handler_desc_setHandler descriptor set filter.
handler_field_descHandler field descriptor filter.
Returns
true if the field matches.

Definition at line 299 of file mip_dispatch.c.

◆ mip_dispatch_is_descriptor_set_match()

static bool mip_dispatch_is_descriptor_set_match ( uint8_t  desc_set,
uint8_t  handler_desc_set 
)
static

Definition at line 252 of file mip_dispatch.c.

◆ mip_dispatcher_call_field_callbacks()

static void mip_dispatcher_call_field_callbacks ( mip_dispatcher self,
const mip_field field,
mip_timestamp  timestamp 
)
static

Called to dispatch packet callback before and after field iteration.

Definition at line 315 of file mip_dispatch.c.

◆ mip_dispatcher_call_packet_callbacks()

static void mip_dispatcher_call_packet_callbacks ( mip_dispatcher self,
const mip_packet packet,
mip_timestamp  timestamp,
bool  post 
)
static

Called to dispatch packet callback before and after field iteration.

Definition at line 270 of file mip_dispatch.c.



microstrain_inertial_driver
Author(s): Brian Bingham, Parker Hannifin Corp
autogenerated on Mon Jun 24 2024 02:51:40