mesh: mvoe mesh_transport_pdu_t allocator/free to lower transport

This commit is contained in:
Matthias Ringwald 2019-07-20 14:47:32 +02:00
parent bcf4b18c55
commit d5f4cd5b52
3 changed files with 14 additions and 18 deletions

View File

@ -716,3 +716,17 @@ void mesh_lower_transport_init(){
void mesh_lower_transport_set_higher_layer_handler(void (*pdu_handler)( mesh_transport_callback_type_t callback_type, mesh_transport_status_t status, mesh_pdu_t * pdu)){
higher_layer_handler = pdu_handler;
}
// buffer pool
mesh_transport_pdu_t * mesh_transport_pdu_get(void){
mesh_transport_pdu_t * transport_pdu = btstack_memory_mesh_transport_pdu_get();
if (transport_pdu) {
memset(transport_pdu, 0, sizeof(mesh_transport_pdu_t));
transport_pdu->pdu_header.pdu_type = MESH_PDU_TYPE_TRANSPORT;
}
return transport_pdu;
}
void mesh_transport_pdu_free(mesh_transport_pdu_t * transport_pdu){
btstack_memory_mesh_transport_pdu_free(transport_pdu);
}

View File

@ -941,17 +941,3 @@ static void mesh_transport_run(void){
}
}
}
// buffer pool
mesh_transport_pdu_t * mesh_transport_pdu_get(void){
mesh_transport_pdu_t * transport_pdu = btstack_memory_mesh_transport_pdu_get();
if (transport_pdu) {
memset(transport_pdu, 0, sizeof(mesh_transport_pdu_t));
transport_pdu->pdu_header.pdu_type = MESH_PDU_TYPE_TRANSPORT;
}
return transport_pdu;
}
void mesh_transport_pdu_free(mesh_transport_pdu_t * transport_pdu){
btstack_memory_mesh_transport_pdu_free(transport_pdu);
}

View File

@ -79,10 +79,6 @@ void mesh_upper_transport_send_access_pdu(mesh_pdu_t * pdu);
void mesh_upper_transport_pdu_free(mesh_pdu_t * pdu);
// allocator
mesh_transport_pdu_t * mesh_transport_pdu_get(void);
void mesh_transport_pdu_free(mesh_transport_pdu_t * transport_pdu);
#ifdef __cplusplus
} /* end of extern "C" */
#endif