diff options
author | JF <jf@codingfield.com> | 2020-06-01 16:30:24 +0200 |
---|---|---|
committer | JF <jf@codingfield.com> | 2020-06-01 16:30:24 +0200 |
commit | 07f74cee63d77882191c8ce53c598f91e6159ba8 (patch) | |
tree | f7490e5ace467a881a2e863e9af0163842bb94db /src/Components/Ble/DfuService.h | |
parent | b41a856b9dced4d8acf249e8c63e0c95c1b3e2e5 (diff) |
DFU : add timeout detection : abort dfu procedure after 10s without any data from the host.
Diffstat (limited to 'src/Components/Ble/DfuService.h')
-rw-r--r-- | src/Components/Ble/DfuService.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Components/Ble/DfuService.h b/src/Components/Ble/DfuService.h index 3de17f9f..73846c86 100644 --- a/src/Components/Ble/DfuService.h +++ b/src/Components/Ble/DfuService.h @@ -26,6 +26,9 @@ namespace Pinetime { int OnServiceData(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context); void OnNotificationTimer(); + void OnTimeout(); + + void Reset(); private: Pinetime::System::SystemTask &systemTask; @@ -125,11 +128,9 @@ namespace Pinetime { uint16_t ComputeCrc(uint8_t const *p_data, uint32_t size, uint16_t const *p_crc); - bool firstCrc = true; - uint16_t tempCrc = 0; - void WriteMagicNumber(); TimerHandle_t notificationTimer; + TimerHandle_t timeoutTimer; uint16_t notificatonConnectionHandle = 0; size_t notificationSize = 0; |