2020-04-19 15:26:09 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
2020-04-25 07:09:47 -04:00
|
|
|
#include "AlertNotificationClient.h"
|
2020-04-23 14:34:38 -04:00
|
|
|
#include "DeviceInformationService.h"
|
2020-04-23 14:57:53 -04:00
|
|
|
#include "CurrentTimeClient.h"
|
2020-04-19 15:26:09 -04:00
|
|
|
#include <host/ble_gap.h>
|
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
2020-04-22 14:19:36 -04:00
|
|
|
class DateTime;
|
2020-04-19 15:26:09 -04:00
|
|
|
class NimbleController {
|
|
|
|
public:
|
2020-04-25 07:09:47 -04:00
|
|
|
NimbleController(Pinetime::System::SystemTask& systemTask, DateTime& dateTimeController, Pinetime::Controllers::NotificationManager& notificationManager);
|
2020-04-19 15:26:09 -04:00
|
|
|
void Init();
|
|
|
|
void StartAdvertising();
|
|
|
|
int OnGAPEvent(ble_gap_event *event);
|
2020-04-23 14:57:53 -04:00
|
|
|
|
2020-04-25 07:09:47 -04:00
|
|
|
int OnDiscoveryEvent(uint16_t i, const ble_gatt_error *pError, const ble_gatt_svc *pSvc);
|
2020-04-19 15:26:09 -04:00
|
|
|
private:
|
|
|
|
static constexpr char* deviceName = "Pinetime-JF";
|
2020-04-25 07:09:47 -04:00
|
|
|
Pinetime::System::SystemTask& systemTask;
|
2020-04-22 14:19:36 -04:00
|
|
|
DateTime& dateTimeController;
|
2020-04-25 07:09:47 -04:00
|
|
|
Pinetime::Controllers::NotificationManager& notificationManager;
|
|
|
|
|
2020-04-23 14:34:38 -04:00
|
|
|
DeviceInformationService deviceInformationService;
|
2020-04-23 14:57:53 -04:00
|
|
|
CurrentTimeClient currentTimeClient;
|
2020-04-25 07:09:47 -04:00
|
|
|
AlertNotificationClient alertNotificationClient;
|
2020-04-19 15:26:09 -04:00
|
|
|
uint8_t addrType;
|
2020-04-22 14:19:36 -04:00
|
|
|
uint16_t connectionHandle;
|
2020-04-19 15:26:09 -04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|