summaryrefslogtreecommitdiffstats
path: root/base/mac
diff options
context:
space:
mode:
authordvh <dvh@chromium.org>2015-02-06 23:18:37 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-07 07:19:31 +0000
commit42f79f8b08a99190627f3a67e86a378987104a4a (patch)
tree5afdc6d6b471071c1cd4dffa12af4eeaf6309b2f /base/mac
parent1e78d68a5bab1b086119301cb464e8146dcdfde4 (diff)
downloadchromium_src-42f79f8b08a99190627f3a67e86a378987104a4a.zip
chromium_src-42f79f8b08a99190627f3a67e86a378987104a4a.tar.gz
chromium_src-42f79f8b08a99190627f3a67e86a378987104a4a.tar.bz2
Added bluetooth LE support on Mac platform
BUG=449682 Review URL: https://codereview.chromium.org/791763005 Cr-Commit-Position: refs/heads/master@{#315190}
Diffstat (limited to 'base/mac')
-rw-r--r--base/mac/sdk_forward_declarations.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/base/mac/sdk_forward_declarations.h b/base/mac/sdk_forward_declarations.h
index faa36ea..294f206 100644
--- a/base/mac/sdk_forward_declarations.h
+++ b/base/mac/sdk_forward_declarations.h
@@ -219,6 +219,52 @@ BASE_EXPORT extern "C" NSString* const
- (void)windowDidFailToExitFullScreen:(NSWindow*)window;
@end
+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;
+@end
+
#endif // MAC_OS_X_VERSION_10_7
#if !defined(MAC_OS_X_VERSION_10_8) || \
@@ -232,6 +278,10 @@ enum {
- (CGColorRef)CGColor;
@end
+@interface NSUUID : NSObject
+- (NSString*)UUIDString;
+@end
+
#endif // MAC_OS_X_VERSION_10_8
@@ -304,6 +354,10 @@ enum {
NSWorkspaceLaunchWithErrorPresentation = 0x00000040
};
+@interface CBPeripheral (MavericksSDK)
+@property(readonly, nonatomic) NSUUID* identifier;
+@end
+
#else // !MAC_OS_X_VERSION_10_9
typedef enum {
@@ -345,6 +399,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_