summaryrefslogtreecommitdiff
path: root/src/components/ble/ServiceDiscovery.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-10-29 16:06:01 +0100
committerJF <jf@codingfield.com>2020-10-29 16:06:01 +0100
commit29f8074fcb844cf9668a5bf071e9cffa47299c99 (patch)
tree9b410aee92af82099619c56a4d25c9c6b7c99e68 /src/components/ble/ServiceDiscovery.h
parentf90f2254f55086589d1d378d35a54085e2620cb6 (diff)
Refactoring of BLE service discovery : it is now implemented into the classes of the services.
Diffstat (limited to 'src/components/ble/ServiceDiscovery.h')
-rw-r--r--src/components/ble/ServiceDiscovery.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/components/ble/ServiceDiscovery.h b/src/components/ble/ServiceDiscovery.h
new file mode 100644
index 00000000..c86fc4ec
--- /dev/null
+++ b/src/components/ble/ServiceDiscovery.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <array>
+#include <functional>
+#include <memory>
+#include "BleClient.h"
+
+namespace Pinetime {
+ namespace Controllers {
+ class ServiceDiscovery {
+ public:
+ ServiceDiscovery(std::array<BleClient*, 2>&& bleClients);
+
+ void StartDiscovery(uint16_t connectionHandle);
+
+
+ private:
+ BleClient** clientIterator;
+ std::array<BleClient*, 2> clients;
+ void OnServiceDiscovered(uint16_t connectionHandle);
+ void DiscoverNextService(uint16_t connectionHandle);
+ };
+ }
+}