summaryrefslogtreecommitdiff
path: root/src/components/ble/AlertNotificationClient.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-10-28 18:23:09 +0100
committerJF <jf@codingfield.com>2020-10-28 18:23:09 +0100
commitf90f2254f55086589d1d378d35a54085e2620cb6 (patch)
treed74081d6331b36ebdbe0138a45e2a96eca481968 /src/components/ble/AlertNotificationClient.h
parentcb9e8815d8bc6ce71fd8e97f3e3dae402658ce1f (diff)
Reset BLE services on disconnect, do not start advertising if a connection is already established.
Diffstat (limited to 'src/components/ble/AlertNotificationClient.h')
-rw-r--r--src/components/ble/AlertNotificationClient.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/components/ble/AlertNotificationClient.h b/src/components/ble/AlertNotificationClient.h
index ca4f4e94..ebd5d56f 100644
--- a/src/components/ble/AlertNotificationClient.h
+++ b/src/components/ble/AlertNotificationClient.h
@@ -27,6 +27,7 @@ namespace Pinetime {
bool IsDiscovered() const;
uint16_t StartHandle() const;
uint16_t EndHandle() const;
+ void Reset();
static constexpr const ble_uuid16_t &Uuid() { return ansServiceUuid; }
@@ -64,15 +65,15 @@ namespace Pinetime {
.value = controlPointId
};
- uint16_t ansStartHandle;
- uint16_t ansEndHandle;
- uint16_t supportedNewAlertCategoryHandle;
- uint16_t supportedUnreadAlertCategoryHandle;
- uint16_t newAlertHandle;
+ uint16_t ansStartHandle = 0;
+ uint16_t ansEndHandle = 0;
+ uint16_t supportedNewAlertCategoryHandle = 0;
+ uint16_t supportedUnreadAlertCategoryHandle = 0;
+ uint16_t newAlertHandle = 0;
uint16_t newAlertDescriptorHandle = 0;
- uint16_t newAlertDefHandle;
- uint16_t unreadAlertStatusHandle;
- uint16_t controlPointHandle;
+ uint16_t newAlertDefHandle = 0;
+ uint16_t unreadAlertStatusHandle = 0;
+ uint16_t controlPointHandle = 0;
bool isDiscovered = false;
Pinetime::System::SystemTask &systemTask;
Pinetime::Controllers::NotificationManager &notificationManager;