aboutsummaryrefslogtreecommitdiffstats
path: root/src/Components/Ble/BleController.h
blob: 4f037fc1d4c9bb4f6cb72f6d46c1d0a5a5a354d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include <FreeRTOS.h>>
#include <queue.h>

namespace Pinetime {
  namespace Controllers {
    class Ble {
      public:
        struct NotificationMessage {
          uint8_t size = 0;
          const char* message = nullptr;
        };

        Ble();
        bool IsConnected() const {return isConnected;}
        void Connect();
        void Disconnect();

        void PushNotification(const char* message, uint8_t size);
        bool PopNotification(NotificationMessage& msg);

      private:
        bool isConnected = false;
        QueueHandle_t notificationQueue;

    };
  }
}