diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-07-10 09:23:49 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-07-10 09:23:49 +0200 |
commit | d945dee5b039e9e2d51b36852ef58a812acab302 (patch) | |
tree | 3f7a977b67d2d51726b349088075b23da73592ad /ble/OsxBluetoothImpl.h | |
parent | 441cd0b11186d66493798551e1102eb246f1af9f (diff) | |
download | ble-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.h | 41 |
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 |