Skip to content

Commit

Permalink
Merge branch 'bugfix/adapt_new_btc_v4.3' into 'release/v4.3'
Browse files Browse the repository at this point in the history
ble_mesh: stack: Corrected parameter size when the btc_transfer_context is used (v4.3)

See merge request espressif/esp-idf!20167
  • Loading branch information
Isl2017 committed Sep 18, 2022
2 parents 2ee1a33 + eb4ec4b commit 2636907
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion components/bt/esp_ble_mesh/btc/btc_ble_mesh_ble.c
Expand Up @@ -90,7 +90,7 @@ static void btc_ble_mesh_ble_callback(esp_ble_mesh_ble_cb_param_t *cb_params, ui
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_ble_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_ble_cb_param_t),
btc_ble_mesh_ble_copy_req_data);
}

Expand Down
4 changes: 2 additions & 2 deletions components/bt/esp_ble_mesh/btc/btc_ble_mesh_config_model.c
Expand Up @@ -306,7 +306,7 @@ static void btc_ble_mesh_config_client_callback(esp_ble_mesh_cfg_client_cb_param
msg.pid = BTC_PID_CONFIG_CLIENT;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_cfg_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_cfg_client_cb_param_t),
btc_ble_mesh_config_client_copy_req_data);
}

Expand Down Expand Up @@ -710,7 +710,7 @@ static void btc_ble_mesh_config_server_callback(esp_ble_mesh_cfg_server_cb_param
msg.pid = BTC_PID_CONFIG_SERVER;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_cfg_server_cb_param_t), NULL);
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_cfg_server_cb_param_t), NULL);
}

void bt_mesh_config_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,
Expand Down
4 changes: 2 additions & 2 deletions components/bt/esp_ble_mesh/btc/btc_ble_mesh_generic_model.c
Expand Up @@ -376,7 +376,7 @@ static void btc_ble_mesh_generic_client_callback(esp_ble_mesh_generic_client_cb_
msg.pid = BTC_PID_GENERIC_CLIENT;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_generic_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_generic_client_cb_param_t),
btc_ble_mesh_generic_client_copy_req_data);
}

Expand Down Expand Up @@ -693,7 +693,7 @@ static void btc_ble_mesh_generic_server_callback(esp_ble_mesh_generic_server_cb_
msg.pid = BTC_PID_GENERIC_SERVER;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_generic_server_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_generic_server_cb_param_t),
btc_ble_mesh_generic_server_copy_req_data);
}

Expand Down
4 changes: 2 additions & 2 deletions components/bt/esp_ble_mesh/btc/btc_ble_mesh_health_model.c
Expand Up @@ -239,7 +239,7 @@ static void btc_ble_mesh_health_client_callback(esp_ble_mesh_health_client_cb_pa
msg.pid = BTC_PID_HEALTH_CLIENT;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_health_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_health_client_cb_param_t),
btc_ble_mesh_health_client_copy_req_data);
}

Expand Down Expand Up @@ -550,7 +550,7 @@ static void btc_ble_mesh_health_server_callback(esp_ble_mesh_health_server_cb_pa
msg.pid = BTC_PID_HEALTH_SERVER;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_health_server_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_health_server_cb_param_t),
btc_ble_mesh_health_server_copy_req_data);
}

Expand Down
4 changes: 2 additions & 2 deletions components/bt/esp_ble_mesh/btc/btc_ble_mesh_lighting_model.c
Expand Up @@ -220,7 +220,7 @@ static void btc_ble_mesh_lighting_client_callback(esp_ble_mesh_light_client_cb_p
msg.pid = BTC_PID_LIGHTING_CLIENT;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_light_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_light_client_cb_param_t),
btc_ble_mesh_lighting_client_copy_req_data);
}

Expand Down Expand Up @@ -505,7 +505,7 @@ static void btc_ble_mesh_lighting_server_callback(esp_ble_mesh_lighting_server_c
msg.pid = BTC_PID_LIGHTING_SERVER;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_lighting_server_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_lighting_server_cb_param_t),
btc_ble_mesh_lighting_server_copy_req_data);
}

Expand Down
4 changes: 2 additions & 2 deletions components/bt/esp_ble_mesh/btc/btc_ble_mesh_prov.c
Expand Up @@ -376,7 +376,7 @@ static bt_status_t btc_ble_mesh_model_callback(esp_ble_mesh_model_cb_param_t *pa
msg.pid = BTC_PID_MODEL;
msg.act = act;

ret = btc_transfer_context(&msg, param, sizeof(esp_ble_mesh_model_cb_param_t),
ret = btc_transfer_context(&msg, param, param == NULL ? 0 : sizeof(esp_ble_mesh_model_cb_param_t),
btc_ble_mesh_model_copy_req_data);
if (ret != BT_STATUS_SUCCESS) {
BT_ERR("btc_transfer_context failed");
Expand Down Expand Up @@ -536,7 +536,7 @@ static bt_status_t btc_ble_mesh_prov_callback(esp_ble_mesh_prov_cb_param_t *para
msg.pid = BTC_PID_PROV;
msg.act = act;

ret = btc_transfer_context(&msg, param, sizeof(esp_ble_mesh_prov_cb_param_t), NULL);
ret = btc_transfer_context(&msg, param, param == NULL ? 0 : sizeof(esp_ble_mesh_prov_cb_param_t), NULL);
if (ret != BT_STATUS_SUCCESS) {
BT_ERR("btc_transfer_context failed");
}
Expand Down
4 changes: 2 additions & 2 deletions components/bt/esp_ble_mesh/btc/btc_ble_mesh_sensor_model.c
Expand Up @@ -458,7 +458,7 @@ static void btc_ble_mesh_sensor_client_callback(esp_ble_mesh_sensor_client_cb_pa
msg.pid = BTC_PID_SENSOR_CLIENT;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_sensor_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_sensor_client_cb_param_t),
btc_ble_mesh_sensor_client_copy_req_data);
}

Expand Down Expand Up @@ -825,7 +825,7 @@ static void btc_ble_mesh_sensor_server_callback(esp_ble_mesh_sensor_server_cb_pa
msg.pid = BTC_PID_SENSOR_SERVER;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_sensor_server_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_sensor_server_cb_param_t),
btc_ble_mesh_sensor_server_copy_req_data);
}

Expand Down
Expand Up @@ -222,7 +222,7 @@ static void btc_ble_mesh_time_scene_client_callback(esp_ble_mesh_time_scene_clie
msg.pid = BTC_PID_TIME_SCENE_CLIENT;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_time_scene_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_time_scene_client_cb_param_t),
btc_ble_mesh_time_scene_client_copy_req_data);
}

Expand Down Expand Up @@ -409,7 +409,7 @@ static void btc_ble_mesh_time_scene_server_callback(esp_ble_mesh_time_scene_serv
msg.pid = BTC_PID_TIME_SCENE_SERVER;
msg.act = act;

btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_time_scene_server_cb_param_t), NULL);
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_time_scene_server_cb_param_t), NULL);
}

void bt_mesh_time_scene_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,
Expand Down

0 comments on commit 2636907

Please sign in to comment.