mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-05 00:40:19 +00:00
mesh: store provisioning data in mesh_node_store_provisioning_data
This commit is contained in:
parent
2d97f8bb25
commit
c0956dd0a8
@ -2292,17 +2292,23 @@ typedef struct {
|
|||||||
|
|
||||||
} mesh_persistent_provisioning_data_t;
|
} mesh_persistent_provisioning_data_t;
|
||||||
|
|
||||||
void mesh_node_store_provisioning_data(void){
|
void mesh_node_store_provisioning_data(mesh_provisioning_data_t * provisioning_data){
|
||||||
|
|
||||||
// fill prov data
|
// fill persistent prov data
|
||||||
mesh_persistent_provisioning_data_t persistent_provisioning_data;
|
mesh_persistent_provisioning_data_t persistent_provisioning_data;
|
||||||
|
|
||||||
persistent_provisioning_data.unicast_address = mesh_node_get_primary_element_address();
|
persistent_provisioning_data.unicast_address = provisioning_data->unicast_address;
|
||||||
memcpy(persistent_provisioning_data.device_key, mesh_transport_key_get(MESH_DEVICE_KEY_INDEX), 16);
|
memcpy(persistent_provisioning_data.device_key, provisioning_data->device_key, 16);
|
||||||
|
|
||||||
// store in tlv
|
// store in tlv
|
||||||
btstack_tlv_get_instance(&btstack_tlv_singleton_impl, &btstack_tlv_singleton_context);
|
btstack_tlv_get_instance(&btstack_tlv_singleton_impl, &btstack_tlv_singleton_context);
|
||||||
btstack_tlv_singleton_impl->store_tag(btstack_tlv_singleton_context, 'PROV', (uint8_t *) &persistent_provisioning_data, sizeof(mesh_persistent_provisioning_data_t));
|
btstack_tlv_singleton_impl->store_tag(btstack_tlv_singleton_context, 'PROV', (uint8_t *) &persistent_provisioning_data, sizeof(mesh_persistent_provisioning_data_t));
|
||||||
|
|
||||||
|
// store IV Index and sequence number
|
||||||
|
mesh_store_iv_index_after_provisioning(provisioning_data->iv_index);
|
||||||
|
|
||||||
|
// store primary network key
|
||||||
|
mesh_store_network_key(provisioning_data->network_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mesh_node_startup_from_tlv(void){
|
int mesh_node_startup_from_tlv(void){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user