An abstract base class for performing device discovery and session construction.
More...
#import <GCKDeviceProvider.h>
An abstract base class for performing device discovery and session construction.
Support for additional device types can be added by extending this class. See the GCKDeviceProvider(Protected) category for a list of helper methods intended for use by subclasses. New device providers are registered with the framework using registerDeviceProvider: (GCKCastContext).
- Since
- 3.0
- Deprecated:
- Use createDeviceWithID:networkAddress:servicePort: for IPv4 and IPv6 support
Factory method for constructing new GCKDevice instances. The parameters correspond to immutable properties of a GCKDevice.
- Parameters
-
deviceID | The unique ID identifying this device. This value must be unique among all GCKDevice objects that are created by this provider. |
ipAddress | The IP address of the device, in numeric form (for example, @"10.0.0.10" ). May not be nil . Supports IPv4 only. |
servicePort | The service port on which connections should be made to this device. May be 0 if a service port is not applicable. |
Provided by category GCKDeviceProvider(Protected).
- (GCKDevice *) createDeviceWithID: |
|
(NSString *) |
deviceID |
networkAddress: |
|
(GCKNetworkAddress *) |
networkAddress |
servicePort: |
|
(uint16_t) |
servicePort |
|
|
| |
Factory method for constructing new GCKDevice instances.
The parameters correspond to immutable properties of a GCKDevice.
- Parameters
-
deviceID | The unique ID identifying this device. This value must be unique among all GCKDevice objects that are created by this provider. |
networkAddress | The IP address of the device, either IPv4 or IPv6 |
servicePort | The service port on which connections should be made to this device. May be 0 if a service port is not applicable. |
- Since
- 4.2
Provided by category GCKDeviceProvider(Protected).
Constructs a new session for the given device and optionally an existing session ID.
- Parameters
-
device | The device to connect to. |
sessionID | The ID of the session to resume; or nil to start a new session. |
- Deprecated:
- Subclasses should call createSessionForDevice:sessionID:sessionOptions instead.
- (GCKSession *) createSessionForDevice: |
|
(GCKDevice *) |
device |
sessionID: |
|
(NSString *GCK_NULLABLE_TYPE) |
sessionID |
sessionOptions: |
|
(GCKSessionOptions *GCK_NULLABLE_TYPE) |
sessionOptions |
|
|
| |
Constructs a new session for the given device and optionally an existing session ID.
Must be overridden by subclasses.
- Parameters
-
device | The device to connect to. |
sessionID | The ID of the session to resume; or nil to start a new session. |
sessionOptions | The session options, if any; otherwise nil . |
- Since
- 4.0
- (instancetype) initWithDeviceCategory: |
|
(NSString *) |
deviceCategory |
|
Designated initializer.
Constructs a new GCKDeviceProvider for devices of the specified type.
- Parameters
-
deviceCategory | A string that uniquely identifies the type of device that is managed by by this provider. |
- (void) notifyDidPublishDevice: |
|
(GCKDevice *) |
device |
|
- (void) notifyDidStartDiscovery |
|
|
|
- (void) notifyDidUnpublishDevice: |
|
(GCKDevice *) |
device |
|
Notifies the discovery manager that a previously-published device has been unpublished, because it is no longer available.
Provided by category GCKDeviceProvider(Protected).
- (void) notifyDidUpdateDevice: |
|
(GCKDevice *) |
device |
|
Notifies the discovery manager that one or more of a previously-published device's display attributes (such as friendly name or icons) have changed.
Provided by category GCKDeviceProvider(Protected).
Starts a new discovery scan.
This is (commonly) an asynchronous operation. If any of the devices discovered by the previous scan are no longer valid, the provider should unpublish them at this time. Must be overridden by subclasses.
The provider must notify the discovery manager once the scan has been started (and any stale devices have been unpublished) by calling notifyDidStartDiscovery (GCKDeviceProvider(Protected)). If a particular implementation of this method has no asynchronous work to do when starting a scan, it can call the notification method directly before returning.
Stops the discovery scan.
Must be overridden by subclasses.
- (NSString*) deviceCategory |
|
readnonatomiccopy |
A string that uniquely identifies the type of device that will be discovered by this provider.
The array of discovered devices.
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. Not all implementations will honor this property.
The documentation for this class was generated from the following file: