summaryrefslogtreecommitdiff
path: root/src/Components/Ble/BleController.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-06-07 12:17:45 (GMT)
committerGitea <gitea@fake.local>2020-06-07 12:17:45 (GMT)
commita0e73f5c1a1e652aa6270b7e42a73aee3d12ded6 (patch)
tree6205dfb543bb22245d39a2f6e44d2c26cb381c10 /src/Components/Ble/BleController.h
parent8a94750e30399bfb204cbec59a769d9d1b6b5baa (diff)
parentdbdb26ae1fa45cec88f1b9ea0353b3d0a3c39f56 (diff)
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/Components/Ble/BleController.h')
-rw-r--r--src/Components/Ble/BleController.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Components/Ble/BleController.h b/src/Components/Ble/BleController.h
index f2bd77e..c47e65b 100644
--- a/src/Components/Ble/BleController.h
+++ b/src/Components/Ble/BleController.h
@@ -7,13 +7,29 @@ namespace Pinetime {
namespace Controllers {
class Ble {
public:
+ enum class FirmwareUpdateStates {Idle, Running, Validated, Error};
Ble() = default;
bool IsConnected() const {return isConnected;}
void Connect();
void Disconnect();
+
+ void StartFirmwareUpdate();
+ 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;
};
}