Stay organized with collections Save and categorize content based on your preferences.
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).
Inherits NSObject.
- (instancetype) initWithDeviceCategory: (NSString *) deviceCategoryDesignated initializer.
Constructs a new GCKDeviceProvider for devices of the specified type.
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.
- (GCKSession *) createSessionForDevice: (GCKDevice *) device sessionID: (nullable NSString *) sessionID sessionOptions: (nullable GCKSessionOptions *) sessionOptionsConstructs a new session for the given device and optionally an existing session ID.
Must be overridden by subclasses.
nil
to start a new session. sessionOptions The session options, if any; otherwise nil
.
Constructs a new session for the given device and optionally an existing session ID.
nil
to start a new session.
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 *) deviceNotifies 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).
- (GCKDevice *) createDeviceWithID: (NSString *) deviceID ipAddress: (NSString *) ipAddress servicePort: (uint16_t) servicePortFactory method for constructing new GCKDevice instances. The parameters correspond to immutable properties of a GCKDevice.
@"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) servicePortFactory method for constructing new GCKDevice instances.
The parameters correspond to immutable properties of a GCKDevice.
Provided by category GCKDeviceProvider(Protected).
- (NSString*) deviceCategory readnonatomiccopyA string that uniquely identifies the type of device that will be discovered by this provider.
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 array of discovered devices.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["`GCKDeviceProvider` is an abstract base class for discovering and connecting to Cast devices."],["Subclasses extend this class to add support for new device types."],["Device discovery can be started and stopped using the `startDiscovery` and `stopDiscovery` methods."],["Sessions with devices are created using the `createSessionForDevice` methods."],["The `devices` property provides a list of discovered devices."]]],["The `GCKDeviceProvider` class enables device discovery and session creation. Key actions include initializing with a device category, starting and stopping discovery scans, and creating sessions for devices, potentially with existing session IDs and options. Subclasses override `startDiscovery`, `stopDiscovery`, and `createSessionForDevice` methods. The class manages device notifications like publishing, unpublishing, and updating device attributes. It also offers methods to create `GCKDevice` instances. Important properties are `deviceCategory`, `passiveScan`, and `devices`.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4