aboutsummaryrefslogtreecommitdiff
path: root/ble/OsxBluetooth.h
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-06-30 14:37:06 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-06-30 14:37:06 +0200
commit441cd0b11186d66493798551e1102eb246f1af9f (patch)
tree3cdb5b1dea6b782cbf59e172807f9dc15e7bd418 /ble/OsxBluetooth.h
parentaf63bd5688731b57551ac161c0dad26a0b4557d7 (diff)
downloadble-toys-441cd0b11186d66493798551e1102eb246f1af9f.tar.gz
ble-toys-441cd0b11186d66493798551e1102eb246f1af9f.tar.bz2
ble-toys-441cd0b11186d66493798551e1102eb246f1af9f.tar.xz
ble-toys-441cd0b11186d66493798551e1102eb246f1af9f.zip
Getting started on a port to OSX.
Diffstat (limited to 'ble/OsxBluetooth.h')
-rw-r--r--ble/OsxBluetooth.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/ble/OsxBluetooth.h b/ble/OsxBluetooth.h
new file mode 100644
index 0000000..8fa06a9
--- /dev/null
+++ b/ble/OsxBluetooth.h
@@ -0,0 +1,39 @@
+#ifndef OSX_BLUETOOTH_H
+#define OSX_BLUETOOTH_H
+
+#include <map>
+
+namespace trygvis {
+namespace bluetooth {
+namespace osx {
+
+class OsxBluetoothDevice;
+
+class OsxBluetoothAdapter : public DefaultBluetoothAdapter {
+public:
+ OsxBluetoothAdapter(const string name, Mac &mac);
+
+ ~OsxBluetoothAdapter();
+
+ void startScan() override;
+
+ void stopScan() override;
+
+ void runScan(std::function<void(BluetoothDevice &device)>) override;
+
+ BluetoothDevice &getDevice(Mac &mac) override;
+
+private:
+ bool scanning;
+
+ map<Mac, OsxBluetoothDevice *> devices;
+};
+
+shared_ptr<OsxBluetoothAdapter>&& getAdapterImpl();
+void shutdownImpl();
+
+}
+}
+}
+
+#endif