GCKDevice Class

GCKDevice Class Reference

Overview

An object representing a first-screen device.

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

Instance Method Summary

(instancetype) - initWithIPAddress:servicePort:
 Designated initializer. More...
 
(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< NSCoding > *) - 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...
 

Properties

NSString * ipAddress
 The device's IPv4 address, in dot-notation. More...
 
UInt32 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 * manufacturer
 The device's manufacturer name. More...
 
NSString * modelName
 The device's model name. More...
 
NSArray * 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 version. More...
 
BOOL isOnLocalNetwork
 YES if this GCKCastDevice is on the local network. More...
 

Method Detail

- (instancetype) initWithIPAddress: (NSString *)  ipAddress
servicePort: (UInt32)  servicePort 

Designated initializer.

Constructs a new GCKDevice with the given IP address.

Parameters
ipAddressThe device's IPv4 address, in dot-notation.
servicePortThe device's service port.
- (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 IP address, service port, device ID, and version.

- (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.
- (void) setAttribute: (NSObject< NSCoding > *)  attribute
forKey: (NSString *)  key 

Sets an arbitrary attribute in the object.

May be used by custom device scanners 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. Cannot be nil.
- (NSObject<NSCoding> *) attributeForKey: (NSString *)  key

Looks up an attribute in the object.

Parameters
keyThe key that identifies the attribute.
Returns
The value of the attribute, or nil if no such attribute exists.
- (void) removeAttributeForKey: (NSString *)  key

Removes an attribute from the object.

The key that identifies the attribute.

- (void) removeAllAttributes

Removes all attributes from the object.

Property Documentation

- (NSString*) ipAddress
readnonatomiccopy

The device's IPv4 address, in dot-notation.

Used when making network requests.

- (UInt32) servicePort
readnonatomicassign

The device's service port.

- (NSString*) deviceID
readwritenonatomiccopy

A unique identifier for the device.

- (NSString*) friendlyName
readwritenonatomiccopy

The device's friendly name.

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

- (NSString*) manufacturer
readwritenonatomiccopy

The device's manufacturer name.

- (NSString*) modelName
readwritenonatomiccopy

The device's model name.

- (NSArray*) icons
readwritenonatomiccopy

An array of GCKImage objects containing icons for the device.

- (GCKDeviceStatus) status
readnonatomicassign

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.

- (NSString*) deviceVersion
readwritenonatomiccopy

The device's version.

- (BOOL) isOnLocalNetwork
readnonatomicassign

YES if this GCKCastDevice is on the local network.

Google Cast iOS Sender API Reference v 2.10.1 4691