mesh: change function names to resemble those in Mesh spec

This commit is contained in:
Milanka Ringwald 2019-07-09 16:51:22 +02:00 committed by Matthias Ringwald
parent 8eab9b2ba9
commit 9a85ed86d6
5 changed files with 14 additions and 14 deletions

View File

@ -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();

View File

@ -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

View File

@ -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" */

View File

@ -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;
}

View File

@ -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