aboutsummaryrefslogtreecommitdiffstats
path: root/src/Components/Ble/NimbleController.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-04-19 21:26:09 +0200
committerJF <jf@codingfield.com>2020-04-19 21:26:09 +0200
commit2c9ce1cfc7d4c733b1b35f51a1f6f5da332cf3fa (patch)
tree81a915bf58eb15a7a7fccea1209a3d1081be8074 /src/Components/Ble/NimbleController.h
parentdd6aecbf6b343e40f75808f5e26a077eb22a2ed2 (diff)
Encapsulate nimble code into NimbleController.
Handle all GAP events.
Diffstat (limited to 'src/Components/Ble/NimbleController.h')
-rw-r--r--src/Components/Ble/NimbleController.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Components/Ble/NimbleController.h b/src/Components/Ble/NimbleController.h
new file mode 100644
index 00000000..1901b14e
--- /dev/null
+++ b/src/Components/Ble/NimbleController.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <cstdint>
+#include <host/ble_gap.h>
+
+namespace Pinetime {
+ namespace Controllers {
+
+ class NimbleController {
+ public:
+ void Init();
+ void StartAdvertising();
+ int OnGAPEvent(ble_gap_event *event);
+ private:
+ static constexpr char* deviceName = "Pinetime-JF";
+ uint8_t addrType;
+ };
+ }
+}