Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: ios/chrome/common/physical_web/physical_web_scanner.h

Issue 2023833002: [iOS] Upstream physical web classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment about limiting the dependencies Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/common/physical_web/physical_web_scanner.h
diff --git a/ios/chrome/common/physical_web/physical_web_scanner.h b/ios/chrome/common/physical_web/physical_web_scanner.h
new file mode 100644
index 0000000000000000000000000000000000000000..8f28f90ce857792e00dd7d513c5d1e28635c1a20
--- /dev/null
+++ b/ios/chrome/common/physical_web/physical_web_scanner.h
@@ -0,0 +1,59 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_
+#define IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_
+
+#import <Foundation/Foundation.h>
+
+@class PhysicalWebDevice;
+
+@protocol PhysicalWebScannerDelegate;
+
+// This class will scan for physical web devices.
+
+@interface PhysicalWebScanner : NSObject
+
+// When networkRequest is NO, no network request will be sent.
+@property(nonatomic, assign) BOOL networkRequestEnabled;
+
+// When networkRequest is NO, it returns the number of discovered beacons.
+@property(nonatomic, readonly) int unresolvedBeaconsCount;
+
+// Whether bluetooth is enabled. Must not be read before the first call of
+// scannerBluetoothStatusUpdated.
+@property(nonatomic, readonly) BOOL bluetoothEnabled;
+
+// Initializes a physical web device scanner.
+- (instancetype)initWithDelegate:(id<PhysicalWebScannerDelegate>)delegate
+ NS_DESIGNATED_INITIALIZER;
+
+- (instancetype)init NS_UNAVAILABLE;
+
+// Start scanning and clear the list of discovered devices. The scanning might
+// not start effectively immediately.
+// It can happen when the bluetooth is turned off. In this case, scanning will
+// start as soon as the bluetooth is turned on.
+- (void)start;
+
+// Stop scanning.
+- (void)stop;
+
+// Returns a list of physical web devices (PhysicalWebDevice).
+- (NSArray*)devices;
+
+@end
+
+@protocol PhysicalWebScannerDelegate<NSObject>
+
+// This delegate method is called when the list of discovered devices is updated
+// by the scanner.
+- (void)scannerUpdatedDevices:(PhysicalWebScanner*)scanner;
+
+// This delegate method is called when the bluetooth status is updated.
+- (void)scannerBluetoothStatusUpdated:(PhysicalWebScanner*)scanner;
+
+@end
+
+#endif // IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_
« no previous file with comments | « ios/chrome/common/physical_web/physical_web_request.mm ('k') | ios/chrome/common/physical_web/physical_web_scanner.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698