Skip to content

Commit 3b0b480

Browse files
authored
Merge pull request #886 from evergreen22/passkey-option
Optional secure pairing with a passkey
2 parents 8ab959b + eca0588 commit 3b0b480

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/components/ble/BatteryInformationService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BatteryInformationService::BatteryInformationService(Controllers::Battery& batte
1717
characteristicDefinition {{.uuid = &batteryLevelUuid.u,
1818
.access_cb = BatteryInformationServiceCallback,
1919
.arg = this,
20-
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_READ_ENC | BLE_GATT_CHR_F_READ_AUTHEN | BLE_GATT_CHR_F_NOTIFY,
20+
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_NOTIFY,
2121
.val_handle = &batteryLevelHandle},
2222
{0}},
2323
serviceDefinition {

src/components/ble/NimbleController.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ void NimbleController::Init() {
134134

135135
RestoreBond();
136136

137-
if (!ble_gap_adv_active() && !bleController.IsConnected()) {
138-
StartAdvertising();
139-
}
137+
StartAdvertising();
140138
}
141139

142140
void NimbleController::StartAdvertising() {
@@ -274,7 +272,7 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
274272
* display capability only so we only handle the "display" action here.
275273
*
276274
* Standards insist that the rand() PRNG be deterministic.
277-
* Use the nimble TRNG here since rand() is predictable.
275+
* Use the tinycrypt prng here since rand() is predictable.
278276
*/
279277
NRF_LOG_INFO("Security event : BLE_GAP_EVENT_PASSKEY_ACTION");
280278
if (event->passkey.params.action == BLE_SM_IOACT_DISP) {

src/components/ble/NimbleController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ namespace Pinetime {
110110
ImmediateAlertService immediateAlertService;
111111
HeartRateService heartRateService;
112112
MotionService motionService;
113-
ServiceDiscovery serviceDiscovery;
114113
FSService fsService;
114+
ServiceDiscovery serviceDiscovery;
115115

116116
uint8_t addrType;
117117
uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;

0 commit comments

Comments
 (0)