diff options
| author | JF <jf@codingfield.com> | 2020-11-10 19:32:36 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-11-10 19:32:36 (GMT) |
| commit | 04abc91f157f5925ffa404728291a69893acf8cf (patch) | |
| tree | 5c887c6d22ba8d901022ebae395a7b6c165d9dc0 /src/Components/Ble/BleController.h | |
| parent | 65ecb65b57bd55582c1aa1a5babd4d76df89e621 (diff) | |
| parent | f0e1f98823e41bfc2d9743fa8de70c882f26f93b (diff) | |
Merge branch 'develop' into master
Diffstat (limited to 'src/Components/Ble/BleController.h')
| -rw-r--r-- | src/Components/Ble/BleController.h | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/Components/Ble/BleController.h b/src/Components/Ble/BleController.h deleted file mode 100644 index 3f52ea2..0000000 --- a/src/Components/Ble/BleController.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -#include <FreeRTOS.h> -#include <queue.h> -#include <array> - -namespace Pinetime { - namespace Controllers { - class Ble { - public: - using BleAddress = std::array<uint8_t, 6>; - enum class FirmwareUpdateStates {Idle, Running, Validated, Error}; - enum class AddressTypes { Public, Random }; - - 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; } - - void Address(BleAddress&& addr) { address = addr; } - const BleAddress& Address() const { return address; } - void AddressType(AddressTypes t) { addressType = t;} - private: - bool isConnected = false; - bool isFirmwareUpdating = false; - uint32_t firmwareUpdateTotalBytes = 0; - uint32_t firmwareUpdateCurrentBytes = 0; - FirmwareUpdateStates firmwareUpdateState = FirmwareUpdateStates::Idle; - BleAddress address; - AddressTypes addressType; - - }; - } -}
\ No newline at end of file |
