mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-07-30 18:37:13 +02:00
Change default security settings to BLE secure connections off.
Fixing some connection issues when enabled, users should enable if desired.
This commit is contained in:
@ -261,8 +261,7 @@ extern "C" void app_main(void) {
|
||||
* These are the default values, only shown here for demonstration.
|
||||
*/
|
||||
// NimBLEDevice::setSecurityAuth(false, false, true);
|
||||
|
||||
NimBLEDevice::setSecurityAuth(/*BLE_SM_PAIR_AUTHREQ_BOND | BLE_SM_PAIR_AUTHREQ_MITM |*/ BLE_SM_PAIR_AUTHREQ_SC);
|
||||
// NimBLEDevice::setSecurityAuth(BLE_SM_PAIR_AUTHREQ_BOND | BLE_SM_PAIR_AUTHREQ_MITM | BLE_SM_PAIR_AUTHREQ_SC);
|
||||
|
||||
/** Optional: set the transmit power */
|
||||
NimBLEDevice::setPower(3); /** 3dbm */
|
||||
|
@ -142,8 +142,8 @@ extern "C" void app_main(void) {
|
||||
* These are the default values, only shown here for demonstration.
|
||||
*/
|
||||
// NimBLEDevice::setSecurityAuth(false, false, true);
|
||||
// NimBLEDevice::setSecurityAuth(BLE_SM_PAIR_AUTHREQ_BOND | BLE_SM_PAIR_AUTHREQ_MITM | BLE_SM_PAIR_AUTHREQ_SC);
|
||||
|
||||
NimBLEDevice::setSecurityAuth(/*BLE_SM_PAIR_AUTHREQ_BOND | BLE_SM_PAIR_AUTHREQ_MITM |*/ BLE_SM_PAIR_AUTHREQ_SC);
|
||||
pServer = NimBLEDevice::createServer();
|
||||
pServer->setCallbacks(&serverCallbacks);
|
||||
|
||||
|
@ -977,7 +977,7 @@ bool NimBLEDevice::init(const std::string& deviceName) {
|
||||
ble_hs_cfg.sm_io_cap = BLE_HS_IO_NO_INPUT_OUTPUT;
|
||||
ble_hs_cfg.sm_bonding = 0;
|
||||
ble_hs_cfg.sm_mitm = 0;
|
||||
ble_hs_cfg.sm_sc = 1;
|
||||
ble_hs_cfg.sm_sc = 0;
|
||||
ble_hs_cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC;
|
||||
ble_hs_cfg.sm_their_key_dist = BLE_SM_PAIR_KEY_DIST_ENC;
|
||||
# if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY)
|
||||
|
Reference in New Issue
Block a user