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

Gateway Synchronizing Child Device Information

Function

This API is used by a gateway to synchronize child device information from the platform. The platform can notify an online gateway of child device addition or deletion by respectively using the topics described in Platform Notifying a Gateway of New Child Device Connection and Platform Notifying a Gateway of Child Device Deletion. However, the platform cannot send notifications to a gateway that is offline. When the gateway goes online, it can use the topic described here to synchronize information about child device addition or deletion from the platform. For details about the relationship between a gateway and its child devices, see Gateway and Child Devices.

Topic

Upstream: $oc/devices/{device_id}/sys/events/up

Parameters

Parameter

Mandatory/Optional

Type

Description

object_device_id

Optional

String

Explanation:

This parameter is not in use currently and does not need to be set.

services

Optional

List<EventService>

Explanation:

List of services that an event is about.

EventService 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 sub_device_sync_request.

event_time

Optional

String

Explanation:

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

If this parameter is not carried in the reported data or is in incorrect format, the time when the platform receives the data is used.

paras

Mandatory

Object

Explanation:

Event parameters in JSON format.

paras structure

Parameter

Mandatory/Optional

Type

Description

version

Optional

Long

Explanation:

Indicates the last version of child device addition or deletion information received by the gateway. The platform will send the information of later versions to the gateway during the synchronization.

Example

Topic: $oc/devices/{device_id}/sys/events/up
Data format:
{
        "object_device_id": "{object_device_id}",
	"services": [{
		"service_id": "$sub_device_manager",
		"event_type": "sub_device_sync_request",
		"event_time": "20151212T121212Z",
		"paras": {"version": 1}
	}]
}