mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(ble_mesh): Miscellaneous bugfixes according to our internal bug report
This commit is contained in:
@@ -107,9 +107,11 @@ esp_err_t esp_ble_mesh_scan_params_update(esp_ble_mesh_scan_param_t *scan_param)
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
if (!scan_param) {
|
||||
return ESP_FAIL;
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
|
||||
msg.act = BTC_BLE_MESH_ACT_UPDATE_SCAN_PARAMS;
|
||||
|
||||
@@ -35,6 +35,7 @@ esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp
|
||||
// Create a semaphore
|
||||
if ((semaphore = xSemaphoreCreateCounting(1, 0)) == NULL) {
|
||||
BT_ERR("Failed to create semaphore");
|
||||
bt_mesh_host_deinit();
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
|
||||
@@ -50,6 +51,7 @@ esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp
|
||||
if (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL) != BT_STATUS_SUCCESS) {
|
||||
vSemaphoreDelete(semaphore);
|
||||
BT_ERR("Failed to start mesh init");
|
||||
bt_mesh_host_deinit();
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
|
||||
bt_mesh_model_msg_init(model->pub->msg, opcode);
|
||||
net_buf_simple_add_mem(model->pub->msg, data, length);
|
||||
} else {
|
||||
msg_data = (uint8_t *)bt_mesh_malloc(op_len + length);
|
||||
msg_data = (uint8_t *)bt_mesh_calloc(op_len + length);
|
||||
if (msg_data == NULL) {
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
|
||||
@@ -1249,7 +1249,7 @@ typedef union {
|
||||
* @brief ESP_BLE_MESH_NODE_PROV_OUTPUT_STRING_EVT
|
||||
*/
|
||||
struct ble_mesh_output_str_evt_param {
|
||||
char string[8]; /*!< String of Output OOB Authentication */
|
||||
char string[ESP_BLE_MESH_PROV_OUTPUT_OOB_MAX_LEN + 1]; /*!< String of Output OOB Authentication */
|
||||
} node_prov_output_str; /*!< Event parameter of ESP_BLE_MESH_NODE_PROV_OUTPUT_STRING_EVT */
|
||||
/**
|
||||
* @brief ESP_BLE_MESH_NODE_PROV_INPUT_EVT
|
||||
@@ -1402,7 +1402,7 @@ typedef union {
|
||||
uint8_t link_idx; /*!< Index of the provisioning link */
|
||||
/** Union of output OOB */
|
||||
union {
|
||||
char string[8]; /*!< String output by the Provisioner */
|
||||
char string[ESP_BLE_MESH_PROV_OUTPUT_OOB_MAX_LEN + 1]; /*!< String output by the Provisioner */
|
||||
uint32_t number; /*!< Number output by the Provisioner */
|
||||
};
|
||||
} provisioner_prov_output; /*!< Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_OUTPUT_EVT */
|
||||
|
||||
Reference in New Issue
Block a user