mesh: mesh_transport_init -> mesh_upper_transport_init

This commit is contained in:
Matthias Ringwald 2019-07-08 16:21:15 +02:00
parent b98d42d698
commit 600d87833a
4 changed files with 8 additions and 5 deletions

View File

@ -876,7 +876,6 @@ void mesh_upper_transport_set_primary_element_address(uint16_t unicast_address){
primary_element_address = unicast_address;
}
void mesh_upper_transport_register_access_message_handler(void (*callback)(mesh_pdu_t *pdu)){
mesh_access_message_handler = callback;
}
@ -889,7 +888,7 @@ void mesh_upper_transport_set_higher_layer_handler(void (*pdu_handler)( mesh_tra
higher_layer_handler = pdu_handler;
}
void mesh_transport_init(){
void mesh_upper_transport_init(){
mesh_lower_transport_init();
mesh_lower_transport_set_higher_layer_handler(&mesh_upper_transport_pdu_handler);
}

View File

@ -49,12 +49,14 @@ extern "C"
#include <stdint.h>
#include "mesh/mesh_network.h"
void mesh_transport_init();
void mesh_upper_transport_init();
void mesh_upper_transport_set_primary_element_address(uint16_t primary_element_address);
void mesh_upper_transport_message_processed_by_higher_layer(mesh_pdu_t * pdu);
void mesh_upper_transport_set_higher_layer_handler(void (*pdu_handler)( mesh_transport_callback_type_t callback_type, mesh_transport_status_t status, mesh_pdu_t * pdu));
// Control PDUs
void mesh_upper_transport_register_control_message_handler(void (*callback)(mesh_pdu_t * pdu));

View File

@ -842,7 +842,8 @@ int btstack_main(void)
mesh_network_init();
// Transport layers (lower + upper))
mesh_transport_init();
mesh_lower_transport_init();
mesh_upper_transport_init();
// Access layer
mesh_access_init();

View File

@ -270,7 +270,8 @@ TEST_GROUP(MessageTest){
btstack_crypto_init();
load_provisioning_data_test_message();
mesh_network_init();
mesh_transport_init();
mesh_lower_transport_init();
mesh_upper_transport_init();
mesh_network_key_init();
// intercept messages between network and lower layer
mesh_network_set_higher_layer_handler(&test_lower_transport_callback_handler);