概览
一个表示接收方设备的对象。
继承 NSObject、<NSDuplicate> 和 <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 |
是(如果此设备位于本地网络上)。更多... | |
GCKDeviceType | type |
设备类型。更多... | |
NSString * | category |
设备类别,用于唯一标识设备类型。更多... | |
NSString * | uniqueID |
此设备的全局唯一 ID。更多... | |
方法详细信息
- (BOOL) isSameDeviceAs: | (const GCKDevice *) | other |
用于测试此设备是否引用了其他实体设备。
如果两个 GCKDevice 对象具有相同的类别、设备 ID、IP 地址、服务端口和协议版本,则返回 YES
。
- (BOOL) hasCapabilities: | (NSInteger) | deviceCapabilities |
如果设备支持给定功能,则返回 YES
。
- Parameters
-
deviceCapabilities A bitwise-OR of one or more of the GCKDeviceCapability constants.
- (void) setAttribute: | (NSObject< NSCoding > *) | attribute | |
forKey: | (NSString *) | key | |
在对象中设置任意属性。
可供自定义设备提供程序用于存储非 Cast 设备的设备特定信息。
- 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
.
- (NSObject<NSCoding> * __nullable) attributeForKey: | (NSString *) | key |
在对象中查找属性。
- Parameters
-
key The key that identifies the attribute. The key is an arbitrary string. It cannot be nil
.
- 返回
- 属性的值,如果不存在该属性,则返回
nil
。
- (void) removeAttributeForKey: | (NSString *) | key |
从对象中移除属性。
- Parameters
-
key The key that identifies the attribute. The key is an arbitrary string. It cannot be nil
.
- (void) removeAllAttributes |
移除对象中的所有属性。
属性详情
|
readnonatomiccopy |
设备的 IPv4 地址,采用点表示法。
在发出网络请求时使用。
|
readnonatomicassign |
设备的服务端口。
|
readnonatomiccopy |
设备的唯一标识符。
|
readwritenonatomiccopy |
设备的易记名称。
这是可由用户分配的名称,例如“客厅”。
|
readwritenonatomiccopy |
设备的制造商名称。
- Deprecated:
- 改用 modelName 或自定义属性。
|
readwritenonatomiccopy |
设备的型号名称。
|
readwritenonatomicassign |
设备上次扫描时的状态。
|
readwritenonatomiccopy |
当前正在运行的接收器应用报告的状态文本(如果有)。
|
readwritenonatomiccopy |
设备的协议版本。
|
readnonatomicassign |
是(如果此设备位于本地网络上)。
|
readnonatomicassign |
设备类型。
- 辛塞
- 3.3
|
readnonatomiccopy |
设备类别,用于唯一标识设备类型。
投放设备的类别为 kGCKCastDeviceCategory。