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