mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
default to just-works encryption
This patch will turn on encryption when making active connections in order to comply with just-works BLE encryption.
This commit is contained in:
parent
8fb481751f
commit
05bc9e9f1c
1 changed files with 5 additions and 0 deletions
|
@ -158,6 +158,11 @@ bool BLEClientBase::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
|
|||
this->mtu_ = param->cfg_mtu.mtu;
|
||||
break;
|
||||
}
|
||||
case ESP_GATTC_CONNECT_EVT: {
|
||||
ESP_LOGV(TAG, "[%d] [%s] ESP_GATTC_CONNECT_EVT", this->connection_index_, this->address_str_.c_str());
|
||||
esp_ble_set_encryption(param->connect.remote_bda, ESP_BLE_SEC_ENCRYPT);
|
||||
break;
|
||||
}
|
||||
case ESP_GATTC_DISCONNECT_EVT: {
|
||||
if (memcmp(param->disconnect.remote_bda, this->remote_bda_, 6) != 0)
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue