ble_mesh: stack: Remove some not used client parameters

This commit is contained in:
lly 2020-06-28 16:18:24 +08:00
parent 1bd4fe1f50
commit 259d1924cb
14 changed files with 48 additions and 56 deletions

View File

@ -635,12 +635,14 @@ void btc_ble_mesh_config_client_call_handler(btc_msg_t *msg)
switch (msg->act) {
case BTC_BLE_MESH_ACT_CONFIG_CLIENT_GET_STATE: {
cb.params = arg->cfg_client_get_state.params;
role_param.model = (struct bt_mesh_model *)cb.params->model;
role_param.role = cb.params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
cb.error_code = btc_ble_mesh_config_client_get_state(arg->cfg_client_get_state.params,
arg->cfg_client_get_state.get_state);
if (cb.error_code) {
@ -650,12 +652,14 @@ void btc_ble_mesh_config_client_call_handler(btc_msg_t *msg)
}
case BTC_BLE_MESH_ACT_CONFIG_CLIENT_SET_STATE: {
cb.params = arg->cfg_client_set_state.params;
role_param.model = (struct bt_mesh_model *)cb.params->model;
role_param.role = cb.params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
cb.error_code = btc_ble_mesh_config_client_set_state(arg->cfg_client_set_state.params,
arg->cfg_client_set_state.set_state);
if (cb.error_code) {

View File

@ -466,12 +466,14 @@ void btc_ble_mesh_generic_client_call_handler(btc_msg_t *msg)
switch (msg->act) {
case BTC_BLE_MESH_ACT_GENERIC_CLIENT_GET_STATE: {
params = arg->generic_client_get_state.params;
role_param.model = (struct bt_mesh_model *)params->model;
role_param.role = params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
common.opcode = params->opcode;
common.model = (struct bt_mesh_model *)params->model;
common.ctx.net_idx = params->ctx.net_idx;
@ -482,8 +484,7 @@ void btc_ble_mesh_generic_client_call_handler(btc_msg_t *msg)
common.msg_timeout = params->msg_timeout;
cb.params = arg->generic_client_get_state.params;
cb.error_code = bt_mesh_generic_client_get_state(&common,
(void *)arg->generic_client_get_state.get_state, (void *)&cb.status_cb);
cb.error_code = bt_mesh_generic_client_get_state(&common, arg->generic_client_get_state.get_state);
if (cb.error_code) {
/* If send failed, callback error_code to app layer immediately */
btc_ble_mesh_generic_client_callback(&cb, ESP_BLE_MESH_GENERIC_CLIENT_GET_STATE_EVT);
@ -492,12 +493,14 @@ void btc_ble_mesh_generic_client_call_handler(btc_msg_t *msg)
}
case BTC_BLE_MESH_ACT_GENERIC_CLIENT_SET_STATE: {
params = arg->generic_client_set_state.params;
role_param.model = (struct bt_mesh_model *)params->model;
role_param.role = params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
common.opcode = params->opcode;
common.model = (struct bt_mesh_model *)params->model;
common.ctx.net_idx = params->ctx.net_idx;
@ -508,8 +511,7 @@ void btc_ble_mesh_generic_client_call_handler(btc_msg_t *msg)
common.msg_timeout = params->msg_timeout;
cb.params = arg->generic_client_set_state.params;
cb.error_code = bt_mesh_generic_client_set_state(&common,
(void *)arg->generic_client_set_state.set_state, (void *)&cb.status_cb);
cb.error_code = bt_mesh_generic_client_set_state(&common, arg->generic_client_set_state.set_state);
if (cb.error_code) {
/* If send failed, callback error_code to app layer immediately */
btc_ble_mesh_generic_client_callback(&cb, ESP_BLE_MESH_GENERIC_CLIENT_SET_STATE_EVT);

View File

@ -411,12 +411,14 @@ void btc_ble_mesh_health_client_call_handler(btc_msg_t *msg)
switch (msg->act) {
case BTC_BLE_MESH_ACT_HEALTH_CLIENT_GET_STATE: {
cb.params = arg->health_client_get_state.params;
role_param.model = (struct bt_mesh_model *)cb.params->model;
role_param.role = cb.params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
cb.error_code = btc_ble_mesh_health_client_get_state(arg->health_client_get_state.params,
arg->health_client_get_state.get_state);
if (cb.error_code) {
@ -427,12 +429,14 @@ void btc_ble_mesh_health_client_call_handler(btc_msg_t *msg)
}
case BTC_BLE_MESH_ACT_HEALTH_CLIENT_SET_STATE: {
cb.params = arg->health_client_set_state.params;
role_param.model = (struct bt_mesh_model *)cb.params->model;
role_param.role = cb.params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
cb.error_code = btc_ble_mesh_health_client_set_state(arg->health_client_set_state.params,
arg->health_client_set_state.set_state);
if (cb.error_code) {

View File

@ -310,12 +310,14 @@ void btc_ble_mesh_lighting_client_call_handler(btc_msg_t *msg)
switch (msg->act) {
case BTC_BLE_MESH_ACT_LIGHTING_CLIENT_GET_STATE: {
params = arg->light_client_get_state.params;
role_param.model = (struct bt_mesh_model *)params->model;
role_param.role = params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
common.opcode = params->opcode;
common.model = (struct bt_mesh_model *)params->model;
common.ctx.net_idx = params->ctx.net_idx;
@ -326,8 +328,7 @@ void btc_ble_mesh_lighting_client_call_handler(btc_msg_t *msg)
common.msg_timeout = params->msg_timeout;
cb.params = arg->light_client_get_state.params;
cb.error_code = bt_mesh_light_client_get_state(&common,
(void *)arg->light_client_get_state.get_state, (void *)&cb.status_cb);
cb.error_code = bt_mesh_light_client_get_state(&common, arg->light_client_get_state.get_state);
if (cb.error_code) {
/* If send failed, callback error_code to app layer immediately */
btc_ble_mesh_lighting_client_callback(&cb, ESP_BLE_MESH_LIGHT_CLIENT_GET_STATE_EVT);
@ -336,12 +337,14 @@ void btc_ble_mesh_lighting_client_call_handler(btc_msg_t *msg)
}
case BTC_BLE_MESH_ACT_LIGHTING_CLIENT_SET_STATE: {
params = arg->light_client_set_state.params;
role_param.model = (struct bt_mesh_model *)params->model;
role_param.role = params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
common.opcode = params->opcode;
common.model = (struct bt_mesh_model *)params->model;
common.ctx.net_idx = params->ctx.net_idx;
@ -352,8 +355,7 @@ void btc_ble_mesh_lighting_client_call_handler(btc_msg_t *msg)
common.msg_timeout = params->msg_timeout;
cb.params = arg->light_client_set_state.params;
cb.error_code = bt_mesh_light_client_set_state(&common,
(void *)arg->light_client_set_state.set_state, (void *)&cb.status_cb);
cb.error_code = bt_mesh_light_client_set_state(&common, arg->light_client_set_state.set_state);
if (cb.error_code) {
/* If send failed, callback error_code to app layer immediately */
btc_ble_mesh_lighting_client_callback(&cb, ESP_BLE_MESH_LIGHT_CLIENT_SET_STATE_EVT);

View File

@ -548,12 +548,14 @@ void btc_ble_mesh_sensor_client_call_handler(btc_msg_t *msg)
switch (msg->act) {
case BTC_BLE_MESH_ACT_SENSOR_CLIENT_GET_STATE: {
params = arg->sensor_client_get_state.params;
role_param.model = (struct bt_mesh_model *)params->model;
role_param.role = params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
common.opcode = params->opcode;
common.model = (struct bt_mesh_model *)params->model;
common.ctx.net_idx = params->ctx.net_idx;
@ -564,8 +566,7 @@ void btc_ble_mesh_sensor_client_call_handler(btc_msg_t *msg)
common.msg_timeout = params->msg_timeout;
cb.params = arg->sensor_client_get_state.params;
cb.error_code = bt_mesh_sensor_client_get_state(&common,
(void *)arg->sensor_client_get_state.get_state, (void *)&cb.status_cb);
cb.error_code = bt_mesh_sensor_client_get_state(&common, arg->sensor_client_get_state.get_state);
if (cb.error_code) {
/* If send failed, callback error_code to app layer immediately */
btc_ble_mesh_sensor_client_callback(&cb, ESP_BLE_MESH_SENSOR_CLIENT_GET_STATE_EVT);
@ -574,12 +575,14 @@ void btc_ble_mesh_sensor_client_call_handler(btc_msg_t *msg)
}
case BTC_BLE_MESH_ACT_SENSOR_CLIENT_SET_STATE: {
params = arg->sensor_client_set_state.params;
role_param.model = (struct bt_mesh_model *)params->model;
role_param.role = params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
common.opcode = params->opcode;
common.model = (struct bt_mesh_model *)params->model;
common.ctx.net_idx = params->ctx.net_idx;
@ -590,8 +593,7 @@ void btc_ble_mesh_sensor_client_call_handler(btc_msg_t *msg)
common.msg_timeout = params->msg_timeout;
cb.params = arg->sensor_client_set_state.params;
cb.error_code = bt_mesh_sensor_client_set_state(&common,
(void *)arg->sensor_client_set_state.set_state, (void *)&cb.status_cb);
cb.error_code = bt_mesh_sensor_client_set_state(&common, arg->sensor_client_set_state.set_state);
if (cb.error_code) {
/* If send failed, callback error_code to app layer immediately */
btc_ble_mesh_sensor_client_callback(&cb, ESP_BLE_MESH_SENSOR_CLIENT_SET_STATE_EVT);

View File

@ -312,12 +312,14 @@ void btc_ble_mesh_time_scene_client_call_handler(btc_msg_t *msg)
switch (msg->act) {
case BTC_BLE_MESH_ACT_TIME_SCENE_CLIENT_GET_STATE: {
params = arg->time_scene_client_get_state.params;
role_param.model = (struct bt_mesh_model *)params->model;
role_param.role = params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
common.opcode = params->opcode;
common.model = (struct bt_mesh_model *)params->model;
common.ctx.net_idx = params->ctx.net_idx;
@ -328,8 +330,7 @@ void btc_ble_mesh_time_scene_client_call_handler(btc_msg_t *msg)
common.msg_timeout = params->msg_timeout;
cb.params = arg->time_scene_client_get_state.params;
cb.error_code = bt_mesh_time_scene_client_get_state(&common,
(void *)arg->time_scene_client_get_state.get_state, (void *)&cb.status_cb);
cb.error_code = bt_mesh_time_scene_client_get_state(&common, arg->time_scene_client_get_state.get_state);
if (cb.error_code) {
/* If send failed, callback error_code to app layer immediately */
btc_ble_mesh_time_scene_client_callback(&cb, ESP_BLE_MESH_TIME_SCENE_CLIENT_GET_STATE_EVT);
@ -338,12 +339,14 @@ void btc_ble_mesh_time_scene_client_call_handler(btc_msg_t *msg)
}
case BTC_BLE_MESH_ACT_TIME_SCENE_CLIENT_SET_STATE: {
params = arg->time_scene_client_set_state.params;
role_param.model = (struct bt_mesh_model *)params->model;
role_param.role = params->msg_role;
if (bt_mesh_set_client_model_role(&role_param)) {
BT_ERR("Failed to set model role");
break;
}
common.opcode = params->opcode;
common.model = (struct bt_mesh_model *)params->model;
common.ctx.net_idx = params->ctx.net_idx;
@ -354,8 +357,7 @@ void btc_ble_mesh_time_scene_client_call_handler(btc_msg_t *msg)
common.msg_timeout = params->msg_timeout;
cb.params = arg->time_scene_client_set_state.params;
cb.error_code = bt_mesh_time_scene_client_set_state(&common,
(void *)arg->time_scene_client_set_state.set_state, (void *)&cb.status_cb);
cb.error_code = bt_mesh_time_scene_client_set_state(&common, arg->time_scene_client_set_state.set_state);
if (cb.error_code) {
/* If send failed, callback error_code to app layer immediately */
btc_ble_mesh_time_scene_client_callback(&cb, ESP_BLE_MESH_TIME_SCENE_CLIENT_SET_STATE_EVT);

View File

@ -913,8 +913,7 @@ end:
return err;
}
int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common,
void *get, void *status)
int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common, void *get)
{
bt_mesh_generic_client_t *client = NULL;
@ -977,8 +976,7 @@ int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common,
return gen_get_state(common, get);
}
int bt_mesh_generic_client_set_state(bt_mesh_client_common_param_t *common,
void *set, void *status)
int bt_mesh_generic_client_set_state(bt_mesh_client_common_param_t *common, void *set)
{
bt_mesh_generic_client_t *client = NULL;
u16_t length = 0U;

View File

@ -553,24 +553,20 @@ int bt_mesh_gen_property_cli_deinit(struct bt_mesh_model *model, bool primary);
*
* @param[in] common: Message common information structure
* @param[in] get: Pointer of generic get message value
* @param[out] status: Pointer of generic status message value
*
* @return Zero-success, other-fail
*/
int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common,
void *get, void *status);
int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common, void *get);
/**
* @brief This function is called to set generic states.
*
* @param[in] common: Message common information structure
* @param[in] set: Pointer of generic set message value
* @param[out] status: Pointer of generic status message value
*
* @return Zero-success, other-fail
*/
int bt_mesh_generic_client_set_state(bt_mesh_client_common_param_t *common,
void *set, void *status);
int bt_mesh_generic_client_set_state(bt_mesh_client_common_param_t *common, void *set);
#ifdef __cplusplus
}

View File

@ -523,24 +523,20 @@ int bt_mesh_light_lc_cli_deinit(struct bt_mesh_model *model, bool primary);
*
* @param[in] common: Message common information structure
* @param[in] get: Pointer of light get message value
* @param[out] status: Pointer of light status message value
*
* @return Zero-success, other-fail
*/
int bt_mesh_light_client_get_state(bt_mesh_client_common_param_t *common,
void *get, void *status);
int bt_mesh_light_client_get_state(bt_mesh_client_common_param_t *common, void *get);
/**
* @brief This function is called to set light states.
*
* @param[in] common: Message common information structure
* @param[in] set: Pointer of light set message value
* @param[out] status: Pointer of light status message value
*
* @return Zero-success, other-fail
*/
int bt_mesh_light_client_set_state(bt_mesh_client_common_param_t *common,
void *set, void *status);
int bt_mesh_light_client_set_state(bt_mesh_client_common_param_t *common, void *set);
#ifdef __cplusplus
}

View File

@ -158,24 +158,20 @@ int bt_mesh_sensor_cli_deinit(struct bt_mesh_model *model, bool primary);
*
* @param[in] common: Message common information structure
* @param[in] get: Pointer of sensor get message value
* @param[out] status: Pointer of sensor status message value
*
* @return Zero-success, other-fail
*/
int bt_mesh_sensor_client_get_state(bt_mesh_client_common_param_t *common,
void *get, void *status);
int bt_mesh_sensor_client_get_state(bt_mesh_client_common_param_t *common, void *get);
/**
* @brief This function is called to set sensor states.
*
* @param[in] common: Message common information structure
* @param[in] set: Pointer of sensor set message value
* @param[out] status: Pointer of sensor status message value
*
* @return Zero-success, other-fail
*/
int bt_mesh_sensor_client_set_state(bt_mesh_client_common_param_t *common,
void *set, void *status);
int bt_mesh_sensor_client_set_state(bt_mesh_client_common_param_t *common, void *set);
#ifdef __cplusplus
}

View File

@ -268,24 +268,20 @@ int bt_mesh_scheduler_cli_deinit(struct bt_mesh_model *model, bool primary);
*
* @param[in] common: Message common information structure
* @param[in] get: Pointer of time scene get message value
* @param[out] status: Pointer of time scene status message value
*
* @return Zero-success, other-fail
*/
int bt_mesh_time_scene_client_get_state(bt_mesh_client_common_param_t *common,
void *get, void *status);
int bt_mesh_time_scene_client_get_state(bt_mesh_client_common_param_t *common, void *get);
/**
* @brief This function is called to set scene states.
*
* @param[in] common: Message common information structure
* @param[in] set: Pointer of time scene set message value
* @param[out] status: Pointer of time scene status message value
*
* @return Zero-success, other-fail
*/
int bt_mesh_time_scene_client_set_state(bt_mesh_client_common_param_t *common,
void *set, void *status);
int bt_mesh_time_scene_client_set_state(bt_mesh_client_common_param_t *common, void *set);
#ifdef __cplusplus
}

View File

@ -1037,8 +1037,7 @@ end:
return err;
}
int bt_mesh_light_client_get_state(bt_mesh_client_common_param_t *common,
void *get, void *status)
int bt_mesh_light_client_get_state(bt_mesh_client_common_param_t *common, void *get)
{
bt_mesh_light_client_t *client = NULL;
@ -1091,8 +1090,7 @@ int bt_mesh_light_client_get_state(bt_mesh_client_common_param_t *common,
return light_get_state(common, get);
}
int bt_mesh_light_client_set_state(bt_mesh_client_common_param_t *common,
void *set, void *status)
int bt_mesh_light_client_set_state(bt_mesh_client_common_param_t *common, void *set)
{
bt_mesh_light_client_t *client = NULL;
u16_t length = 0U;

View File

@ -458,8 +458,7 @@ end:
return err;
}
int bt_mesh_sensor_client_get_state(bt_mesh_client_common_param_t *common,
void *get, void *status)
int bt_mesh_sensor_client_get_state(bt_mesh_client_common_param_t *common, void *get)
{
bt_mesh_sensor_client_t *client = NULL;
u16_t length = 0U;
@ -524,8 +523,7 @@ int bt_mesh_sensor_client_get_state(bt_mesh_client_common_param_t *common,
return sensor_act_state(common, get, length, true);
}
int bt_mesh_sensor_client_set_state(bt_mesh_client_common_param_t *common,
void *set, void *status)
int bt_mesh_sensor_client_set_state(bt_mesh_client_common_param_t *common, void *set)
{
bt_mesh_sensor_client_t *client = NULL;
u16_t length = 0U;

View File

@ -493,8 +493,7 @@ end:
return err;
}
int bt_mesh_time_scene_client_get_state(bt_mesh_client_common_param_t *common,
void *get, void *status)
int bt_mesh_time_scene_client_get_state(bt_mesh_client_common_param_t *common, void *get)
{
bt_mesh_time_scene_client_t *client = NULL;
@ -532,8 +531,7 @@ int bt_mesh_time_scene_client_get_state(bt_mesh_client_common_param_t *common,
return time_scene_get_state(common, get);
}
int bt_mesh_time_scene_client_set_state(bt_mesh_client_common_param_t *common,
void *set, void *status)
int bt_mesh_time_scene_client_set_state(bt_mesh_client_common_param_t *common, void *set)
{
bt_mesh_time_scene_client_t *client = NULL;
u16_t length = 0U;