Changed access modified indentation
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Pinetime {
|
||||
class NotificationManager;
|
||||
|
||||
class AlertNotificationClient : public BleClient {
|
||||
public:
|
||||
public:
|
||||
explicit AlertNotificationClient(Pinetime::System::SystemTask& systemTask,
|
||||
Pinetime::Controllers::NotificationManager& notificationManager);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Pinetime {
|
||||
void Reset();
|
||||
void Discover(uint16_t connectionHandle, std::function<void(uint16_t)> lambda) override;
|
||||
|
||||
private:
|
||||
private:
|
||||
static constexpr uint16_t ansServiceId {0x1811};
|
||||
static constexpr uint16_t supportedNewAlertCategoryId = 0x2a47;
|
||||
static constexpr uint16_t supportedUnreadAlertCategoryId = 0x2a48;
|
||||
|
@@ -20,7 +20,7 @@ namespace Pinetime {
|
||||
class NotificationManager;
|
||||
|
||||
class AlertNotificationService {
|
||||
public:
|
||||
public:
|
||||
AlertNotificationService(Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::NotificationManager& notificationManager);
|
||||
void Init();
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Pinetime {
|
||||
|
||||
enum class IncomingCallResponses : uint8_t { Reject = 0x00, Answer = 0x01, Mute = 0x02 };
|
||||
|
||||
private:
|
||||
private:
|
||||
enum class Categories : uint8_t {
|
||||
SimpleAlert = 0x00,
|
||||
Email = 0x01,
|
||||
|
@@ -12,13 +12,13 @@ namespace Pinetime {
|
||||
namespace Controllers {
|
||||
class Battery;
|
||||
class BatteryInformationService {
|
||||
public:
|
||||
public:
|
||||
BatteryInformationService(Controllers::Battery& batteryController);
|
||||
void Init();
|
||||
|
||||
int OnBatteryServiceRequested(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt* context);
|
||||
|
||||
private:
|
||||
private:
|
||||
Controllers::Battery& batteryController;
|
||||
static constexpr uint16_t batteryInformationServiceId {0x180F};
|
||||
static constexpr uint16_t batteryLevelId {0x2A19};
|
||||
|
@@ -5,7 +5,7 @@
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
class BleClient {
|
||||
public:
|
||||
public:
|
||||
virtual void Discover(uint16_t connectionHandle, std::function<void(uint16_t)> lambda) = 0;
|
||||
};
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
class Ble {
|
||||
public:
|
||||
public:
|
||||
using BleAddress = std::array<uint8_t, 6>;
|
||||
enum class FirmwareUpdateStates { Idle, Running, Validated, Error };
|
||||
enum class AddressTypes { Public, Random };
|
||||
@@ -49,7 +49,7 @@ namespace Pinetime {
|
||||
addressType = t;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
bool isConnected = false;
|
||||
bool isFirmwareUpdating = false;
|
||||
uint32_t firmwareUpdateTotalBytes = 0;
|
||||
|
@@ -12,7 +12,7 @@ namespace Pinetime {
|
||||
class DateTime;
|
||||
|
||||
class CurrentTimeClient : public BleClient {
|
||||
public:
|
||||
public:
|
||||
explicit CurrentTimeClient(DateTime& dateTimeController);
|
||||
void Init();
|
||||
void Reset();
|
||||
@@ -27,7 +27,7 @@ namespace Pinetime {
|
||||
}
|
||||
void Discover(uint16_t connectionHandle, std::function<void(uint16_t)> lambda) override;
|
||||
|
||||
private:
|
||||
private:
|
||||
typedef struct __attribute__((packed)) {
|
||||
uint16_t year;
|
||||
uint8_t month;
|
||||
|
@@ -12,13 +12,13 @@
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
class CurrentTimeService {
|
||||
public:
|
||||
public:
|
||||
CurrentTimeService(DateTime& dateTimeController);
|
||||
void Init();
|
||||
|
||||
int OnTimeAccessed(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt);
|
||||
|
||||
private:
|
||||
private:
|
||||
static constexpr uint16_t ctsId {0x1805};
|
||||
static constexpr uint16_t ctsCharId {0x2a2b};
|
||||
|
||||
|
@@ -9,13 +9,13 @@
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
class DeviceInformationService {
|
||||
public:
|
||||
public:
|
||||
DeviceInformationService();
|
||||
void Init();
|
||||
|
||||
int OnDeviceInfoRequested(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt);
|
||||
|
||||
private:
|
||||
private:
|
||||
static constexpr uint16_t deviceInfoId {0x180a};
|
||||
static constexpr uint16_t manufacturerNameId {0x2a29};
|
||||
static constexpr uint16_t modelNumberId {0x2a24};
|
||||
|
@@ -20,7 +20,7 @@ namespace Pinetime {
|
||||
class Ble;
|
||||
|
||||
class DfuService {
|
||||
public:
|
||||
public:
|
||||
DfuService(Pinetime::System::SystemTask& systemTask,
|
||||
Pinetime::Controllers::Ble& bleController,
|
||||
Pinetime::Drivers::SpiNorFlash& spiNorFlash);
|
||||
@@ -30,24 +30,24 @@ namespace Pinetime {
|
||||
void Reset();
|
||||
|
||||
class NotificationManager {
|
||||
public:
|
||||
public:
|
||||
NotificationManager();
|
||||
bool AsyncSend(uint16_t connection, uint16_t charactHandle, uint8_t* data, size_t size);
|
||||
void Send(uint16_t connection, uint16_t characteristicHandle, const uint8_t* data, const size_t s);
|
||||
|
||||
private:
|
||||
private:
|
||||
TimerHandle_t timer;
|
||||
uint16_t connectionHandle = 0;
|
||||
uint16_t characteristicHandle = 0;
|
||||
size_t size = 0;
|
||||
uint8_t buffer[10];
|
||||
|
||||
public:
|
||||
public:
|
||||
void OnNotificationTimer();
|
||||
void Reset();
|
||||
};
|
||||
class DfuImage {
|
||||
public:
|
||||
public:
|
||||
DfuImage(Pinetime::Drivers::SpiNorFlash& spiNorFlash) : spiNorFlash {spiNorFlash} {
|
||||
}
|
||||
void Init(size_t chunkSize, size_t totalSize, uint16_t expectedCrc);
|
||||
@@ -56,7 +56,7 @@ namespace Pinetime {
|
||||
bool Validate();
|
||||
bool IsComplete();
|
||||
|
||||
private:
|
||||
private:
|
||||
Pinetime::Drivers::SpiNorFlash& spiNorFlash;
|
||||
static constexpr size_t bufferSize = 200;
|
||||
bool ready = false;
|
||||
@@ -73,7 +73,7 @@ namespace Pinetime {
|
||||
uint16_t ComputeCrc(uint8_t const* p_data, uint32_t size, uint16_t const* p_crc);
|
||||
};
|
||||
|
||||
private:
|
||||
private:
|
||||
Pinetime::System::SystemTask& systemTask;
|
||||
Pinetime::Controllers::Ble& bleController;
|
||||
DfuImage dfuImage;
|
||||
|
@@ -12,13 +12,13 @@ namespace Pinetime {
|
||||
namespace Controllers {
|
||||
class HeartRateController;
|
||||
class HeartRateService {
|
||||
public:
|
||||
public:
|
||||
HeartRateService(Pinetime::System::SystemTask& system, Controllers::HeartRateController& heartRateController);
|
||||
void Init();
|
||||
int OnHeartRateRequested(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt* context);
|
||||
void OnNewHeartRateValue(uint8_t hearRateValue);
|
||||
|
||||
private:
|
||||
private:
|
||||
Pinetime::System::SystemTask& system;
|
||||
Controllers::HeartRateController& heartRateController;
|
||||
static constexpr uint16_t heartRateServiceId {0x180D};
|
||||
|
@@ -12,14 +12,14 @@ namespace Pinetime {
|
||||
namespace Controllers {
|
||||
class NotificationManager;
|
||||
class ImmediateAlertService {
|
||||
public:
|
||||
public:
|
||||
enum class Levels : uint8_t { NoAlert = 0, MildAlert = 1, HighAlert = 2 };
|
||||
|
||||
ImmediateAlertService(Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::NotificationManager& notificationManager);
|
||||
void Init();
|
||||
int OnAlertLevelChanged(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt* context);
|
||||
|
||||
private:
|
||||
private:
|
||||
Pinetime::System::SystemTask& systemTask;
|
||||
NotificationManager& notificationManager;
|
||||
|
||||
|
@@ -37,7 +37,7 @@ namespace Pinetime {
|
||||
namespace Controllers {
|
||||
|
||||
class MusicService {
|
||||
public:
|
||||
public:
|
||||
explicit MusicService(Pinetime::System::SystemTask& system);
|
||||
|
||||
void Init();
|
||||
@@ -70,7 +70,7 @@ namespace Pinetime {
|
||||
|
||||
enum MusicStatus { NotPlaying = 0x00, Playing = 0x01 };
|
||||
|
||||
private:
|
||||
private:
|
||||
static constexpr uint8_t msId[2] = {0x00, 0x00};
|
||||
static constexpr uint8_t msEventCharId[2] = {0x01, 0x00};
|
||||
static constexpr uint8_t msStatusCharId[2] = {0x02, 0x00};
|
||||
|
@@ -37,7 +37,7 @@ namespace Pinetime {
|
||||
namespace Controllers {
|
||||
|
||||
class NavigationService {
|
||||
public:
|
||||
public:
|
||||
explicit NavigationService(Pinetime::System::SystemTask& system);
|
||||
|
||||
void Init();
|
||||
@@ -52,7 +52,7 @@ namespace Pinetime {
|
||||
|
||||
int getProgress();
|
||||
|
||||
private:
|
||||
private:
|
||||
static constexpr uint8_t navId[2] = {0x01, 0x00};
|
||||
static constexpr uint8_t navFlagCharId[2] = {0x01, 0x00};
|
||||
static constexpr uint8_t navNarrativeCharId[2] = {0x02, 0x00};
|
||||
|
@@ -36,7 +36,7 @@ namespace Pinetime {
|
||||
|
||||
class NimbleController {
|
||||
|
||||
public:
|
||||
public:
|
||||
NimbleController(Pinetime::System::SystemTask& systemTask,
|
||||
Pinetime::Controllers::Ble& bleController,
|
||||
DateTime& dateTimeController,
|
||||
@@ -71,7 +71,7 @@ namespace Pinetime {
|
||||
|
||||
uint16_t connHandle();
|
||||
|
||||
private:
|
||||
private:
|
||||
static constexpr const char* deviceName = "InfiniTime";
|
||||
Pinetime::System::SystemTask& systemTask;
|
||||
Pinetime::Controllers::Ble& bleController;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
class NotificationManager {
|
||||
public:
|
||||
public:
|
||||
enum class Categories {
|
||||
Unknown,
|
||||
SimpleAlert,
|
||||
@@ -52,7 +52,7 @@ namespace Pinetime {
|
||||
};
|
||||
size_t NbNotifications() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
Notification::Id GetNextId();
|
||||
static constexpr uint8_t TotalNbNotifications = 5;
|
||||
std::array<Notification, TotalNbNotifications> notifications;
|
||||
|
@@ -8,12 +8,12 @@ namespace Pinetime {
|
||||
class BleClient;
|
||||
|
||||
class ServiceDiscovery {
|
||||
public:
|
||||
public:
|
||||
ServiceDiscovery(std::array<BleClient*, 2>&& bleClients);
|
||||
|
||||
void StartDiscovery(uint16_t connectionHandle);
|
||||
|
||||
private:
|
||||
private:
|
||||
BleClient** clientIterator;
|
||||
std::array<BleClient*, 2> clients;
|
||||
void OnServiceDiscovered(uint16_t connectionHandle);
|
||||
|
Reference in New Issue
Block a user