2021-10-13 20:08:35 +00:00
|
|
|
#include "components/ble/BleController.h"
|
2019-12-27 16:05:49 +00:00
|
|
|
|
|
|
|
using namespace Pinetime::Controllers;
|
|
|
|
|
2022-02-20 14:40:49 +00:00
|
|
|
bool Ble::IsConnected() const {
|
|
|
|
return isConnected;
|
2019-12-27 16:05:49 +00:00
|
|
|
}
|
|
|
|
|
2022-02-20 14:40:49 +00:00
|
|
|
void Ble::Connect() {
|
|
|
|
isConnected = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Ble::Disconnect() {
|
|
|
|
isConnected = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Ble::IsRadioEnabled() const {
|
|
|
|
return isRadioEnabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Ble::EnableRadio() {
|
|
|
|
isRadioEnabled = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Ble::DisableRadio() {
|
|
|
|
isRadioEnabled = false;
|
2019-12-27 16:05:49 +00:00
|
|
|
}
|
2020-03-25 20:23:40 +00:00
|
|
|
|
2020-05-02 12:16:57 +00:00
|
|
|
void Ble::StartFirmwareUpdate() {
|
|
|
|
isFirmwareUpdating = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Ble::StopFirmwareUpdate() {
|
|
|
|
isFirmwareUpdating = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Ble::FirmwareUpdateTotalBytes(uint32_t totalBytes) {
|
|
|
|
firmwareUpdateTotalBytes = totalBytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Ble::FirmwareUpdateCurrentBytes(uint32_t currentBytes) {
|
|
|
|
firmwareUpdateCurrentBytes = currentBytes;
|
|
|
|
}
|