GCKDevice Class
Stay organized with collections
Save and categorize content based on your preferences.
An object representing a receiver device.
Inherits NSObject, <NSCopying>, and <NSSecureCoding>.
Tests if this device refers to the same physical device as another. More...
Returns YES
if the device supports all of the given capabilities. More...
Sets an arbitrary attribute in the object. More...
(nullable NSObject
< NSSecureCoding > *)
Looks up an attribute in the object. More...
Removes an attribute from the object. More...
Removes all attributes from the object. More...
Extracts the device category from a device unique ID. More...
A unique identifier for the device. More...
The device's friendly name. More...
The device's status at the time that it was most recently scanned. More...
The status text reported by the currently running receiver application, if any. More...
The device's protocol version. More...
YES if this device is on the local network. More...
The device category, a string that uniquely identifies the type of device. More...
A globally unique ID for this device. More...
- (BOOL) isSameDeviceAs: |
|
(const GCKDevice
*) |
other
|
|
Tests if this device refers to the same physical device as another.
Returns YES
if both GCKDevice
objects have the same category, device ID, IP address, service port, and protocol version.
- (BOOL) hasCapabilities: |
|
(GCKDeviceCapabilities) |
deviceCapabilities
|
|
Returns YES
if the device supports all of the given capabilities.
- Parameters
-
deviceCapabilities
A bitwise-OR of one or more of the GCKDeviceCapabilities constants.
- (void) setAttribute: |
|
(NSObject< NSSecureCoding > *) |
attribute
|
forKey: |
|
(NSString *) |
key
|
|
|
|
|
Sets an arbitrary attribute in the object.
May be used by custom device providers to store device-specific information for non-Cast devices.
- Parameters
-
attribute |
The attribute value, which must be key-value coding compliant, and cannot be nil
. |
key |
The key that identifies the attribute. The key is an arbitrary string. It cannot be nil
. |
- (nullable NSObject<NSSecureCoding> *) attributeForKey: |
|
(NSString *) |
key
|
|
Looks up an attribute in the object.
- Parameters
-
key
The key that identifies the attribute. The key is an arbitrary string. It cannot be nil
.
- Returns
- The value of the attribute, or
nil
if no such attribute exists.
- (void) removeAttributeForKey: |
|
(NSString *) |
key
|
|
Removes an attribute from the object.
- Parameters
-
key
The key that identifies the attribute. The key is an arbitrary string. It cannot be nil
.
- (void) removeAllAttributes |
|
|
|
Removes all attributes from the object.
+ (NSString *) deviceCategoryForDeviceUniqueID: |
|
(NSString *) |
deviceUniqueID
|
|
Extracts the device category from a device unique ID.
- Deprecated:
- Use networkAddress
The device's IPv4 address, in dot-notation. Used when making network requests. This will be an empty string for GCKDevice
objects that are created with an IPv6 address.
The device's IP address.
Used when making network requests.
- Since
- 4.2
The device's service port.
A unique identifier for the device.
- (NSString*) friendlyName
read
write
nonatomic
copy
The device's friendly name.
This is a user-assignable name such as "Living Room".
read
write
nonatomic
copy
read
write
nonatomic
copy
An array of GCKImage
objects containing icons for the device.
- (GCKDeviceStatus) status
read
write
nonatomic
assign
The device's status at the time that it was most recently scanned.
read
write
nonatomic
copy
The status text reported by the currently running receiver application, if any.
- (NSString*) deviceVersion
read
write
nonatomic
copy
The device's protocol version.
- (BOOL) isOnLocalNetwork
read
nonatomic
assign
YES if this device is on the local network.
The device type.
- Since
- 3.3
The device category, a string that uniquely identifies the type of device.
Cast devices have a category of kGCKCastDeviceCategory
.
A globally unique ID for this device.
This is a concatenation of the category
and deviceID
properties.
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."],[[["\u003cp\u003eThe \u003ccode\u003eGCKDevice\u003c/code\u003e class represents a Cast receiver device on the network, providing information such as its name, IP address, capabilities, and status.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to check device capabilities, compare devices, and manage device-specific attributes.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access properties like \u003ccode\u003efriendlyName\u003c/code\u003e, \u003ccode\u003emodelName\u003c/code\u003e, \u003ccode\u003edeviceID\u003c/code\u003e, and \u003ccode\u003eicons\u003c/code\u003e to identify and interact with the device.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGCKDevice\u003c/code\u003e class helps in discovering and managing Cast-enabled devices for seamless integration with Cast applications.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003enetworkAddress\u003c/code\u003e, \u003ccode\u003eservicePort\u003c/code\u003e and \u003ccode\u003edeviceVersion\u003c/code\u003e for handling network communication and device identification.\u003c/p\u003e\n"]]],["The GCKDevice class represents a receiver device, inheriting from NSObject. Key actions include: checking if a device is the same as another (`isSameDeviceAs:`), verifying device capabilities (`hasCapabilities:`), setting, retrieving, and removing attributes (`setAttribute:forKey:`, `attributeForKey:`, `removeAttributeForKey:`, `removeAllAttributes`), and extracting device category from a unique ID (`deviceCategoryForDeviceUniqueID:`). The class also exposes properties like `ipAddress`, `networkAddress`, `servicePort`, `deviceID`, `friendlyName`, `modelName`, `icons`, `status`, `statusText`, `deviceVersion`, `isOnLocalNetwork`, `type`, `category`, and `uniqueID` for device identification and management.\n"],null,[]]