Updated on 2024-12-02 GMT+08:00

Platform Notifying a Gateway of New Child Device Connection

Function

This API is used by the platform to notify a gateway that a new child device is connected. For details about the relationship between a gateway and its child devices, see Gateway and Child Devices.

Topic

Downstream: $oc/devices/{device_id}/sys/events/down

Parameters

Parameter

Mandatory/Optional

Type

Description

object_device_id

Optional

String

Explanation:

The value is the same as that of device_id in the topic.

services

Optional

List<ServiceEvent>

Explanation:

List of services that an event is about.

ServiceEvent structure

Parameter

Mandatory/Optional

Type

Description

service_id

Mandatory

String

Explanation:

System field.

Value range:

Fixed at $sub_device_manager.

event_type

Mandatory

String

Explanation:

System field.

Value range:

Fixed at add_sub_device_notify.

event_time

Optional

String

Explanation:

Event time. UTC time format: yyyyMMdd'T'HHmmss'Z'.

paras

Mandatory

Object

Explanation:

Event parameters in JSON format.

paras structure

Parameter

Mandatory/Optional

Type

Description

devices

Mandatory

List<DeviceInfo>

Explanation:

Device list.

version

Mandatory

Long

Explanation:

Indicates the version of the child device information. The gateway can save this value and include it in the request for synchronizing the child device list.

DeviceInfo structure

Parameter

Mandatory/Optional

Type

Description

parent_device_id

Mandatory

String

Explanation:

Parent device ID.

node_id

Mandatory

String

Explanation:

Indicates the node ID.

device_id

Mandatory

String

Explanation:

Device ID.

name

Optional

String

Explanation:

Device name.

description

Optional

String

Explanation:

Device description.

manufacturer_id

Optional

String

Explanation:

Manufacturer ID.

model

Optional

String

Explanation:

Device model.

product_id

Optional

String

Explanation:

Product ID

fw_version

Optional

String

Explanation:

Firmware version.

sw_version

Optional

String

Explanation:

Software version.

status

Optional

String

Explanation:

Device status.

Value range:

ONLINE: The device is online.

OFFLINE: The device is offline.

INACTIVE: The device is not activated.

extension_info

Optional

Object

Explanation:

Custom extended information.

Example

Topic: $oc/devices/{device_id}/sys/events/down 
Data format:
{    
        "object_device_id": "{object_device_id}",
	"services": [{
		"service_id": "$sub_device_manager",
		"event_type": "add_sub_device_notify",
		"event_time": "20151212T121212Z",
		"paras": {
			"devices": [{
				"parent_device_id": "c6b39067b0325db34663d3ef421a42f6_12345678",
				"node_id": "subdevice11",
				"device_id": "2bb4ddba-fb56-4566-8577-063ad2f5a6cc",
				"name": "subDevice11",
				"description": null,
				"manufacturer_id": "ofo",
				"model": "twx2",
				"product_id": "c6b39067b0325db34663d3ef421a42f6",
				"fw_version": null,
				"sw_version": null,
				"status": "ONLINE"
			}],
			"version": 1
		}
	}]
}