GCKDeviceScanner Class

GCKDeviceScanner Class Reference

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) 
Designated initializer. More...
(void) 
Starts a new device scan. More...
(void) 
Stops any in-progress device scan. More...
(void) 
Adds a listener for receiving notifications. More...
(void) 
Removes a listener that was previously added with addListener: . More...

Property Summary

NSArray * 
The array of discovered devices. More...
Whether the current/latest scan has discovered any devices. More...
BOOL 
Whether a scan is currently in progress. More...
The current filtering criteria. More...
BOOL 
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

- (NSArray*) devices
read nonatomic copy

The array of discovered devices.

- (BOOL) hasDiscoveredDevices
read nonatomic assign

Whether the current/latest scan has discovered any devices.

- (BOOL) scanning
read nonatomic assign

Whether a scan is currently in progress.

- ( GCKFilterCriteria *) filterCriteria
read write nonatomic copy

The current filtering criteria.

- (BOOL) passiveScan
read write nonatomic assign

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.

Create a Mobile Website
View Site in Mobile | Classic
Share by: