summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJF <JF002@users.noreply.github.com>2021-12-22 21:34:20 +0100
committerGitHub <noreply@github.com>2021-12-22 21:34:20 +0100
commit3b0b48020d96353fc6cd114aa80fc2fec98363a3 (patch)
tree14da1de820113d24ddf1a5fbbbf65785dee77f41 /src
parent8ab959b4dcd0778c7637ba7934d24dbe59634327 (diff)
parenteca0588c2328a72aee3c6132c7c4221277cb8b28 (diff)
Merge pull request #886 from evergreen22/passkey-option
Optional secure pairing with a passkey
Diffstat (limited to 'src')
-rw-r--r--src/components/ble/BatteryInformationService.cpp2
-rw-r--r--src/components/ble/NimbleController.cpp6
-rw-r--r--src/components/ble/NimbleController.h2
3 files changed, 4 insertions, 6 deletions
diff --git a/src/components/ble/BatteryInformationService.cpp b/src/components/ble/BatteryInformationService.cpp
index 82df7b15..9a3f86f5 100644
--- a/src/components/ble/BatteryInformationService.cpp
+++ b/src/components/ble/BatteryInformationService.cpp
@@ -17,7 +17,7 @@ BatteryInformationService::BatteryInformationService(Controllers::Battery& batte
characteristicDefinition {{.uuid = &batteryLevelUuid.u,
.access_cb = BatteryInformationServiceCallback,
.arg = this,
- .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_READ_ENC | BLE_GATT_CHR_F_READ_AUTHEN | BLE_GATT_CHR_F_NOTIFY,
+ .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_NOTIFY,
.val_handle = &batteryLevelHandle},
{0}},
serviceDefinition {
diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp
index 3bf1ec80..d8510bd3 100644
--- a/src/components/ble/NimbleController.cpp
+++ b/src/components/ble/NimbleController.cpp
@@ -134,9 +134,7 @@ void NimbleController::Init() {
RestoreBond();
- if (!ble_gap_adv_active() && !bleController.IsConnected()) {
- StartAdvertising();
- }
+ StartAdvertising();
}
void NimbleController::StartAdvertising() {
@@ -274,7 +272,7 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
* display capability only so we only handle the "display" action here.
*
* Standards insist that the rand() PRNG be deterministic.
- * Use the nimble TRNG here since rand() is predictable.
+ * Use the tinycrypt prng here since rand() is predictable.
*/
NRF_LOG_INFO("Security event : BLE_GAP_EVENT_PASSKEY_ACTION");
if (event->passkey.params.action == BLE_SM_IOACT_DISP) {
diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h
index 7a387037..2b300e63 100644
--- a/src/components/ble/NimbleController.h
+++ b/src/components/ble/NimbleController.h
@@ -110,8 +110,8 @@ namespace Pinetime {
ImmediateAlertService immediateAlertService;
HeartRateService heartRateService;
MotionService motionService;
- ServiceDiscovery serviceDiscovery;
FSService fsService;
+ ServiceDiscovery serviceDiscovery;
uint8_t addrType;
uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;