Device class
警告
现已弃用此 API。
构造函数
Device(any) | 实例化新的 Device 对象。 |
属性
authentication | 包含用于对此设备进行身份验证的对称密钥。 |
capabilities | 包含此设备的功能。 |
cloud |
等待传递到设备的 c2d 消息数。 |
connection |
设备是“已连接”还是“已断开连接”。 建议不要使用此属性来确定设备是否现在实际连接,因为设备连接可能已超时,IoT 中心可能未检测到它,或者设备是否正在使用 HTTPS 进行连接。 如果需要监视设备连接,则重新建议的方法是使用中心的 作监视 功能。 |
connection |
表示上次更改 |
device |
Azure IoT 中心设备注册表中存在的唯一设备标识符。 |
etag | 分配给此设备标识说明的弱实体标记 |
generation |
用于消除已删除/重新创建具有相同 |
last |
时间戳,表示设备上次进行身份验证、发送消息或收到消息的时间。 |
status | “enabled”(有权连接的设备,可以发送/接收消息)或“disabled”。 |
status |
禁用设备时设置 128 个字符的字符串。 |
status |
表示上次更改 |
构造函数详细信息
Device(any)
实例化新的 Device 对象。
new Device(jsonData?: any)
参数
- jsonData
-
any
设备的可选 JSON 表示形式,该表示形式将映射到对象中的属性。 如果未提供任何参数,则会为设备属性分配默认值。
属性详细信息
authentication
capabilities
cloudToDeviceMessageCount
等待传递到设备的 c2d 消息数。
cloudToDeviceMessageCount?: string
属性值
string
connectionState
设备是“已连接”还是“已断开连接”。 建议不要使用此属性来确定设备是否现在实际连接,因为设备连接可能已超时,IoT 中心可能未检测到它,或者设备是否正在使用 HTTPS 进行连接。 如果需要监视设备连接,则重新建议的方法是使用中心的 作监视 功能。
connectionState?: ConnectionState
属性值
connectionStateUpdatedTime
表示上次更改 connectionState
时间的时间戳。
connectionStateUpdatedTime?: string
属性值
string
deviceId
Azure IoT 中心设备注册表中存在的唯一设备标识符。
deviceId: string
属性值
string
etag
分配给此设备标识说明的弱实体标记
etag?: string
属性值
string
generationId
用于消除已删除/重新创建具有相同 deviceId
的设备
generationId?: string
属性值
string
lastActivityTime
时间戳,表示设备上次进行身份验证、发送消息或收到消息的时间。
lastActivityTime?: string
属性值
string
status
statusReason
禁用设备时设置 128 个字符的字符串。
statusReason?: string
属性值
string
statusUpdatedTime
表示上次更改 status
时间的时间戳。
statusUpdatedTime?: string
属性值
string