summaryrefslogtreecommitdiff
path: root/src/Components/Ble/BleController.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-06-01 07:22:54 (GMT)
committerJF <jf@codingfield.com>2020-06-01 07:22:54 (GMT)
commitdca559aad5a5020ae0d5c1bec08bbf5030e0d718 (patch)
treedf449fb41a14bb321e69f19f646109c2fb79d093 /src/Components/Ble/BleController.h
parent4717cf0a1d6c210a362e8bdf63265c4910e2c8cc (diff)
Improve DFU procedure :
- correctly write all bytes to flash - check CRC - Fix bug in notification : they cannot be sent from the control point handler (because it seems you cannot send a notification and a write acknowledge at the same time) using a timer (quick'n'dirty implementation to be improved) - Improve dfu screen - Reset if dfu image is correctly copied into flash and crc is ok.
Diffstat (limited to 'src/Components/Ble/BleController.h')
-rw-r--r--src/Components/Ble/BleController.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Components/Ble/BleController.h b/src/Components/Ble/BleController.h
index 65a5ef8..c47e65b 100644
--- a/src/Components/Ble/BleController.h
+++ b/src/Components/Ble/BleController.h
@@ -7,6 +7,7 @@ namespace Pinetime {
namespace Controllers {
class Ble {
public:
+ enum class FirmwareUpdateStates {Idle, Running, Validated, Error};
Ble() = default;
bool IsConnected() const {return isConnected;}
@@ -17,15 +18,18 @@ namespace Pinetime {
void StopFirmwareUpdate();
void FirmwareUpdateTotalBytes(uint32_t totalBytes);
void FirmwareUpdateCurrentBytes(uint32_t currentBytes);
+ void State(FirmwareUpdateStates state) { firmwareUpdateState = state; }
bool IsFirmwareUpdating() const { return isFirmwareUpdating; }
uint32_t FirmwareUpdateTotalBytes() const { return firmwareUpdateTotalBytes; }
uint32_t FirmwareUpdateCurrentBytes() const { return firmwareUpdateCurrentBytes; }
+ FirmwareUpdateStates State() const { return firmwareUpdateState; }
private:
bool isConnected = false;
bool isFirmwareUpdating = false;
uint32_t firmwareUpdateTotalBytes = 0;
uint32_t firmwareUpdateCurrentBytes = 0;
+ FirmwareUpdateStates firmwareUpdateState = FirmwareUpdateStates::Idle;
};
}