GCKDevice Class

GCKDevice Class Reference

Overview

An object representing a receiver device.

Inherits NSObject, <NSCopying>, and <NSSecureCoding>.

Instance Method Summary

(instancetype) 
- init
(BOOL) 
Tests if this device refers to the same physical device as another. More...
(BOOL) 
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...
(void) 
Removes all attributes from the object. More...

Class Method Summary

Extracts the device category from a device unique ID. More...

Property Summary

NSString * 
The device's IP address. More...
uint16_t 
The device's service port. More...
NSString * 
A unique identifier for the device. More...
NSString * 
The device's friendly name. More...
NSString * 
The device's model name. More...
NSArray< GCKImage * > * 
An array of GCKImage objects containing icons for the device. More...
GCKDeviceStatus 
The device's status at the time that it was most recently scanned. More...
NSString * 
The status text reported by the currently running receiver application, if any. More...
NSString * 
The device's protocol version. More...
YES if this device is on the local network. More...
The device type. More...
NSString * 
The device category, a string that uniquely identifies the type of device. More...
NSString * 
A globally unique ID for this device. More...

Method Detail

- (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.

Property Detail

- (NSString*) ipAddress
read nonatomic copy
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.
- ( GCKNetworkAddress *) networkAddress
read nonatomic copy

The device's IP address.

Used when making network requests.

Since
4.2
- (uint16_t) servicePort
read nonatomic assign

The device's service port.

- (NSString*) deviceID
read nonatomic copy

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".

- (NSString*) modelName
read write nonatomic copy

The device's model name.

- (NSArray< GCKImage *>*) icons
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.

- (NSString*) statusText
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.

- ( GCKDeviceType ) type
read nonatomic assign

The device type.

Since
3.3
- (NSString*) category
read nonatomic copy

The device category, a string that uniquely identifies the type of device.

Cast devices have a category of kGCKCastDeviceCategory .

- (NSString*) uniqueID
read nonatomic copy

A globally unique ID for this device.

This is a concatenation of the category and deviceID properties.

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