mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-28 06:39:49 +00:00
mesh: add mesh_network_notify_on_freed_pdu
This commit is contained in:
parent
f82a583aa1
commit
3fa4c16cca
@ -139,6 +139,9 @@ static mesh_network_pdu_t * adv_bearer_network_pdu;
|
||||
static uint32_t mesh_network_cache[MESH_NETWORK_CACHE_SIZE];
|
||||
static int mesh_network_cache_index;
|
||||
|
||||
// register for freed network pdu
|
||||
void (*mesh_network_free_pdu_callback)(void);
|
||||
|
||||
// prototypes
|
||||
|
||||
static void mesh_network_run(void);
|
||||
@ -1266,7 +1269,18 @@ mesh_network_pdu_t * mesh_network_pdu_get(void){
|
||||
|
||||
void mesh_network_pdu_free(mesh_network_pdu_t * network_pdu){
|
||||
btstack_memory_mesh_network_pdu_free(network_pdu);
|
||||
if (mesh_network_free_pdu_callback!=NULL){
|
||||
void (*callback)(void) = mesh_network_free_pdu_callback;
|
||||
mesh_network_free_pdu_callback= NULL;
|
||||
(*callback)();
|
||||
}
|
||||
}
|
||||
|
||||
void mesh_network_notify_on_freed_pdu(void (*callback)(void)){
|
||||
btstack_assert(mesh_network_free_pdu_callback == NULL);
|
||||
mesh_network_free_pdu_callback = callback;
|
||||
}
|
||||
|
||||
|
||||
// Mesh Subnet Management
|
||||
|
||||
|
@ -442,6 +442,7 @@ mesh_network_key_t * mesh_subnet_get_outgoing_network_key(mesh_subnet_t * subnet
|
||||
// buffer pool
|
||||
mesh_network_pdu_t * mesh_network_pdu_get(void);
|
||||
void mesh_network_pdu_free(mesh_network_pdu_t * network_pdu);
|
||||
void mesh_network_notify_on_freed_pdu(void (*callback)(void));
|
||||
|
||||
// Mesh Network PDU Getter
|
||||
uint16_t mesh_network_control(mesh_network_pdu_t * network_pdu);
|
||||
|
Loading…
x
Reference in New Issue
Block a user