2019-12-27 16:05:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-03-25 20:23:40 +00:00
|
|
|
#include <FreeRTOS.h>>
|
|
|
|
#include <queue.h>
|
|
|
|
|
2019-12-27 16:05:49 +00:00
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
|
|
|
class Ble {
|
|
|
|
public:
|
2020-03-25 20:23:40 +00:00
|
|
|
struct NotificationMessage {
|
|
|
|
uint8_t size = 0;
|
|
|
|
const char* message = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
Ble();
|
2019-12-27 16:05:49 +00:00
|
|
|
bool IsConnected() const {return isConnected;}
|
|
|
|
void Connect();
|
|
|
|
void Disconnect();
|
|
|
|
|
2020-03-25 20:23:40 +00:00
|
|
|
void PushNotification(const char* message, uint8_t size);
|
|
|
|
bool PopNotification(NotificationMessage& msg);
|
|
|
|
|
2019-12-27 16:05:49 +00:00
|
|
|
private:
|
|
|
|
bool isConnected = false;
|
2020-03-25 20:23:40 +00:00
|
|
|
QueueHandle_t notificationQueue;
|
|
|
|
|
2019-12-27 16:05:49 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|