aboutsummaryrefslogtreecommitdiff
path: root/ble/OsxBluetoothImpl.h
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-07-10 09:23:49 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-07-10 09:23:49 +0200
commitd945dee5b039e9e2d51b36852ef58a812acab302 (patch)
tree3f7a977b67d2d51726b349088075b23da73592ad /ble/OsxBluetoothImpl.h
parent441cd0b11186d66493798551e1102eb246f1af9f (diff)
downloadble-toys-ios.tar.gz
ble-toys-ios.tar.bz2
ble-toys-ios.tar.xz
ble-toys-ios.zip
o Some iOS experiments. Very WiP.ios
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