summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authordvh <dvh@chromium.org>2015-02-11 18:14:33 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-12 02:15:43 +0000
commit965e257296eee98f9f6eef8fb96a0ca6ab99116d (patch)
tree303c2da92aa4ef6710d1495a24f8ee58b0dccb91 /base
parentc72852c0917f4b4c0b457c41897e79d8c99ab209 (diff)
downloadchromium_src-965e257296eee98f9f6eef8fb96a0ca6ab99116d.zip
chromium_src-965e257296eee98f9f6eef8fb96a0ca6ab99116d.tar.gz
chromium_src-965e257296eee98f9f6eef8fb96a0ca6ab99116d.tar.bz2
Added bluetooth LE support on Mac platform
Review URL: https://codereview.chromium.org/911343002 Cr-Commit-Position: refs/heads/master@{#315911}
Diffstat (limited to 'base')
-rw-r--r--base/mac/sdk_forward_declarations.h63
-rw-r--r--base/mac/sdk_forward_declarations.mm4
2 files changed, 67 insertions, 0 deletions
diff --git a/base/mac/sdk_forward_declarations.h b/base/mac/sdk_forward_declarations.h
index faa36ea..2795b19 100644
--- a/base/mac/sdk_forward_declarations.h
+++ b/base/mac/sdk_forward_declarations.h
@@ -219,6 +219,55 @@ BASE_EXPORT extern "C" NSString* const
- (void)windowDidFailToExitFullScreen:(NSWindow*)window;
@end
+BASE_EXPORT extern "C" NSString* const CBAdvertisementDataServiceDataKey;
+
+enum {
+ CBPeripheralStateDisconnected = 0,
+ CBPeripheralStateConnecting,
+ CBPeripheralStateConnected,
+};
+typedef NSInteger CBPeripheralState;
+
+@interface CBPeripheral : NSObject
+@property(readonly, nonatomic) CFUUIDRef UUID;
+@property(retain, readonly) NSString* name;
+@property(readonly) BOOL isConnected;
+@end
+
+enum {
+ CBCentralManagerStateUnknown = 0,
+ CBCentralManagerStateResetting,
+ CBCentralManagerStateUnsupported,
+ CBCentralManagerStateUnauthorized,
+ CBCentralManagerStatePoweredOff,
+ CBCentralManagerStatePoweredOn,
+};
+typedef NSInteger CBCentralManagerState;
+
+@protocol CBCentralManagerDelegate;
+
+@interface CBCentralManager : NSObject
+@property(readonly) CBCentralManagerState state;
+- (id)initWithDelegate:(id<CBCentralManagerDelegate>)delegate
+ queue:(dispatch_queue_t)queue;
+- (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs
+ options:(NSDictionary*)options;
+- (void)stopScan;
+@end
+
+@protocol CBCentralManagerDelegate<NSObject>
+- (void)centralManagerDidUpdateState:(CBCentralManager*)central;
+- (void)centralManager:(CBCentralManager*)central
+ didDiscoverPeripheral:(CBPeripheral*)peripheral
+ advertisementData:(NSDictionary*)advertisementData
+ RSSI:(NSNumber*)RSSI;
+@end
+
+@interface CBUUID : NSObject
+@property(nonatomic, readonly) NSData* data;
++ (CBUUID*)UUIDWithString:(NSString*)theString;
+@end
+
#endif // MAC_OS_X_VERSION_10_7
#if !defined(MAC_OS_X_VERSION_10_8) || \
@@ -232,6 +281,10 @@ enum {
- (CGColorRef)CGColor;
@end
+@interface NSUUID : NSObject
+- (NSString*)UUIDString;
+@end
+
#endif // MAC_OS_X_VERSION_10_8
@@ -304,6 +357,12 @@ enum {
NSWorkspaceLaunchWithErrorPresentation = 0x00000040
};
+@interface CBPeripheral (MavericksSDK)
+@property(readonly, nonatomic) NSUUID* identifier;
+@end
+
+BASE_EXPORT extern "C" NSString* const CBAdvertisementDataIsConnectable;
+
#else // !MAC_OS_X_VERSION_10_9
typedef enum {
@@ -345,6 +404,10 @@ BASE_EXPORT extern "C" NSString* const NSUserActivityTypeBrowsingWeb;
BASE_EXPORT extern "C" NSString* const NSAppearanceNameVibrantDark;
+@interface CBUUID (YosemiteSDK)
+- (NSString*)UUIDString;
+@end
+
#endif // MAC_OS_X_VERSION_10_10
#endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_
diff --git a/base/mac/sdk_forward_declarations.mm b/base/mac/sdk_forward_declarations.mm
index 7a57032..4edc710 100644
--- a/base/mac/sdk_forward_declarations.mm
+++ b/base/mac/sdk_forward_declarations.mm
@@ -23,6 +23,8 @@ NSString* const NSWindowDidExitFullScreenNotification =
NSString* const NSWindowDidChangeBackingPropertiesNotification =
@"NSWindowDidChangeBackingPropertiesNotification";
+NSString* const CBAdvertisementDataServiceDataKey = @"kCBAdvDataServiceData";
+
#endif // MAC_OS_X_VERSION_10_7
// Replicate specific 10.9 SDK declarations for building with prior SDKs.
@@ -32,6 +34,8 @@ NSString* const NSWindowDidChangeBackingPropertiesNotification =
NSString* const NSWindowDidChangeOcclusionStateNotification =
@"NSWindowDidChangeOcclusionStateNotification";
+NSString* const CBAdvertisementDataIsConnectable = @"kCBAdvDataIsConnectable";
+
#endif // MAC_OS_X_VERSION_10_9
// Replicate specific 10.10 SDK declarations for building with prior SDKs.