An object representing a receiver device. More...

#import <GCKDevice.h>

+ Inheritance diagram for GCKDevice:

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(NSString *ipAddress) - GCK_DEPRECATED
 
(BOOL) - isSameDeviceAs:
 Tests if this device refers to the same physical device as another. More...
 
(BOOL) - hasCapabilities:
 Returns YES if the device supports the given capabilities. More...
 
(void) - setAttribute:forKey:
 Sets an arbitrary attribute in the object. More...
 
(NSObject< NSSecureCoding > *GCK_NULLABLE_TYPE) - attributeForKey:
 Looks up an attribute in the object. More...
 
(void) - removeAttributeForKey:
 Removes an attribute from the object. More...
 
(void) - removeAllAttributes
 Removes all attributes from the object. More...
 

Class Methods

(NSString *) + deviceCategoryForDeviceUniqueID:
 Extracts the device category from a device unique ID. More...
 

Properties

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

Detailed Description

An object representing a receiver device.

Method Documentation

- (NSObject<NSSecureCoding> * GCK_NULLABLE_TYPE) attributeForKey: (NSString *)  key

Looks up an attribute in the object.

Parameters
keyThe 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.
+ (NSString *) deviceCategoryForDeviceUniqueID: (NSString *)  deviceUniqueID

Extracts the device category from a device unique ID.

- (NSString* ipAddress) GCK_DEPRECATED ("Use networkAddress for both IPv4 and IPv6 support") 
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.

- (BOOL) hasCapabilities: (NSInteger)  deviceCapabilities

Returns YES if the device supports the given capabilities.

Parameters
deviceCapabilitiesA bitwise-OR of one or more of the GCKDeviceCapability constants.
- (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.

- (instancetype) NS_UNAVAILABLE
- (void) removeAllAttributes

Removes all attributes from the object.

- (void) removeAttributeForKey: (NSString *)  key

Removes an attribute from the object.

Parameters
keyThe key that identifies the attribute. The key is an arbitrary string. It cannot be nil.
- (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
attributeThe attribute value, which must be key-value coding compliant, and cannot be nil.
keyThe key that identifies the attribute. The key is an arbitrary string. It cannot be nil.

Property Documentation

- (NSString*) category
readnonatomiccopy

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

Cast devices have a category of kGCKCastDeviceCategory.

- (NSString*) deviceID
readnonatomiccopy

A unique identifier for the device.

- (NSString*) deviceVersion
readwritenonatomiccopy

The device's protocol version.

- (NSString*) friendlyName
readwritenonatomiccopy

The device's friendly name.

This is a user-assignable name such as "Living Room".

- (NSArray<GCKImage *>*) icons
readwritenonatomiccopy

An array of GCKImage objects containing icons for the device.

- (BOOL) isOnLocalNetwork
readnonatomicassign

YES if this device is on the local network.

- (NSString*) modelName
readwritenonatomiccopy

The device's model name.

- (GCKNetworkAddress*) networkAddress
readnonatomiccopy

The device's IP address.

Used when making network requests.

Since
4.2
- (uint16_t) servicePort
readnonatomicassign

The device's service port.

- (GCKDeviceStatus) status
readwritenonatomicassign

The device's status at the time that it was most recently scanned.

- (NSString*) statusText
readwritenonatomiccopy

The status text reported by the currently running receiver application, if any.

- (GCKDeviceType) type
readnonatomicassign

The device type.

Since
3.3
- (NSString*) uniqueID
readnonatomiccopy

A globally unique ID for this device.

This is a concatenation of the category and deviceID properties.


The documentation for this class was generated from the following file: