tencent cloud

All product documents
IoT Hub
DocumentationIoT HubDeveloper ManualGateway SubdeviceProxied Subdevice Connection and Disconnection
Proxied Subdevice Connection and Disconnection
Last updated: 2024-12-27 15:54:13
Proxied Subdevice Connection and Disconnection
Last updated: 2024-12-27 15:54:13

Feature Overview

A gateway device can connect and disconnect subdevices under it through the data communication with the cloud. This feature uses the same topics as those used in gateway subdevice topology management:
Data upstream topic (for publishing): $gateway/operation/${productid}/${devicename}
Data downstream topic (for subscribing): $gateway/operation/result/${productid}/${devicename}

Proxied subdevice connection

The gateway device can connect the subdevice to the platform through the data upstream topic. After the request succeeds, the platform will return the connection information of the subdevice through the data downstream topic.
Data format of the proxied subdevice connection request:
{
"type": "online",
"payload": {
"devices": [
{
"product_id": "CFCSQ5EAG7",
"device_name": "onlinedev00"
}
]
}
}
Data format of the proxied subdevice connection response:
{
"type": "online",
"payload": {
"devices": [
{
"product_id": "CFCSQ5EAG7",
"device_name": "onlinedev00",
"result":0
}
]
}
}
Request parameter description:
Parameter
Type
Description
type
String
Gateway message type. For proxied subdevice connection, the value is online
payload.devices
Array
List of subdevices to be connected
product_id
String
Subdevice product ID
device_name
String
Subdevice name
Response parameter description:
Parameter
Type
Description
type
String
Gateway message type. For proxied subdevice connection, the value is online
payload.devices
Array
List of subdevices to be connected
product_id
String
Subdevice product ID
device_name
String
Subdevice name
result
Int
Subdevice connection result. For specific error codes, please see the table below

Proxied subdevice disconnection

The gateway device can disconnect the subdevice from the platform through the data upstream topic. After the request succeeds, the platform will return the disconnection success information of the subdevice through the data downstream topic.
Data format of the proxied subdevice disconnection request:
{
"type": "offline",
"payload": {
"devices": [
{
"product_id": "CFCSQ5EAG7",
"device_name": "offlinedev00"
}
]
}
}
Data format of the proxied subdevice disconnection response:
{
"type": "offline",
"payload": {
"devices": [
{
"product_id": "CFCSQ5EAG7",
"device_name": "offlinedev00",
"result":-1
}
]
}
}
Request parameter description:
Parameter
Type
Description
type
String
Gateway message type. For proxied subdevice disconnection, the value is offline
payload.devices
Array
List of proxied subdevices to be disconnected
product_id
String
Subdevice product ID
device_name
String
Subdevice name
Response parameter description:
Parameter
Type
Description
type
String
Gateway message type. For proxied subdevice disconnection, the value is offline
payload.devices
Array
List of proxied subdevices to be disconnected
product_id
String
Subdevice product ID
device_name
String
Subdevice name
result
Int
Subdevice disconnection result. For specific error codes, please see the table below

Error codes

Error Code
Description
0
Success
-1
The gateway device is not bound to the subdevice
-2
System error. Subdevice connection or disconnection failed
801
Request parameter error
802
The device name is invalid, or the device does not exist
810
Unsupported subdevice
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon