GCKDevice 类

GCKDevice 类参考

概览

表示接收器设备的对象。

继承自 NSObject、<NSCopying> 和 <NSCoding>。

实例方法摘要

(BOOL) - isSameDeviceAs:
 测试此设备是否与另一设备指向同一实体设备。更多…
 
(BOOL) - hasCapabilities:
 如果设备支持给定的功能,则返回 YES更多…
 
(void) - setAttribute:forKey:
 在对象中设置任意属性。更多…
 
(NSObject< NSCoding > *__nullable) - attributeForKey:
 查找对象中的属性。更多…
 
(void) - removeAttributeForKey:
 从对象中移除属性。更多…
 
(void) - removeAllAttributes
 从对象中移除所有属性。更多…
 

房源摘要

NSString * ipAddress
 设备的 IPv4 地址,采用点分表示法。更多…
 
uint16_t servicePort
 设备的维修端口。更多…
 
NSString * deviceID
 设备的唯一标识符。更多…
 
NSString * friendlyName
 设备的易记名称。更多…
 
NSString * manufacturer
 设备的制造商名称。更多…
 
NSString * modelName
 设备的型号名称。更多…
 
NSArray< GCKImage * > * icons
 一个 GCKImage 对象数组,包含设备的图标。更多…
 
GCKDeviceStatus status
 设备在最近一次扫描时的状态。更多…
 
NSString * statusText
 当前正在运行的接收方应用报告的状态文本(如果有)。更多…
 
NSString * deviceVersion
 设备的协议版本。更多…
 
BOOL isOnLocalNetwork
 如果相应设备位于本地网络上,则为 YES。更多…
 
GCKDeviceType type
 设备类型。更多…
 
NSString * category
 设备类别,用于唯一标识设备类型的字符串。更多…
 
NSString * uniqueID
 相应设备的全局唯一 ID。更多…
 

方法详细信息

- (BOOL) isSameDeviceAs: (const GCKDevice *)  other

测试此设备是否与另一设备指代同一实体设备。

如果两个 GCKDevice 对象具有相同的类别、设备 ID、IP 地址、服务端口和协议版本,则返回 YES

- (BOOL) hasCapabilities: (NSInteger)  deviceCapabilities

如果设备支持给定的功能,则返回 YES

Parameters
deviceCapabilitiesA bitwise-OR of one or more of the GCKDeviceCapability constants.
- (void) setAttribute: (NSObject< NSCoding > *)  attribute
forKey: (NSString *)  key 

在对象中设置任意属性。

可供自定义设备提供商用于存储非 Cast 设备的设备特定信息。

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.
- (NSObject<NSCoding> * __nullable) attributeForKey: (NSString *)  key

查找对象中的属性。

Parameters
keyThe key that identifies the attribute. The key is an arbitrary string. It cannot be nil.
返回
相应属性的值;如果不存在此类属性,则为 nil
- (void) removeAttributeForKey: (NSString *)  key

从对象中移除属性。

Parameters
keyThe key that identifies the attribute. The key is an arbitrary string. It cannot be nil.
- (void) removeAllAttributes

从对象中移除所有属性。

媒体资源详情

- (NSString*) ipAddress
readnonatomiccopy

设备的 IPv4 地址,采用点分表示法。

用于发出网络请求时。

- (uint16_t) servicePort
readnonatomicassign

设备的维修端口。

- (NSString*) deviceID
readnonatomiccopy

设备的唯一标识符。

- (NSString*) friendlyName
readwritenonatomiccopy

设备的易记名称。

这是用户可分配的名称,例如“客厅”。

- (NSString*) manufacturer
readwritenonatomiccopy

设备的制造商名称。

Deprecated:
请改用 modelName 或自定义属性。
- (NSString*) modelName
readwritenonatomiccopy

设备的型号名称。

- (NSArray<GCKImage *>*) icons
readwritenonatomiccopy

一个 GCKImage 对象数组,包含设备的图标。

- (GCKDeviceStatus) status
readwritenonatomicassign

设备在最近一次扫描时的状态。

- (NSString*) statusText
readwritenonatomiccopy

当前正在运行的接收方应用报告的状态文本(如果有)。

- (NSString*) deviceVersion
readwritenonatomiccopy

设备的协议版本。

- (BOOL) isOnLocalNetwork
readnonatomicassign

如果相应设备位于本地网络上,则为 YES。

- (GCKDeviceType) type
readnonatomicassign

设备类型。

开始时间
3.3
- (NSString*) category
readnonatomiccopy

设备类别,用于唯一标识设备类型的字符串。

投放设备的类别为 kGCKCastDeviceCategory

- (NSString*) uniqueID
readnonatomiccopy

相应设备的全局唯一 ID。

这是 categorydeviceID 属性的串联。