Skip to content

Commit ad39479

Browse files
llyespressif-bot
authored andcommitted
ble_mesh: stack: Remove some not used client parameters
1 parent 1d6f653 commit ad39479

14 files changed

+48
-56
lines changed

components/bt/esp_ble_mesh/btc/btc_ble_mesh_config_model.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,12 +635,14 @@ void btc_ble_mesh_config_client_call_handler(btc_msg_t *msg)
635635
switch (msg->act) {
636636
case BTC_BLE_MESH_ACT_CONFIG_CLIENT_GET_STATE: {
637637
cb.params = arg->cfg_client_get_state.params;
638+
638639
role_param.model = (struct bt_mesh_model *)cb.params->model;
639640
role_param.role = cb.params->msg_role;
640641
if (bt_mesh_set_client_model_role(&role_param)) {
641642
BT_ERR("Failed to set model role");
642643
break;
643644
}
645+
644646
cb.error_code = btc_ble_mesh_config_client_get_state(arg->cfg_client_get_state.params,
645647
arg->cfg_client_get_state.get_state);
646648
if (cb.error_code) {
@@ -650,12 +652,14 @@ void btc_ble_mesh_config_client_call_handler(btc_msg_t *msg)
650652
}
651653
case BTC_BLE_MESH_ACT_CONFIG_CLIENT_SET_STATE: {
652654
cb.params = arg->cfg_client_set_state.params;
655+
653656
role_param.model = (struct bt_mesh_model *)cb.params->model;
654657
role_param.role = cb.params->msg_role;
655658
if (bt_mesh_set_client_model_role(&role_param)) {
656659
BT_ERR("Failed to set model role");
657660
break;
658661
}
662+
659663
cb.error_code = btc_ble_mesh_config_client_set_state(arg->cfg_client_set_state.params,
660664
arg->cfg_client_set_state.set_state);
661665
if (cb.error_code) {

components/bt/esp_ble_mesh/btc/btc_ble_mesh_generic_model.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,14 @@ void btc_ble_mesh_generic_client_call_handler(btc_msg_t *msg)
466466
switch (msg->act) {
467467
case BTC_BLE_MESH_ACT_GENERIC_CLIENT_GET_STATE: {
468468
params = arg->generic_client_get_state.params;
469+
469470
role_param.model = (struct bt_mesh_model *)params->model;
470471
role_param.role = params->msg_role;
471472
if (bt_mesh_set_client_model_role(&role_param)) {
472473
BT_ERR("Failed to set model role");
473474
break;
474475
}
476+
475477
common.opcode = params->opcode;
476478
common.model = (struct bt_mesh_model *)params->model;
477479
common.ctx.net_idx = params->ctx.net_idx;
@@ -482,8 +484,7 @@ void btc_ble_mesh_generic_client_call_handler(btc_msg_t *msg)
482484
common.msg_timeout = params->msg_timeout;
483485

484486
cb.params = arg->generic_client_get_state.params;
485-
cb.error_code = bt_mesh_generic_client_get_state(&common,
486-
(void *)arg->generic_client_get_state.get_state, (void *)&cb.status_cb);
487+
cb.error_code = bt_mesh_generic_client_get_state(&common, arg->generic_client_get_state.get_state);
487488
if (cb.error_code) {
488489
/* If send failed, callback error_code to app layer immediately */
489490
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)
492493
}
493494
case BTC_BLE_MESH_ACT_GENERIC_CLIENT_SET_STATE: {
494495
params = arg->generic_client_set_state.params;
496+
495497
role_param.model = (struct bt_mesh_model *)params->model;
496498
role_param.role = params->msg_role;
497499
if (bt_mesh_set_client_model_role(&role_param)) {
498500
BT_ERR("Failed to set model role");
499501
break;
500502
}
503+
501504
common.opcode = params->opcode;
502505
common.model = (struct bt_mesh_model *)params->model;
503506
common.ctx.net_idx = params->ctx.net_idx;
@@ -508,8 +511,7 @@ void btc_ble_mesh_generic_client_call_handler(btc_msg_t *msg)
508511
common.msg_timeout = params->msg_timeout;
509512

510513
cb.params = arg->generic_client_set_state.params;
511-
cb.error_code = bt_mesh_generic_client_set_state(&common,
512-
(void *)arg->generic_client_set_state.set_state, (void *)&cb.status_cb);
514+
cb.error_code = bt_mesh_generic_client_set_state(&common, arg->generic_client_set_state.set_state);
513515
if (cb.error_code) {
514516
/* If send failed, callback error_code to app layer immediately */
515517
btc_ble_mesh_generic_client_callback(&cb, ESP_BLE_MESH_GENERIC_CLIENT_SET_STATE_EVT);

components/bt/esp_ble_mesh/btc/btc_ble_mesh_health_model.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,14 @@ void btc_ble_mesh_health_client_call_handler(btc_msg_t *msg)
411411
switch (msg->act) {
412412
case BTC_BLE_MESH_ACT_HEALTH_CLIENT_GET_STATE: {
413413
cb.params = arg->health_client_get_state.params;
414+
414415
role_param.model = (struct bt_mesh_model *)cb.params->model;
415416
role_param.role = cb.params->msg_role;
416417
if (bt_mesh_set_client_model_role(&role_param)) {
417418
BT_ERR("Failed to set model role");
418419
break;
419420
}
421+
420422
cb.error_code = btc_ble_mesh_health_client_get_state(arg->health_client_get_state.params,
421423
arg->health_client_get_state.get_state);
422424
if (cb.error_code) {
@@ -427,12 +429,14 @@ void btc_ble_mesh_health_client_call_handler(btc_msg_t *msg)
427429
}
428430
case BTC_BLE_MESH_ACT_HEALTH_CLIENT_SET_STATE: {
429431
cb.params = arg->health_client_set_state.params;
432+
430433
role_param.model = (struct bt_mesh_model *)cb.params->model;
431434
role_param.role = cb.params->msg_role;
432435
if (bt_mesh_set_client_model_role(&role_param)) {
433436
BT_ERR("Failed to set model role");
434437
break;
435438
}
439+
436440
cb.error_code = btc_ble_mesh_health_client_set_state(arg->health_client_set_state.params,
437441
arg->health_client_set_state.set_state);
438442
if (cb.error_code) {

components/bt/esp_ble_mesh/btc/btc_ble_mesh_lighting_model.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,14 @@ void btc_ble_mesh_lighting_client_call_handler(btc_msg_t *msg)
310310
switch (msg->act) {
311311
case BTC_BLE_MESH_ACT_LIGHTING_CLIENT_GET_STATE: {
312312
params = arg->light_client_get_state.params;
313+
313314
role_param.model = (struct bt_mesh_model *)params->model;
314315
role_param.role = params->msg_role;
315316
if (bt_mesh_set_client_model_role(&role_param)) {
316317
BT_ERR("Failed to set model role");
317318
break;
318319
}
320+
319321
common.opcode = params->opcode;
320322
common.model = (struct bt_mesh_model *)params->model;
321323
common.ctx.net_idx = params->ctx.net_idx;
@@ -326,8 +328,7 @@ void btc_ble_mesh_lighting_client_call_handler(btc_msg_t *msg)
326328
common.msg_timeout = params->msg_timeout;
327329

328330
cb.params = arg->light_client_get_state.params;
329-
cb.error_code = bt_mesh_light_client_get_state(&common,
330-
(void *)arg->light_client_get_state.get_state, (void *)&cb.status_cb);
331+
cb.error_code = bt_mesh_light_client_get_state(&common, arg->light_client_get_state.get_state);
331332
if (cb.error_code) {
332333
/* If send failed, callback error_code to app layer immediately */
333334
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)
336337
}
337338
case BTC_BLE_MESH_ACT_LIGHTING_CLIENT_SET_STATE: {
338339
params = arg->light_client_set_state.params;
340+
339341
role_param.model = (struct bt_mesh_model *)params->model;
340342
role_param.role = params->msg_role;
341343
if (bt_mesh_set_client_model_role(&role_param)) {
342344
BT_ERR("Failed to set model role");
343345
break;
344346
}
347+
345348
common.opcode = params->opcode;
346349
common.model = (struct bt_mesh_model *)params->model;
347350
common.ctx.net_idx = params->ctx.net_idx;
@@ -352,8 +355,7 @@ void btc_ble_mesh_lighting_client_call_handler(btc_msg_t *msg)
352355
common.msg_timeout = params->msg_timeout;
353356

354357
cb.params = arg->light_client_set_state.params;
355-
cb.error_code = bt_mesh_light_client_set_state(&common,
356-
(void *)arg->light_client_set_state.set_state, (void *)&cb.status_cb);
358+
cb.error_code = bt_mesh_light_client_set_state(&common, arg->light_client_set_state.set_state);
357359
if (cb.error_code) {
358360
/* If send failed, callback error_code to app layer immediately */
359361
btc_ble_mesh_lighting_client_callback(&cb, ESP_BLE_MESH_LIGHT_CLIENT_SET_STATE_EVT);

components/bt/esp_ble_mesh/btc/btc_ble_mesh_sensor_model.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,12 +548,14 @@ void btc_ble_mesh_sensor_client_call_handler(btc_msg_t *msg)
548548
switch (msg->act) {
549549
case BTC_BLE_MESH_ACT_SENSOR_CLIENT_GET_STATE: {
550550
params = arg->sensor_client_get_state.params;
551+
551552
role_param.model = (struct bt_mesh_model *)params->model;
552553
role_param.role = params->msg_role;
553554
if (bt_mesh_set_client_model_role(&role_param)) {
554555
BT_ERR("Failed to set model role");
555556
break;
556557
}
558+
557559
common.opcode = params->opcode;
558560
common.model = (struct bt_mesh_model *)params->model;
559561
common.ctx.net_idx = params->ctx.net_idx;
@@ -564,8 +566,7 @@ void btc_ble_mesh_sensor_client_call_handler(btc_msg_t *msg)
564566
common.msg_timeout = params->msg_timeout;
565567

566568
cb.params = arg->sensor_client_get_state.params;
567-
cb.error_code = bt_mesh_sensor_client_get_state(&common,
568-
(void *)arg->sensor_client_get_state.get_state, (void *)&cb.status_cb);
569+
cb.error_code = bt_mesh_sensor_client_get_state(&common, arg->sensor_client_get_state.get_state);
569570
if (cb.error_code) {
570571
/* If send failed, callback error_code to app layer immediately */
571572
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)
574575
}
575576
case BTC_BLE_MESH_ACT_SENSOR_CLIENT_SET_STATE: {
576577
params = arg->sensor_client_set_state.params;
578+
577579
role_param.model = (struct bt_mesh_model *)params->model;
578580
role_param.role = params->msg_role;
579581
if (bt_mesh_set_client_model_role(&role_param)) {
580582
BT_ERR("Failed to set model role");
581583
break;
582584
}
585+
583586
common.opcode = params->opcode;
584587
common.model = (struct bt_mesh_model *)params->model;
585588
common.ctx.net_idx = params->ctx.net_idx;
@@ -590,8 +593,7 @@ void btc_ble_mesh_sensor_client_call_handler(btc_msg_t *msg)
590593
common.msg_timeout = params->msg_timeout;
591594

592595
cb.params = arg->sensor_client_set_state.params;
593-
cb.error_code = bt_mesh_sensor_client_set_state(&common,
594-
(void *)arg->sensor_client_set_state.set_state, (void *)&cb.status_cb);
596+
cb.error_code = bt_mesh_sensor_client_set_state(&common, arg->sensor_client_set_state.set_state);
595597
if (cb.error_code) {
596598
/* If send failed, callback error_code to app layer immediately */
597599
btc_ble_mesh_sensor_client_callback(&cb, ESP_BLE_MESH_SENSOR_CLIENT_SET_STATE_EVT);

components/bt/esp_ble_mesh/btc/btc_ble_mesh_time_scene_model.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,14 @@ void btc_ble_mesh_time_scene_client_call_handler(btc_msg_t *msg)
312312
switch (msg->act) {
313313
case BTC_BLE_MESH_ACT_TIME_SCENE_CLIENT_GET_STATE: {
314314
params = arg->time_scene_client_get_state.params;
315+
315316
role_param.model = (struct bt_mesh_model *)params->model;
316317
role_param.role = params->msg_role;
317318
if (bt_mesh_set_client_model_role(&role_param)) {
318319
BT_ERR("Failed to set model role");
319320
break;
320321
}
322+
321323
common.opcode = params->opcode;
322324
common.model = (struct bt_mesh_model *)params->model;
323325
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)
328330
common.msg_timeout = params->msg_timeout;
329331

330332
cb.params = arg->time_scene_client_get_state.params;
331-
cb.error_code = bt_mesh_time_scene_client_get_state(&common,
332-
(void *)arg->time_scene_client_get_state.get_state, (void *)&cb.status_cb);
333+
cb.error_code = bt_mesh_time_scene_client_get_state(&common, arg->time_scene_client_get_state.get_state);
333334
if (cb.error_code) {
334335
/* If send failed, callback error_code to app layer immediately */
335336
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)
338339
}
339340
case BTC_BLE_MESH_ACT_TIME_SCENE_CLIENT_SET_STATE: {
340341
params = arg->time_scene_client_set_state.params;
342+
341343
role_param.model = (struct bt_mesh_model *)params->model;
342344
role_param.role = params->msg_role;
343345
if (bt_mesh_set_client_model_role(&role_param)) {
344346
BT_ERR("Failed to set model role");
345347
break;
346348
}
349+
347350
common.opcode = params->opcode;
348351
common.model = (struct bt_mesh_model *)params->model;
349352
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)
354357
common.msg_timeout = params->msg_timeout;
355358

356359
cb.params = arg->time_scene_client_set_state.params;
357-
cb.error_code = bt_mesh_time_scene_client_set_state(&common,
358-
(void *)arg->time_scene_client_set_state.set_state, (void *)&cb.status_cb);
360+
cb.error_code = bt_mesh_time_scene_client_set_state(&common, arg->time_scene_client_set_state.set_state);
359361
if (cb.error_code) {
360362
/* If send failed, callback error_code to app layer immediately */
361363
btc_ble_mesh_time_scene_client_callback(&cb, ESP_BLE_MESH_TIME_SCENE_CLIENT_SET_STATE_EVT);

components/bt/esp_ble_mesh/mesh_models/client/generic_client.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,7 @@ static int gen_set_state(bt_mesh_client_common_param_t *common,
913913
return err;
914914
}
915915

916-
int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common,
917-
void *get, void *status)
916+
int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common, void *get)
918917
{
919918
bt_mesh_generic_client_t *client = NULL;
920919

@@ -977,8 +976,7 @@ int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common,
977976
return gen_get_state(common, get);
978977
}
979978

980-
int bt_mesh_generic_client_set_state(bt_mesh_client_common_param_t *common,
981-
void *set, void *status)
979+
int bt_mesh_generic_client_set_state(bt_mesh_client_common_param_t *common, void *set)
982980
{
983981
bt_mesh_generic_client_t *client = NULL;
984982
u16_t length = 0U;

components/bt/esp_ble_mesh/mesh_models/client/include/generic_client.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -553,24 +553,20 @@ int bt_mesh_gen_property_cli_deinit(struct bt_mesh_model *model, bool primary);
553553
*
554554
* @param[in] common: Message common information structure
555555
* @param[in] get: Pointer of generic get message value
556-
* @param[out] status: Pointer of generic status message value
557556
*
558557
* @return Zero-success, other-fail
559558
*/
560-
int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common,
561-
void *get, void *status);
559+
int bt_mesh_generic_client_get_state(bt_mesh_client_common_param_t *common, void *get);
562560

563561
/**
564562
* @brief This function is called to set generic states.
565563
*
566564
* @param[in] common: Message common information structure
567565
* @param[in] set: Pointer of generic set message value
568-
* @param[out] status: Pointer of generic status message value
569566
*
570567
* @return Zero-success, other-fail
571568
*/
572-
int bt_mesh_generic_client_set_state(bt_mesh_client_common_param_t *common,
573-
void *set, void *status);
569+
int bt_mesh_generic_client_set_state(bt_mesh_client_common_param_t *common, void *set);
574570

575571
#ifdef __cplusplus
576572
}

components/bt/esp_ble_mesh/mesh_models/client/include/lighting_client.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,24 +523,20 @@ int bt_mesh_light_lc_cli_deinit(struct bt_mesh_model *model, bool primary);
523523
*
524524
* @param[in] common: Message common information structure
525525
* @param[in] get: Pointer of light get message value
526-
* @param[out] status: Pointer of light status message value
527526
*
528527
* @return Zero-success, other-fail
529528
*/
530-
int bt_mesh_light_client_get_state(bt_mesh_client_common_param_t *common,
531-
void *get, void *status);
529+
int bt_mesh_light_client_get_state(bt_mesh_client_common_param_t *common, void *get);
532530

533531
/**
534532
* @brief This function is called to set light states.
535533
*
536534
* @param[in] common: Message common information structure
537535
* @param[in] set: Pointer of light set message value
538-
* @param[out] status: Pointer of light status message value
539536
*
540537
* @return Zero-success, other-fail
541538
*/
542-
int bt_mesh_light_client_set_state(bt_mesh_client_common_param_t *common,
543-
void *set, void *status);
539+
int bt_mesh_light_client_set_state(bt_mesh_client_common_param_t *common, void *set);
544540

545541
#ifdef __cplusplus
546542
}

components/bt/esp_ble_mesh/mesh_models/client/include/sensor_client.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,24 +158,20 @@ int bt_mesh_sensor_cli_deinit(struct bt_mesh_model *model, bool primary);
158158
*
159159
* @param[in] common: Message common information structure
160160
* @param[in] get: Pointer of sensor get message value
161-
* @param[out] status: Pointer of sensor status message value
162161
*
163162
* @return Zero-success, other-fail
164163
*/
165-
int bt_mesh_sensor_client_get_state(bt_mesh_client_common_param_t *common,
166-
void *get, void *status);
164+
int bt_mesh_sensor_client_get_state(bt_mesh_client_common_param_t *common, void *get);
167165

168166
/**
169167
* @brief This function is called to set sensor states.
170168
*
171169
* @param[in] common: Message common information structure
172170
* @param[in] set: Pointer of sensor set message value
173-
* @param[out] status: Pointer of sensor status message value
174171
*
175172
* @return Zero-success, other-fail
176173
*/
177-
int bt_mesh_sensor_client_set_state(bt_mesh_client_common_param_t *common,
178-
void *set, void *status);
174+
int bt_mesh_sensor_client_set_state(bt_mesh_client_common_param_t *common, void *set);
179175

180176
#ifdef __cplusplus
181177
}

components/bt/esp_ble_mesh/mesh_models/client/include/time_scene_client.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,24 +268,20 @@ int bt_mesh_scheduler_cli_deinit(struct bt_mesh_model *model, bool primary);
268268
*
269269
* @param[in] common: Message common information structure
270270
* @param[in] get: Pointer of time scene get message value
271-
* @param[out] status: Pointer of time scene status message value
272271
*
273272
* @return Zero-success, other-fail
274273
*/
275-
int bt_mesh_time_scene_client_get_state(bt_mesh_client_common_param_t *common,
276-
void *get, void *status);
274+
int bt_mesh_time_scene_client_get_state(bt_mesh_client_common_param_t *common, void *get);
277275

278276
/**
279277
* @brief This function is called to set scene states.
280278
*
281279
* @param[in] common: Message common information structure
282280
* @param[in] set: Pointer of time scene set message value
283-
* @param[out] status: Pointer of time scene status message value
284281
*
285282
* @return Zero-success, other-fail
286283
*/
287-
int bt_mesh_time_scene_client_set_state(bt_mesh_client_common_param_t *common,
288-
void *set, void *status);
284+
int bt_mesh_time_scene_client_set_state(bt_mesh_client_common_param_t *common, void *set);
289285

290286
#ifdef __cplusplus
291287
}

0 commit comments

Comments
 (0)