2020-10-29 15:06:01 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <array>
|
2020-11-15 14:05:51 +00:00
|
|
|
#include <cstdint>
|
2020-10-29 15:06:01 +00:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
2020-11-15 14:05:51 +00:00
|
|
|
class BleClient;
|
|
|
|
|
2020-10-29 15:06:01 +00:00
|
|
|
class ServiceDiscovery {
|
2021-04-18 17:28:14 +00:00
|
|
|
public:
|
|
|
|
ServiceDiscovery(std::array<BleClient*, 2>&& bleClients);
|
2020-10-29 15:06:01 +00:00
|
|
|
|
2021-04-18 17:28:14 +00:00
|
|
|
void StartDiscovery(uint16_t connectionHandle);
|
2020-10-29 15:06:01 +00:00
|
|
|
|
2021-04-18 17:28:14 +00:00
|
|
|
private:
|
|
|
|
BleClient** clientIterator;
|
|
|
|
std::array<BleClient*, 2> clients;
|
|
|
|
void OnServiceDiscovered(uint16_t connectionHandle);
|
|
|
|
void DiscoverNextService(uint16_t connectionHandle);
|
2020-10-29 15:06:01 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|