diff options
| author | JF <jf@codingfield.com> | 2020-10-28 17:23:09 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-10-28 17:23:09 (GMT) |
| commit | f90f2254f55086589d1d378d35a54085e2620cb6 (patch) | |
| tree | d74081d6331b36ebdbe0138a45e2a96eca481968 /src/components/ble/CurrentTimeClient.h | |
| parent | cb9e8815d8bc6ce71fd8e97f3e3dae402658ce1f (diff) | |
Reset BLE services on disconnect, do not start advertising if a connection is already established.
Diffstat (limited to 'src/components/ble/CurrentTimeClient.h')
| -rw-r--r-- | src/components/ble/CurrentTimeClient.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/ble/CurrentTimeClient.h b/src/components/ble/CurrentTimeClient.h index 639ec83..fcc124c 100644 --- a/src/components/ble/CurrentTimeClient.h +++ b/src/components/ble/CurrentTimeClient.h @@ -12,11 +12,13 @@ namespace Pinetime { public: explicit CurrentTimeClient(DateTime& dateTimeController); void Init(); + void Reset(); bool OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error *error, const ble_gatt_svc *service); int OnCharacteristicDiscoveryEvent(uint16_t conn_handle, const ble_gatt_error *error, const ble_gatt_chr *characteristic); int OnCurrentTimeReadResult(uint16_t conn_handle, const ble_gatt_error *error, const ble_gatt_attr *attribute); bool IsDiscovered() const; + bool IsCharacteristicDiscovered() const; uint16_t StartHandle() const; uint16_t EndHandle() const; uint16_t CurrentTimeHandle() const; @@ -46,11 +48,14 @@ namespace Pinetime { .value = currentTimeCharacteristicId }; - uint16_t currentTimeHandle; DateTime& dateTimeController; bool isDiscovered = false; uint16_t ctsStartHandle; uint16_t ctsEndHandle; + + bool isCharacteristicDiscovered = false; + uint16_t currentTimeHandle; + }; } }
\ No newline at end of file |
