mesh: add mesh_node_get_health_server, rename mesh_model_get_configuration_server to mesh_node_get_configuration_server

This commit is contained in:
Matthias Ringwald 2019-10-29 17:16:49 +01:00
parent 5d71beb8a1
commit 6f8febae67
3 changed files with 14 additions and 8 deletions

View File

@ -617,7 +617,7 @@ static void config_netkey_add_derived(void * arg){
mesh_proxy_start_advertising_with_network_id();
#endif
config_netkey_status(mesh_model_get_configuration_server(), mesh_pdu_netkey_index(access_pdu_in_process), mesh_pdu_src(access_pdu_in_process), MESH_FOUNDATION_STATUS_SUCCESS, subnet->netkey_index);
config_netkey_status(mesh_node_get_configuration_server(), mesh_pdu_netkey_index(access_pdu_in_process), mesh_pdu_src(access_pdu_in_process), MESH_FOUNDATION_STATUS_SUCCESS, subnet->netkey_index);
mesh_access_message_processed(access_pdu_in_process);
}
@ -702,7 +702,7 @@ static void config_netkey_update_derived(void * arg){
subnet->key_refresh = MESH_KEY_REFRESH_FIRST_PHASE;
// report status
config_netkey_status(mesh_model_get_configuration_server(), mesh_pdu_netkey_index(access_pdu_in_process), mesh_pdu_src(access_pdu_in_process), MESH_FOUNDATION_STATUS_SUCCESS, subnet->netkey_index);
config_netkey_status(mesh_node_get_configuration_server(), mesh_pdu_netkey_index(access_pdu_in_process), mesh_pdu_src(access_pdu_in_process), MESH_FOUNDATION_STATUS_SUCCESS, subnet->netkey_index);
mesh_access_message_processed(access_pdu_in_process);
}
@ -862,7 +862,7 @@ static void config_appkey_add_or_update_aid(void *arg){
mesh_transport_key_add(transport_key);
uint32_t netkey_and_appkey_index = (transport_key->appkey_index << 12) | transport_key->netkey_index;
config_appkey_status(mesh_model_get_configuration_server(), mesh_pdu_netkey_index(access_pdu_in_process), mesh_pdu_src(access_pdu_in_process), netkey_and_appkey_index, MESH_FOUNDATION_STATUS_SUCCESS);
config_appkey_status(mesh_node_get_configuration_server(), mesh_pdu_netkey_index(access_pdu_in_process), mesh_pdu_src(access_pdu_in_process), netkey_and_appkey_index, MESH_FOUNDATION_STATUS_SUCCESS);
mesh_access_message_processed(access_pdu_in_process);
}
@ -1134,7 +1134,7 @@ static void config_model_subscription_add_handler(mesh_model_t *mesh_model, mesh
static void config_model_subscription_virtual_address_add_hash(void *arg){
mesh_model_t * target_model = (mesh_model_t*) arg;
mesh_model_t * mesh_model = mesh_model_get_configuration_server();
mesh_model_t * mesh_model = mesh_node_get_configuration_server();
// add if not exists
mesh_virtual_address_t * virtual_address = mesh_virtual_address_for_label_uuid(configuration_server_label_uuid);
@ -1216,7 +1216,7 @@ static void config_model_subscription_overwrite_handler(mesh_model_t *mesh_model
static void config_model_subscription_virtual_address_overwrite_hash(void *arg){
mesh_model_t * target_model = (mesh_model_t*) arg;
mesh_model_t * mesh_model = mesh_model_get_configuration_server();
mesh_model_t * mesh_model = mesh_node_get_configuration_server();
// add if not exists
mesh_virtual_address_t * virtual_address = mesh_virtual_address_for_label_uuid(configuration_server_label_uuid);
@ -1773,7 +1773,7 @@ static void config_heartbeat_publication_emit(mesh_heartbeat_publication_t * mes
}
}
void mesh_configuration_server_feature_changed(void){
mesh_model_t * mesh_model = mesh_model_get_configuration_server();
mesh_model_t * mesh_model = mesh_node_get_configuration_server();
mesh_heartbeat_publication_t * mesh_heartbeat_publication = &((mesh_configuration_server_model_context_t*) mesh_model->model_data)->heartbeat_publication;
// filter features by observed features for heartbeats

View File

@ -174,10 +174,14 @@ int mesh_model_is_bluetooth_sig(uint32_t model_identifier){
return mesh_model_get_vendor_id(model_identifier) == BLUETOOTH_COMPANY_ID_BLUETOOTH_SIG_INC;
}
mesh_model_t * mesh_model_get_configuration_server(void){
mesh_model_t * mesh_node_get_configuration_server(void){
return mesh_model_get_by_identifier(mesh_node_get_primary_element(), mesh_model_get_model_identifier_bluetooth_sig(MESH_SIG_MODEL_ID_CONFIGURATION_SERVER));
}
mesh_model_t * mesh_node_get_health_server(void){
return mesh_model_get_by_identifier(mesh_node_get_primary_element(), mesh_model_get_model_identifier_bluetooth_sig(MESH_SIG_MODEL_ID_HEALTH_SERVER));
}
void mesh_model_reset_appkeys(mesh_model_t * mesh_model){
uint16_t i;
for (i=0;i<MAX_NR_MESH_APPKEYS_PER_MODEL;i++){

View File

@ -254,7 +254,9 @@ uint32_t mesh_model_get_model_identifier(uint16_t vendor_id, uint16_t model_id);
uint16_t mesh_model_get_vendor_id(uint32_t model_identifier);
mesh_model_t * mesh_model_get_configuration_server(void);
mesh_model_t * mesh_node_get_configuration_server(void);
mesh_model_t * mesh_node_get_health_server(void);
mesh_model_t * mesh_access_model_for_address_and_model_identifier(uint16_t element_address, uint32_t model_identifier, uint8_t * status);