mesh: add mesh_upper_[un]segmented_message_processed_by_higher_layer

This commit is contained in:
Matthias Ringwald 2019-04-19 22:22:58 +02:00
parent 298f1427a3
commit 4e37c452f7
4 changed files with 18 additions and 6 deletions

View File

@ -1559,7 +1559,7 @@ static mesh_operation_t mesh_configuration_server_model_operations[] = {
{ 0, 0, NULL}
};
static void mesh_segmented_message_handler(mesh_transport_pdu_t *transport_pdu){
static void mesh_segmented_message_process(mesh_transport_pdu_t *transport_pdu){
// get opcode and size
uint32_t opcode = 0;
uint16_t opcode_size = 0;
@ -1582,6 +1582,11 @@ static void mesh_segmented_message_handler(mesh_transport_pdu_t *transport_pdu){
printf("Message not handled\n");
}
static void mesh_segmented_message_handler(mesh_transport_pdu_t *transport_pdu){
mesh_segmented_message_process(transport_pdu);
mesh_upper_transport_segmented_message_processed_by_higher_layer(transport_pdu);
}
static btstack_crypto_aes128_cmac_t salt_request;
static uint8_t label_uuid[16];
static uint8_t salt_hash[16];

View File

@ -177,11 +177,13 @@ static void test_upper_transport_unsegmented_callback_handler(mesh_network_pdu_t
recv_upper_transport_pdu_len = mesh_network_pdu_len(network_pdu) - 1;
memcpy(recv_upper_transport_pdu_data, mesh_network_pdu_data(network_pdu) + 1, recv_upper_transport_pdu_len);
}
mesh_upper_transport_unsegmented_message_processed_by_higher_layer(network_pdu);
}
static void test_upper_transport_segmented_callback_handler(mesh_transport_pdu_t * transport_pdu){
recv_upper_transport_pdu_len = transport_pdu->len;
memcpy(recv_upper_transport_pdu_data, transport_pdu->data, recv_upper_transport_pdu_len);
mesh_upper_transport_segmented_message_processed_by_higher_layer(transport_pdu);
}
TEST_GROUP(MessageTest){

View File

@ -252,9 +252,6 @@ static void mesh_upper_transport_validate_unsegmented_message_ccm(void * arg){
}
printf("\n");
// done
mesh_upper_transport_process_unsegmented_message_done(network_pdu);
} else {
uint8_t afk = lower_transport_pdu[0] & 0x40;
if (afk){
@ -301,8 +298,6 @@ static void mesh_upper_transport_validate_segmented_message_ccm(void * arg){
printf("\n");
// done
mesh_upper_transport_process_segmented_message_done(transport_pdu);
} else {
uint8_t akf = transport_pdu->akf_aid & 0x40;
if (akf){
@ -316,6 +311,13 @@ static void mesh_upper_transport_validate_segmented_message_ccm(void * arg){
}
}
void mesh_upper_transport_segmented_message_processed_by_higher_layer(mesh_transport_pdu_t * transport_pdu){
mesh_upper_transport_process_segmented_message_done(transport_pdu);
}
void mesh_upper_transport_unsegmented_message_processed_by_higher_layer(mesh_network_pdu_t * network_pdu){
mesh_upper_transport_process_unsegmented_message_done(network_pdu);
}
static void mesh_upper_transport_validate_segmented_message_digest(void * arg){
mesh_transport_pdu_t * transport_pdu = (mesh_transport_pdu_t*) arg;
uint8_t upper_transport_pdu_len = transport_pdu_in_validation->len - transport_pdu_in_validation->transmic_len;

View File

@ -89,6 +89,9 @@ void mesh_upper_transport_send_unsegmented_access_pdu(mesh_network_pdu_t * netwo
void mesh_upper_transport_send_segmented_access_pdu(mesh_transport_pdu_t * transport_pdu);
void mesh_upper_transport_segmented_message_processed_by_higher_layer(mesh_transport_pdu_t * transport_pdu);
void mesh_upper_transport_unsegmented_message_processed_by_higher_layer(mesh_network_pdu_t * network_pdu);
//
// Virtual Address Management
//