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