From 9a85ed86d65e7eefb16dc45046b45eabfef2d111 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Tue, 9 Jul 2019 16:51:22 +0200 Subject: [PATCH] mesh: change function names to resemble those in Mesh spec --- test/mesh/mesh.c | 2 +- test/mesh/mesh_generic_client.c | 10 +++++----- test/mesh/mesh_generic_client.h | 8 ++++---- test/mesh/mesh_generic_server.c | 4 ++-- test/mesh/mesh_generic_server.h | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/mesh/mesh.c b/test/mesh/mesh.c index e60d51e01..285291de5 100644 --- a/test/mesh/mesh.c +++ b/test/mesh/mesh.c @@ -647,7 +647,7 @@ static void stdin_process(char cmd){ break; case 'g': printf("Generic ON/OFF Server Toggle Value\n"); - mesh_generic_on_off_server_set_value(&mesh_generic_on_off_server_model, 1-mesh_generic_on_off_server_get_value(&mesh_generic_on_off_server_model), 0, 0); + mesh_generic_on_off_server_set(&mesh_generic_on_off_server_model, 1-mesh_generic_on_off_server_get(&mesh_generic_on_off_server_model), 0, 0); break; case ' ': show_usage(); diff --git a/test/mesh/mesh_generic_client.c b/test/mesh/mesh_generic_client.c index de1cb9f5a..2173b54c4 100644 --- a/test/mesh/mesh_generic_client.c +++ b/test/mesh/mesh_generic_client.c @@ -88,7 +88,7 @@ static void generic_client_send_message_acknowledged(uint16_t src, uint16_t dest mesh_access_send_acknowledged_pdu(pdu, mesh_access_acknowledged_message_retransmissions(), ack_opcode); } -uint8_t mesh_generic_on_off_client_get_value(mesh_model_t *mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index){ +uint8_t mesh_generic_on_off_client_get(mesh_model_t *mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index){ // setup message mesh_transport_pdu_t * transport_pdu = mesh_access_setup_segmented_message(&mesh_generic_on_off_get); if (!transport_pdu) return BTSTACK_MEMORY_ALLOC_FAILED; @@ -97,7 +97,7 @@ uint8_t mesh_generic_on_off_client_get_value(mesh_model_t *mesh_model, uint16_t return ERROR_CODE_SUCCESS; } -uint8_t mesh_generic_on_off_client_set_value(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, +uint8_t mesh_generic_on_off_client_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t on_off_value, uint8_t transition_time_gdtt, uint8_t delay_time_gdtt, uint8_t transaction_id){ mesh_transport_pdu_t * transport_pdu; @@ -112,7 +112,7 @@ uint8_t mesh_generic_on_off_client_set_value(mesh_model_t * mesh_model, uint16_t return ERROR_CODE_SUCCESS; } -uint8_t mesh_generic_on_off_client_set_value_unacknowledged(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, +uint8_t mesh_generic_on_off_client_set_unacknowledged(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t on_off_value, uint8_t transition_time_gdtt, uint8_t delay_time_gdtt, uint8_t transaction_id){ mesh_transport_pdu_t * transport_pdu; if (transition_time_gdtt != 0) { @@ -125,12 +125,12 @@ uint8_t mesh_generic_on_off_client_set_value_unacknowledged(mesh_model_t * mesh_ return ERROR_CODE_SUCCESS; } -uint8_t mesh_generic_on_off_client_publish_value(mesh_model_t * mesh_model, uint8_t on_off_value, uint8_t transaction_id){ +uint8_t mesh_generic_on_off_client_publish(mesh_model_t * mesh_model, uint8_t on_off_value, uint8_t transaction_id){ mesh_publication_model_t * publication_model = mesh_model->publication_model; uint16_t appkey_index = publication_model->appkey_index; mesh_transport_key_t * app_key = mesh_transport_key_get(appkey_index); if (app_key == NULL) return MESH_ERROR_APPKEY_INDEX_INVALID; - return mesh_generic_on_off_client_set_value_unacknowledged(mesh_model, publication_model->address, app_key->netkey_index, appkey_index, on_off_value, 0, 0, transaction_id); + return mesh_generic_on_off_client_set_unacknowledged(mesh_model, publication_model->address, app_key->netkey_index, appkey_index, on_off_value, 0, 0, transaction_id); } // Model Operations diff --git a/test/mesh/mesh_generic_client.h b/test/mesh/mesh_generic_client.h index ffa3be2df..1757bb969 100644 --- a/test/mesh/mesh_generic_client.h +++ b/test/mesh/mesh_generic_client.h @@ -66,7 +66,7 @@ void mesh_generic_on_off_client_register_packet_handler(mesh_model_t *mesh_model * @param transaction_id * @return status 0 if successful */ - uint8_t mesh_generic_on_off_client_set_value(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, + uint8_t mesh_generic_on_off_client_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t on_off_value, uint8_t transition_time_gdtt, uint8_t delay_time_gdtt, uint8_t transaction_id); /** @@ -81,7 +81,7 @@ void mesh_generic_on_off_client_register_packet_handler(mesh_model_t *mesh_model * @param transaction_id * @return status 0 if successful */ -uint8_t mesh_generic_on_off_client_set_value_unacknowledged(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, +uint8_t mesh_generic_on_off_client_set_unacknowledged(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t on_off_value, uint8_t transition_time_gdtt, uint8_t delay_time_gdtt, uint8_t transaction_id); /** @@ -92,7 +92,7 @@ uint8_t mesh_generic_on_off_client_set_value_unacknowledged(mesh_model_t * mesh_ * @param appkey_index * @return status 0 if successful */ -uint8_t mesh_generic_on_off_client_get_value(mesh_model_t *mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); +uint8_t mesh_generic_on_off_client_get(mesh_model_t *mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); /** * @brief Publish on_off value by sending an unacknowledged set message to the publish destination @@ -101,7 +101,7 @@ uint8_t mesh_generic_on_off_client_get_value(mesh_model_t *mesh_model, uint16_t * @param transaction_id * @return status 0 if successful */ -uint8_t mesh_generic_on_off_client_publish_value(mesh_model_t * mesh_model, uint8_t on_off_value, uint8_t transaction_id); +uint8_t mesh_generic_on_off_client_publish(mesh_model_t * mesh_model, uint8_t on_off_value, uint8_t transaction_id); #ifdef __cplusplus } /* end of extern "C" */ diff --git a/test/mesh/mesh_generic_server.c b/test/mesh/mesh_generic_server.c index 0156419aa..3528a4d83 100644 --- a/test/mesh/mesh_generic_server.c +++ b/test/mesh/mesh_generic_server.c @@ -279,7 +279,7 @@ const mesh_operation_t * mesh_generic_on_off_server_get_operations(void){ return mesh_generic_on_off_model_operations; } -void mesh_generic_on_off_server_set_value(mesh_model_t * mesh_model, uint8_t on_off_value, uint8_t transition_time_gdtt, uint8_t delay_time_gdtt){ +void mesh_generic_on_off_server_set(mesh_model_t * mesh_model, uint8_t on_off_value, uint8_t transition_time_gdtt, uint8_t delay_time_gdtt){ mesh_generic_on_off_state_t * generic_on_off_server_state = (mesh_generic_on_off_state_t *)mesh_model->model_data; generic_on_off_server_state->transition_data.target_value = on_off_value; @@ -288,7 +288,7 @@ void mesh_generic_on_off_server_set_value(mesh_model_t * mesh_model, uint8_t on_ // TODO implement publication } -uint8_t mesh_generic_on_off_server_get_value(mesh_model_t *generic_on_off_server_model){ +uint8_t mesh_generic_on_off_server_get(mesh_model_t *generic_on_off_server_model){ mesh_generic_on_off_state_t * generic_on_off_server_state = (mesh_generic_on_off_state_t *)generic_on_off_server_model->model_data; return generic_on_off_server_state->transition_data.current_value; } diff --git a/test/mesh/mesh_generic_server.h b/test/mesh/mesh_generic_server.h index fe73db60e..cee0ae3d4 100644 --- a/test/mesh/mesh_generic_server.h +++ b/test/mesh/mesh_generic_server.h @@ -68,14 +68,14 @@ void mesh_generic_on_off_server_set_publication_model(mesh_model_t *generic_on_o * @param transition_time_gdtt * @param delay_time_gdtt */ -void mesh_generic_on_off_server_set_value(mesh_model_t *generic_on_off_server_model, uint8_t on_off_value, uint8_t transition_time_gdtt, uint8_t delay_time_gdtt); +void mesh_generic_on_off_server_set(mesh_model_t *generic_on_off_server_model, uint8_t on_off_value, uint8_t transition_time_gdtt, uint8_t delay_time_gdtt); /** * @brief Get present ON/OFF value * @param generic_on_off_server_model * @return on_off_value */ -uint8_t mesh_generic_on_off_server_get_value(mesh_model_t *generic_on_off_server_model); +uint8_t mesh_generic_on_off_server_get(mesh_model_t *generic_on_off_server_model); #ifdef __cplusplus