tencent cloud

IoT Hub

Release Notes and Announcements
Release Notes
Product Introduction
Overview
Features
Strengths
Use Cases
Use Limits
Basic Concepts
Getting Started
Quick Start
Scenario 1: Device Interconnection
Scenario 2: Device Status Reporting and Setting
MQTT.fx Connection Guide
Console Guide
Product Management
Rule Engine
Sub-account Access to IoT Hub
Firmware Upgrade
Resource Management
Certificate Management
Developer Manual
Feature Components
Signature Algorithm
Device Authentication
Device Connection Protocol
Gateway Subdevice
Message Communication
Device Shadow
Device Firmware Upgrade
Remote Device Configuration
Resource Management
Device Log Reporting
NTP Service
Device Connection Manual
Device Connection Overview
Connection Based on SDK for C
Connection Based on SDK for Android
Connection Based on SDK for Java
Connection Based on SDK for Python
API Documentation
History
Introduction
API Category
Making API Requests
Device Shadow APIs
Device APIs
CA Certificate APIs
Product APIs
Data Types
Error Codes
FAQs
General
Device Connection and Reporting
Rule Engine
Console
IoT Hub Policy
Privacy Policy
Data Privacy And Security Agreement
Glossary
DocumentationIoT HubDeveloper ManualGateway SubdeviceProxied Subdevice Connection and Disconnection

Proxied Subdevice Connection and Disconnection

PDF
Focus Mode
Font Size
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

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback