From 8d471f5c5a5a8cc8a2f4ca0b9653ec432ff759ee Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 3 Feb 2016 11:59:48 +0100 Subject: [PATCH] add btstack_packet_callback_registration_t --- src/btstack_util.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/btstack_util.h b/src/btstack_util.h index 36c09464e..20c44dcc6 100644 --- a/src/btstack_util.h +++ b/src/btstack_util.h @@ -52,6 +52,7 @@ extern "C" { #endif #include +#include "btstack_linked_list.h" /** * @brief hci connection handle type @@ -96,6 +97,13 @@ typedef uint8_t device_name_t[DEVICE_NAME_LEN+1]; // packet handler typedef void (*btstack_packet_handler_t) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); + +// new packet callback supporting multiple registration +typedef struct { + btstack_linked_item_t item; + void (*callback)(uint8_t packet_type, uint8_t * packet, uint16_t size); +} btstack_packet_callback_registration_t; + // helper for BT little endian format #define little_endian_read_16( buffer, pos) ( ((uint16_t) buffer[pos]) | (((uint16_t)buffer[(pos)+1]) << 8))