Sub-Device Batch Login¶
Sub-Device Batch Login 节点支持批量登录子设备。
节点类型¶
EnOS。
输入和输出能力¶
该节点具有多个入口点和 2 个出口点 (成功/失败)。
节点属性¶
名称
该节点的名称。
描述
该节点的描述。
示例¶
输入和输出日志中,Metadata 包含的信息为网关信息。网关登录成功后,根据 Body 中待登录的子设备信息批量登录子设备。输出日志中将返回登录成功和失败的子设备信息。
输入示例¶
{
"MetaData": {
"messageType": "SubDeviceLoginBatch",
"assetId": "assetId",
"deviceKey": "deviceKey",
"productKey": "productKey",
"orgId": "yourOrgId",
"ts": "1660103907656"
},
"Body": {
"clientId": "yourClientId",
"subDevices": [
{
"sign": "1ff29fb0058aeaf1f21fd5ede23541a6fbb5ad4f40e7779eac894c39b41cc258",
"deviceKey": "subdeviceKey1",
"productKey": "productKey1",
"secureMode": "2"
},
{
"sign": "8fe3f142dabea8c821ae1d25110b4ab4f48d582b8766c56d155ba33025fed4a7",
"deviceKey": "subdeviceKey2",
"productKey": "productKey2",
"secureMode": "2"
}
],
"signMethod": "sha256",
"timestamp": "1660103907527"
}
}
输出示例¶
componentResult
的值说明设备是否登录成功,全部登录成功为 Success
,部分或全部登录失败则为 Failure
。
{
"MetaData": {
"messageType": "SubDeviceLoginBatch",
"assetId": "assetId",
"deviceKey": "deviceKey",
"productKey": "productKey",
"orgId": "yourOrgId",
"componentResult": "Failure",
"ts": "1660103907656",
"ComponentReply[SubDevice-LoginBatch]": {
"loginedSubDevices": [
{
"productKey": "productKey1",
"deviceKey": "subdeviceKey1",
"assetId": "assetId1"
}
],
"failedSubDevices": [
{
"productKey": "productKey2",
"deviceKey": "subdeviceKey2"
}
]
}
},
"Body": {
"clientId": "clientId",
"subDevices": [
{
"sign": "1ff29fb0058aeaf1f21fd5ede23541a6fbb5ad4f40e7779eac894c39b41cc258",
"deviceKey": "productkey1",
"productKey": "subdevicekey1",
"secureMode": "2"
},
{
"sign": "8fe3f142dabea8c821ae1d25110b4ab4f48d582b8766c56d155ba33025fed4a7",
"deviceKey": "productkey2",
"productKey": "subdevicekey2",
"secureMode": "2"
}
],
"signMethod": "sha256",
"timestamp": "1660103907527"
}
}