Updated on 2023-02-16 GMT+08:00

Device Reporting Information

Function

This API is used by a device to report device information to the platform.

Topic

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

Parameters

Parameter

Mandatory or Optional

Type

Description

object_device_id

Optional

String

Indicates the device that the event is about. If this parameter is not carried, the device specified in the topic is considered to be the device involved.

services

Optional

List<ServiceEvent>

Indicates a list of services that the event is about.

ServiceEvent structure

Parameter

Mandatory or Optional

Type

Description

service_id

Mandatory

String

Indicates the system field. The value is fixed to $sdk_info.

event_type

Mandatory

String

Indicates the system field. The value is fixed to sdk_info_report.

event_time

Optional

String

Indicates the time when the event occurs.

paras

Optional

Object

Indicates the event parameters in JSON format.

paras structure

Parameter

Mandatory or Optional

Type

Description

device_sdk_version

Optional

String

The value is in the format of access mode_version number, for example, C_v0.5.0, JAVA_v0.5.0, or Tiny SDK_v1.0.0.

sw_version

Optional

String

Indicates the software version.

fw_version

Optional

String

Indicates the firmware version.

device_ip

Optional

String

Device IP address.

Example

Topic: $oc/devices/{device_id}/sys/events/up  
Data format:
{ 
    "object_device_id": "{object_device_id}", 
    "services": [{ 
        "service_id": "$sdk_info", 
        "event_type": "sdk_info_report", 
        "event_time": "20151212T121212Z",
         "paras": { 
             "device_sdk_version": "C_v0.5.0",
             "sw_version": "v1.0", 
             "fw_version": "v1.0",  
             "device_ip": "127.0.0.1"
         } 
    }] 
}