Skip to content

Commit 8af38e7

Browse files
committed
Change default security settings to BLE secure connections off.
Fixing some connection issues when enabled, users should enable if desired.
1 parent e7fead9 commit 8af38e7

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

examples/NimBLE_Client/main/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ extern "C" void app_main(void) {
261261
* These are the default values, only shown here for demonstration.
262262
*/
263263
// NimBLEDevice::setSecurityAuth(false, false, true);
264-
265-
NimBLEDevice::setSecurityAuth(/*BLE_SM_PAIR_AUTHREQ_BOND | BLE_SM_PAIR_AUTHREQ_MITM |*/ BLE_SM_PAIR_AUTHREQ_SC);
264+
// NimBLEDevice::setSecurityAuth(BLE_SM_PAIR_AUTHREQ_BOND | BLE_SM_PAIR_AUTHREQ_MITM | BLE_SM_PAIR_AUTHREQ_SC);
266265

267266
/** Optional: set the transmit power */
268267
NimBLEDevice::setPower(3); /** 3dbm */

examples/NimBLE_Server/main/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ extern "C" void app_main(void) {
142142
* These are the default values, only shown here for demonstration.
143143
*/
144144
// NimBLEDevice::setSecurityAuth(false, false, true);
145+
// NimBLEDevice::setSecurityAuth(BLE_SM_PAIR_AUTHREQ_BOND | BLE_SM_PAIR_AUTHREQ_MITM | BLE_SM_PAIR_AUTHREQ_SC);
145146

146-
NimBLEDevice::setSecurityAuth(/*BLE_SM_PAIR_AUTHREQ_BOND | BLE_SM_PAIR_AUTHREQ_MITM |*/ BLE_SM_PAIR_AUTHREQ_SC);
147147
pServer = NimBLEDevice::createServer();
148148
pServer->setCallbacks(&serverCallbacks);
149149

src/NimBLEDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ bool NimBLEDevice::init(const std::string& deviceName) {
977977
ble_hs_cfg.sm_io_cap = BLE_HS_IO_NO_INPUT_OUTPUT;
978978
ble_hs_cfg.sm_bonding = 0;
979979
ble_hs_cfg.sm_mitm = 0;
980-
ble_hs_cfg.sm_sc = 1;
980+
ble_hs_cfg.sm_sc = 0;
981981
ble_hs_cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC;
982982
ble_hs_cfg.sm_their_key_dist = BLE_SM_PAIR_KEY_DIST_ENC;
983983
# if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY)

0 commit comments

Comments
 (0)