Merge branch 'bugfix/prov_fix_conn_id' into 'master'
Unified Provisioning: Miscellaneous fixes in BLE See merge request idf/esp-idf!4691
This commit is contained in:
commit
911e503a36
2 changed files with 9 additions and 2 deletions
|
@ -189,7 +189,14 @@ esp_err_t simple_ble_start(simple_ble_cfg_t *cfg)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_BTDM_CONTROLLER_MODE_BTDM
|
||||||
|
ret = esp_bt_controller_enable(ESP_BT_MODE_BTDM);
|
||||||
|
#elif defined CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY
|
||||||
ret = esp_bt_controller_enable(ESP_BT_MODE_BLE);
|
ret = esp_bt_controller_enable(ESP_BT_MODE_BLE);
|
||||||
|
#else
|
||||||
|
ESP_LOGE(TAG, "Configuration mismatch. Select BLE Only or BTDM mode from menuconfig");
|
||||||
|
return ESP_FAIL;
|
||||||
|
#endif
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ESP_LOGE(TAG, "%s enable controller failed %d", __func__, ret);
|
ESP_LOGE(TAG, "%s enable controller failed %d", __func__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -201,7 +201,7 @@ static void transport_simple_ble_write(esp_gatts_cb_event_t event, esp_gatt_if_t
|
||||||
|
|
||||||
ret = protocomm_req_handle(protoble_internal->pc_ble,
|
ret = protocomm_req_handle(protoble_internal->pc_ble,
|
||||||
handle_to_handler(param->write.handle),
|
handle_to_handler(param->write.handle),
|
||||||
param->exec_write.conn_id,
|
param->write.conn_id,
|
||||||
param->write.value,
|
param->write.value,
|
||||||
param->write.len,
|
param->write.len,
|
||||||
&outbuf, &outlen);
|
&outbuf, &outlen);
|
||||||
|
@ -246,7 +246,7 @@ static void transport_simple_ble_exec_write(esp_gatts_cb_event_t event, esp_gatt
|
||||||
|
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Invalid content received, killing connection");
|
ESP_LOGE(TAG, "Invalid content received, killing connection");
|
||||||
esp_ble_gatts_close(gatts_if, param->write.conn_id);
|
esp_ble_gatts_close(gatts_if, param->exec_write.conn_id);
|
||||||
} else {
|
} else {
|
||||||
hexdump("Response from exec write", outbuf, outlen);
|
hexdump("Response from exec write", outbuf, outlen);
|
||||||
esp_ble_gatts_set_attr_value(prepare_write_env.handle, outlen, outbuf);
|
esp_ble_gatts_set_attr_value(prepare_write_env.handle, outlen, outbuf);
|
||||||
|
|
Loading…
Reference in a new issue