From f46a0f51ed0e8df5183439a552a4e031ef1f2ec7 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 10 Jul 2019 17:28:58 +0200 Subject: [PATCH] mesh: extract mesh_node_startup_from_tlv from test app --- test/mesh/mesh.c | 20 ++------------------ test/mesh/mesh_access.c | 1 + test/mesh/mesh_configuration_server.c | 19 +++++++++++++++++++ test/mesh/mesh_configuration_server.h | 2 ++ 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/test/mesh/mesh.c b/test/mesh/mesh.c index 122b6ea2b..f49d87cd0 100644 --- a/test/mesh/mesh.c +++ b/test/mesh/mesh.c @@ -214,25 +214,8 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack provisioned = 1; mesh_access_setup_from_provisioning_data(&provisioning_data); - // load iv index - mesh_restore_iv_index_and_sequence_number(); - // load network keys - mesh_load_network_keys(); - // load app keys - mesh_load_app_keys(); - // load model to appkey bindings - mesh_load_appkey_lists(); - // load virtual addresses - mesh_load_virtual_addresses(); - // load model subscriptions - mesh_load_subscriptions(); - // load model publications - mesh_load_publications(); - // load foundation state - mesh_foundation_state_load(); - // dump data - mesh_provisioning_dump(&provisioning_data); + mesh_node_startup_from_tlv(); // dump PTS MeshOptions.ini mesh_pts_dump_mesh_options(); @@ -262,6 +245,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack case HCI_EVENT_DISCONNECTION_COMPLETE: // enable PB_GATT if (provisioned == 0){ + printf("Advertise Mesh Provisiong Service with Device UUID\n"); mesh_proxy_start_advertising_unprovisioned_device(test_device_uuid); } else { #ifdef ENABLE_MESH_PROXY_SERVER diff --git a/test/mesh/mesh_access.c b/test/mesh/mesh_access.c index c1a3d8275..a44b794ea 100644 --- a/test/mesh/mesh_access.c +++ b/test/mesh/mesh_access.c @@ -1781,3 +1781,4 @@ void mesh_access_setup_without_provisiong_data(const uint8_t * device_uuid){ mesh_proxy_start_advertising_unprovisioned_device(device_uuid); #endif } + diff --git a/test/mesh/mesh_configuration_server.c b/test/mesh/mesh_configuration_server.c index d0e26eb9d..a440c8321 100644 --- a/test/mesh/mesh_configuration_server.c +++ b/test/mesh/mesh_configuration_server.c @@ -2283,3 +2283,22 @@ void mesh_node_reset(void){ mesh_delete_publications(); } +void mesh_node_startup_from_tlv(void){ + // load iv index + mesh_restore_iv_index_and_sequence_number(); + // load network keys + mesh_load_network_keys(); + // load app keys + mesh_load_app_keys(); + // load model to appkey bindings + mesh_load_appkey_lists(); + // load virtual addresses + mesh_load_virtual_addresses(); + // load model subscriptions + mesh_load_subscriptions(); + // load model publications + mesh_load_publications(); + // load foundation state + mesh_foundation_state_load(); +} + diff --git a/test/mesh/mesh_configuration_server.h b/test/mesh/mesh_configuration_server.h index c1bcf1e13..0ea746a76 100644 --- a/test/mesh/mesh_configuration_server.h +++ b/test/mesh/mesh_configuration_server.h @@ -97,6 +97,8 @@ void mesh_delete_publications(void); // void mesh_node_reset(void); +void mesh_node_startup_from_tlv(void); + // PTS Testing void config_nekey_list_set_max(uint16_t max);