summaryrefslogtreecommitdiff
path: root/src/Components/Ble/NimbleController.h
blob: 2a3969499a869a7ac29cf565319269500a9544b7 (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
#pragma once

#include <cstdint>

#include "DeviceInformationService.h"
#include "CurrentTimeClient.h"
#include <host/ble_gap.h>

namespace Pinetime {
  namespace Controllers {
    class DateTime;
    class NimbleController {
      public:
        NimbleController(DateTime& dateTimeController);
        void Init();
        void StartAdvertising();
        int OnGAPEvent(ble_gap_event *event);

      private:
        static constexpr char* deviceName = "Pinetime-JF";
        DateTime& dateTimeController;
        DeviceInformationService deviceInformationService;
        CurrentTimeClient currentTimeClient;
        uint8_t addrType;
        uint16_t connectionHandle;
    };
  }
}