Overview
A class that asynchronously scans for available devices and sends corresponding notifications to its listener(s).
This class is implicitly a singleton; since it does a network scan, it isn't useful to have more than one instance of it in use.
- Deprecated:
- Use GCKDiscoveryManager to discover Cast receivers.
Inherits NSObject.
Instance Method Summary | |
(instancetype) | - init |
Constructs a new GCKDeviceScanner. More... | |
(instancetype) | - initWithFilterCriteria: |
Designated initializer. More... | |
(void) | - startScan |
Starts a new device scan. More... | |
(void) | - stopScan |
Stops any in-progress device scan. More... | |
(void) | - addListener: |
Adds a listener for receiving notifications. More... | |
(void) | - removeListener: |
Removes a listener that was previously added with addListener:. More... | |
Property Summary | |
NSArray * | devices |
The array of discovered devices. More... | |
BOOL | hasDiscoveredDevices |
Whether the current/latest scan has discovered any devices. More... | |
BOOL | scanning |
Whether a scan is currently in progress. More... | |
GCKFilterCriteria * | filterCriteria |
The current filtering criteria. More... | |
BOOL | passiveScan |
Whether the scan should be a passive scan. More... | |
Method Detail
- (instancetype) init |
Constructs a new GCKDeviceScanner.
- Deprecated:
- Use initWithFilterCriteria: instead; do not use without a criteria.
- (instancetype) initWithFilterCriteria: | (GCKFilterCriteria *__nullable) | filterCriteria |
Designated initializer.
Constructs a new GCKDeviceScanner with the given filter criteria.
- Parameters
-
filterCriteria The filter criteria. May not be nil
.
- (void) startScan |
Starts a new device scan.
The scan must eventually be stopped by calling stopScan.
- (void) stopScan |
Stops any in-progress device scan.
This method must be called at some point after startScan was called and before this object is released by its owner.
- (void) addListener: | (id< GCKDeviceScannerListener >) | listener |
Adds a listener for receiving notifications.
- Parameters
-
listener The listener to add.
- (void) removeListener: | (id< GCKDeviceScannerListener >) | listener |
Removes a listener that was previously added with addListener:.
- Parameters
-
listener The listener to remove.
Property Detail
|
readnonatomiccopy |
The array of discovered devices.
|
readnonatomicassign |
Whether the current/latest scan has discovered any devices.
|
readnonatomicassign |
Whether a scan is currently in progress.
|
readwritenonatomiccopy |
The current filtering criteria.
|
readwritenonatomicassign |
Whether the scan should be a passive scan.
A passive scan sends discovery queries less frequently, so it is more efficient, but the results will not be as fresh. It's appropriate to do a passive scan when the user is not actively selecting a Cast target.