mesh: add mesh_node_set_element_location

This commit is contained in:
Matthias Ringwald 2019-07-12 16:10:06 +02:00
parent 454184387b
commit 6f175e0393
3 changed files with 14 additions and 2 deletions

View File

@ -78,8 +78,13 @@ mesh_element_t * mesh_node_get_primary_element(void){
return &primary_element;
}
void mesh_node_set_element_location(mesh_element_t * element, uint16_t location){
element->loc = location;
}
void mesh_node_set_primary_element_location(uint16_t location){
primary_element.loc = location;
mesh_node_set_element_location(&primary_element, location);
}
mesh_element_t * mesh_node_element_for_index(uint16_t element_index){

View File

@ -82,6 +82,13 @@ void mesh_node_primary_element_address_set(uint16_t unicast_address);
*/
void mesh_node_set_primary_element_location(uint16_t location);
/**
* @brief Set location of element
* @param element
* @param location
*/
void mesh_node_set_element_location(mesh_element_t * element, uint16_t location);
/**
* @brief Get unicast address of primary element
*/

View File

@ -675,7 +675,7 @@ int btstack_main(void)
mesh_node_init();
// Loc - bottom - https://www.bluetooth.com/specifications/assigned-numbers/gatt-namespace-descriptors
mesh_node_set_primary_element_location(0x103);
mesh_node_set_element_location(mesh_node_get_primary_element(), 0x103);
// Setup models
mesh_configuration_server_model.model_identifier = mesh_model_get_model_identifier_bluetooth_sig(MESH_SIG_MODEL_ID_CONFIGURATION_SERVER);