2020-04-19 21:26:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
2020-04-23 20:34:38 +02:00
|
|
|
|
|
|
|
#include "DeviceInformationService.h"
|
2020-04-23 20:57:53 +02:00
|
|
|
#include "CurrentTimeClient.h"
|
2020-04-19 21:26:09 +02:00
|
|
|
#include <host/ble_gap.h>
|
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
2020-04-22 20:19:36 +02:00
|
|
|
class DateTime;
|
2020-04-19 21:26:09 +02:00
|
|
|
class NimbleController {
|
|
|
|
public:
|
2020-04-22 20:19:36 +02:00
|
|
|
NimbleController(DateTime& dateTimeController);
|
2020-04-19 21:26:09 +02:00
|
|
|
void Init();
|
|
|
|
void StartAdvertising();
|
|
|
|
int OnGAPEvent(ble_gap_event *event);
|
2020-04-23 20:57:53 +02:00
|
|
|
|
2020-04-19 21:26:09 +02:00
|
|
|
private:
|
|
|
|
static constexpr char* deviceName = "Pinetime-JF";
|
2020-04-22 20:19:36 +02:00
|
|
|
DateTime& dateTimeController;
|
2020-04-23 20:34:38 +02:00
|
|
|
DeviceInformationService deviceInformationService;
|
2020-04-23 20:57:53 +02:00
|
|
|
CurrentTimeClient currentTimeClient;
|
2020-04-19 21:26:09 +02:00
|
|
|
uint8_t addrType;
|
2020-04-22 20:19:36 +02:00
|
|
|
uint16_t connectionHandle;
|
2020-04-19 21:26:09 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|