mip_dispatch_extractor _extract_callback
User callback for data fields. Valid if _type is MIP_DISPATCH_TYPE_EXTRACT.
void mip_dispatch_handler_init_packet_handler(mip_dispatch_handler *handler, uint8_t descriptor_set, bool after_fields, mip_dispatch_packet_callback callback, void *context)
Initialize the dispatch handler with a packet callback.
void(* mip_dispatch_packet_callback)(void *context, const mip_packet *packet, mip_timestamp timestamp)
Signature for packet-level callbacks.
void * _user_data
User-provided pointer which is passed directly to the callback.
struct mip_dispatch_handler mip_dispatch_handler
Handler information for MIP Packet or Field callbacks.
uint8_t _field_descriptor
MIP field descriptor for this callback. If 0x00, the callback is a packet callback.
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 *context)
Initialize the dispatch handler with a field callback.
void mip_dispatcher_dispatch_packet(mip_dispatcher *self, const mip_packet *packet, mip_timestamp timestamp)
Called to dispatch the callbacks for a given packet.
bool(* mip_dispatch_extractor)(const mip_field *field, void *ptr)
Signature for extraction callbacks.
@ MIP_DISPATCH_ANY_DATA_SET
Wildcard descriptor set which only includes data packets.
mip_dispatch_packet_callback _packet_callback
User function for packets. Valid if type is MIP_DISPATCH_TYPE_PACKET*.
@ MIP_DISPATCH_ANY_DESCRIPTOR
Any descriptor set or field descriptor.
mip_dispatch_field_callback _field_callback
User callback for data fields. Valid if _type is MIP_DISPATCH_TYPE_FIELD.
void mip_dispatcher_add_handler(mip_dispatcher *self, mip_dispatch_handler *handler)
Registers a handler in the dispatch system.
void mip_dispatcher_remove_handler(mip_dispatcher *self, mip_dispatch_handler *handler)
Removes a handler from the dispatch system.
mip_dispatch_handler * _first_handler
Pointer to the first dispatch handler. May be NULL.
uint8_t _descriptor_set
MIP descriptor set for this callback.
bool mip_dispatch_handler_is_enabled(mip_dispatch_handler *handler)
Determines if the handler is currently enabled.
A structure representing a MIP field.
struct mip_dispatcher mip_dispatcher
Holds the state of the MIP dispatch system.
uint64_t mip_timestamp
Type used for packet timestamps and timeouts.
struct mip_dispatch_handler * _next
Pointer to the next handler in the list.
void mip_dispatch_handler_set_enabled(mip_dispatch_handler *handler, bool enable)
Enables or disables the handler.
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.
Handler information for MIP Packet or Field callbacks.
uint8_t _enabled
If false, the handler will be ignored. (Using u8 for better struct packing.)
void mip_dispatcher_remove_all_handlers(mip_dispatcher *self)
Removes all handlers from the dispatcher.
Structure representing a MIP Packet.
void(* mip_dispatch_field_callback)(void *context, const mip_field *field, mip_timestamp timestamp)
Signature for field-level callbacks.
void mip_dispatcher_init(mip_dispatcher *self)
Initializes the mip_dispatcher object.
uint8_t _type
Type of the callback. (Using u8 for better struct packing.)
Holds the state of the MIP dispatch system.