aboutsummaryrefslogtreecommitdiff
path: root/ble/OsxBluetoothImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'ble/OsxBluetoothImpl.h')
-rw-r--r--ble/OsxBluetoothImpl.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/ble/OsxBluetoothImpl.h b/ble/OsxBluetoothImpl.h
new file mode 100644
index 0000000..2abea7e
--- /dev/null
+++ b/ble/OsxBluetoothImpl.h
@@ -0,0 +1,41 @@
+#ifndef OSX_BLUETOOTH_IMPL_H
+#define OSX_BLUETOOTH_IMPL_H
+
+#import <CoreFoundation/CoreFoundation.h>
+#import <IOBluetooth/IOBluetoothUtilities.h>
+#import <IOBluetooth/objc/IOBluetoothDeviceInquiry.h>
+#import <IOBluetooth/objc/IOBluetoothSDPUUID.h>
+#import <IOBluetooth/objc/IOBluetoothSDPServiceRecord.h>
+
+namespace trygvis {
+namespace bluetooth {
+namespace osx {
+
+class InquiryDelegate {
+public:
+ InquiryDelegate(OsxBluetoothAdapter &adapter, std::function<void(BluetoothDevice &device)> callback) : adapter(adapter), callback(callback) {
+ }
+
+ void deviceInquiryStarted();
+private:
+ OsxBluetoothAdapter &adapter;
+ std::function<void(BluetoothDevice &device)> callback;
+};
+
+}
+}
+}
+
+// TODO: can this be in a c++ namespace?
+
+@interface InquiryDelegateWrapper : NSObject <IOBluetoothDeviceInquiryDelegate> {
+// - (void)deviceInquiryStarted:(IOBluetoothDeviceInquiry *)sender
+//trygvis::bluetooth::osx::OsxBluetoothAdapter *adapter;
+trygvis::bluetooth::osx::InquiryDelegate* adapter;
+}
+
+- (id) initWithCPPInstance:(trygvis::bluetooth::osx::InquiryDelegate*)adapter;
+- (void)deviceInquiryStarted:(IOBluetoothDeviceInquiry *)sender;
+@end
+
+#endif