2019-12-27 11:05:49 -05:00
|
|
|
#pragma once
|
|
|
|
|
2020-04-23 14:34:38 -04:00
|
|
|
#include <FreeRTOS.h>
|
2020-03-25 16:23:40 -04:00
|
|
|
#include <queue.h>
|
|
|
|
|
2019-12-27 11:05:49 -05:00
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
|
|
|
class Ble {
|
|
|
|
public:
|
2020-03-25 16:23:40 -04:00
|
|
|
|
2020-03-28 14:05:28 -04:00
|
|
|
Ble() = default;
|
2019-12-27 11:05:49 -05:00
|
|
|
bool IsConnected() const {return isConnected;}
|
|
|
|
void Connect();
|
|
|
|
void Disconnect();
|
2020-05-02 08:16:57 -04:00
|
|
|
|
|
|
|
void StartFirmwareUpdate();
|
|
|
|
void StopFirmwareUpdate();
|
|
|
|
void FirmwareUpdateTotalBytes(uint32_t totalBytes);
|
|
|
|
void FirmwareUpdateCurrentBytes(uint32_t currentBytes);
|
|
|
|
|
|
|
|
bool IsFirmwareUpdating() const { return isFirmwareUpdating; }
|
|
|
|
uint32_t FirmwareUpdateTotalBytes() const { return firmwareUpdateTotalBytes; }
|
|
|
|
uint32_t FirmwareUpdateCurrentBytes() const { return firmwareUpdateCurrentBytes; }
|
2019-12-27 11:05:49 -05:00
|
|
|
private:
|
|
|
|
bool isConnected = false;
|
2020-05-02 08:16:57 -04:00
|
|
|
bool isFirmwareUpdating = false;
|
|
|
|
uint32_t firmwareUpdateTotalBytes = 0;
|
|
|
|
uint32_t firmwareUpdateCurrentBytes = 0;
|
2020-03-25 16:23:40 -04:00
|
|
|
|
2019-12-27 11:05:49 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|