Topic Definition

2025-02-26
1 Ratings
2 customers rated

Topic Overview

In order to distinguish the processing strategy of different properties, we divide the device properties into osd and state, and upload them through different topic.

  • osd: The properties that are uploaded in frequency by device, which is corresponding to the properties of pushmode = 0.
  • state: The properties that are uploaded by device when there are changes, which is corresponding to the properties of pushmode = 1.

Note: The {gateway_sn} represents the serial number of gateway device. The {device_sn} represents the serial number of thing model belonged device.

Topic NameSender -> SubscriberMessageIllustration
thing/product/{device_sn}/osdDevice > Cloud Serverosd message structThe properties that are uploaded in frequency by device(properties) ,
For the specific content range, please refer to the content of the thing model.
thing/product/{device_sn}/stateDevice > Cloud Serverstate message structThe properties that are uploaded in need by device (properties) ,
For the specific content range, please refer to the content of the thing model.
thing/product/{gateway_sn}/servicesCloud Server > Deviceservices message structThe services sent by device to cloud server. (For specific service identifier, please refer to the content of the thing model. )
thing/product/{gateway_sn}/services_replyDevice > Cloud Serverservices_reply message structThe reply and processing result of service by device.
thing/product/{gateway_sn}/eventsDevice > Cloud Serverevents message structThe events that need to be followed and processed, which is sent by device to cloud server.
For example, the SD is full, the information of fly zone is unrestricted, and so on. (For the events range,please refer to the content of the thing model.)
thing/product/{gateway_sn}/events_replyCloud Server > Deviceevents_reply message structThe reply and processing result of device event by cloud server.
thing/product/{gateway_sn}/requestsDevice > Cloud Serverrequests message structDevice send requests to cloud server for obtaining some information. For example, the temporary credentials.
thing/product/{gateway_sn}/requests_replyCloud Server > Devicerequests_reply message structThe reply to device requests by cloud server.
sys/product/{gateway_sn}/statusDevice > Cloud Serverstatus message structDevice online, device offline, topology update.
sys/product/{gateway_sn}/status_replyCloud Server > Devicestatus_reply message structReply by platform.
thing/product/{gateway_sn}/property/setCloud Server > Deviceproperty set message structDevice property setting.
thing/product/{gateway_sn}/property/set_replyDevice > Cloud Serverproperty set_reply message structResponse to the device property setting.
thing/product/{gateway_sn}/drc/upDevice > Cloud ServerDRC message structDRC upward protocol
thing/product/{gateway_sn}/drc/downCloud Server > DeviceDRC message structDRC downward protocol

Common Fields Explanation

ColumnNameTypeDescription
tidTransaction uuidtextTransaction UUID: Characterize a simple message communication. For example, add, delete, modify, check, and gimbal control. It can be:
1. Data report request + data report response
2. Handshake authentication request + Response+ack
3.One-way notification of alarm events, etc., to solve the problem of multi-concurrency transactions and message matching.
bidBusiness uuidtextBusiness UUID: Some functions are not completed in one communication and include all interactions over a period of time.
The business is usually composed of multiple atomic transactions and has a long duration;
For example, on-demand/download/playback; solves the problem of multiple concurrent and repeated requests for business, and facilitates the state machine management of all modules
timestampmillisecond timestampintthe time the message was sent
gatewaySerial number of the gateway devicetextThe serial number of the gateway device that sent the message
dataMessage contentobjectMessage content

osd Struct Example

topic: thing/product/{device_sn}/osd

{
    "tid": "65717bf1-aee7-4abb-8ea3-9b1908548d74",
    "bid": "cf5ad2e6-2f32-4b59-980e-d5c9ee412805",
    "timestamp": 1667220873846,
    "data": {
        "job_number": 492,
        "acc_time": 1859010,
        "activation_time": 0,
        "maintain_status": {
            "maintain_status_array": [
                {
                    "state": 0,
                    "last_maintain_type": 17,
                    "last_maintain_time": 0,
                    "last_maintain_work_sorties": 0
                }
            ]
        },
        "electric_supply_voltage": 231,
        "working_voltage": 25440,
        "working_current": 1120,
        "backup_battery": {
            "voltage": 26631,
            "temperature": 27.9,
            "switch": 1
        },
        "drone_battery_maintenance_info": {
            "maintenance_state": 0,
            "maintenance_time_left": 0
        }
    },
    "gateway": "dock_sn"
} 
{
    "bid": "d6cfcea4-c6ca-439b-948f-b17d88fc308f",
    "data": {
        "flighttask_step_code": 255,
        "media_file_detail": {
            "remain_upload": 0
        },
        "wireless_link": {
            "4g_freq_band": 2.4,
            "4g_gnd_quality": 0,
            "4g_link_state": 0,
            "4g_quality": 0,
            "4g_uav_quality": 0,
            "dongle_number": 0,
            "link_workmode": 0,
            "sdr_freq_band": 2.4,
            "sdr_link_state": 0,
            "sdr_quality": 0
        }
    },
    "tid": "e4c15182-776b-4c13-9973-3fc76848ca15",
    "timestamp": 1667220881576,
    "gateway": "dock_sn"
}
{
    "tid": "43d2e632-1558-4c4e-83d2-eeb51b7a377a",
    "bid": "7578f2ac-1f12-4d47-9ab6-5de146ed7b8a",
    "timestamp": 1667220916697,
    "data": {
        "network_state": {
            "type": 2,
            "quality": 0,
            "rate": 5.0970001220703125
        },
        "drone_charge_state": {
            "state": 0,
            "capacity_percent": 100
        },
        "drone_in_dock": 1,
        "rainfall": 0,
        "wind_speed": 0,
        "environment_temperature": 24,
        "temperature": 24.9,
        "humidity": 62,
        "latitude": 22.907809968,
        "longitude": 113.703482143,
        "height": 34.174125671386719,
        "alternate_land_point": {
            "latitude": 22.907898319908661,
            "longitude": 113.70347329676635,
            "safe_land_height": 0,
            "is_configured": 1
        },
        "first_power_on": 1631945855969,
        "position_state": {
            "is_calibration": 1,
            "is_fixed": 2,
            "quality": 5,
            "gps_number": 6,
            "rtk_number": 25
        },
        "storage": {
            "total": 82045336,
            "used": 51772
        },
        "mode_code": 1,
        "cover_state": 0,
        "supplement_light_state": 0,
        "emergency_stop_state": 0,
        "air_conditioner_mode": 0,
        "battery_store_mode": 1,
        "alarm_state": 0,
        "putter_state": 0,
        "sub_device": {
            "device_sn": "1581F5BKD225D00BP891",
            "device_model_key": "0-67-0",
            "device_online_status": 0,
            "device_paired": 1
        }
    },
    "gateway": "dock_sn"
}

state Struct Example

topic: thing/product/{device_sn}/state

{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "gateway":"sn",
    "data":{}
}

services Struct Example

topic: thing/product/{gateway_sn}/services

{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "gateway":"sn",
    "method": "some_method",
    "data": {}
}

services_reply Struct Example

Explanation of required fields in data

ColumnNameTypeconstraintDescription
resultThe result code of the device's responseint-Non-zero represents an error
outputDevice message contentstruct-The content of the message that the device responds to the server command
{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "gateway":"sn",
    "method": "some_method",
    "data": {
        "result": 0, 
    	"output": {}
    }  
}

events Struct Example

topic: thing/product/{gateway_sn}/events

ColumnNameTypeconstraintDescription
need_replyDoes the server need a replyint-After the server receives the device's events event report message, it follows need_reply to determine whether it has received a reply; 0 means no need, 1 means need.
{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "need_reply": 0,
    "gateway":"sn",
    "method": "some_method",
    "data": {}
}

events_reply Struct Example

topic: thing/product/{gateway_sn}/events_reply

Explanation of required fields in data

ColumnNameTypeconstraintDescription
resultResult code of server responseint-Non-zero represents an error
{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "gateway":"sn",
    "method": "some_method",
    "data": {
        "result": 0
    }
}

requests Struct Example

topic: thing/product/{gateway_sn}/requests

{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "gateway":"sn",
    "method": "some_method",
    "data": {}
}

requests_reply Struct Example

topic: thing/product/{gateway_sn}/requests_reply

Explanation of required fields in data

ColumnNameTypeconstraintDescription
resultResult code of server responseint-Non-zero represents an error
outputService message contentstruct-The server responds to the message content of the device
{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "gateway":"sn",
    "method": "some_method",
    "data": {
        "result": 0,
        "output":{}
    }
}

status Struct Example

topic: sys/product/{gateway_sn}/status

## Gateway device and sub-device online
{
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"method": "update_topo",
	"timestamp": 1234567890123,
	"data": {
		"type": 98,
		"sub_type": 0,
		"device_secret": "secret",
		"nonce": "nonce",
		"version": 1,
		"sub_devices": [
			{
				"sn": "drone001",
				"type": 116,
				"sub_type": 0,
				"index": "A",
				"device_secret": "secret",
				"nonce": "nonce",
				"version": 1
			}
		]
	}
}

## Sub-device offline
{
    "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
    "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
    "method": "update_topo",
    "timestamp": 1234567890123,
    "data": {
        "type": 98,
        "sub_type": 0,
        "device_secret":"secret",
        "nonce":"nonce",
        "version": 1,
        "sub_devices":[]
    }
}

status_reply Struct Example

topic: sys/product/{gateway_sn}/status_reply

Explanation of required fields in data

ColumnNameTypeconstraintDescription
resultResult codeint-Non-zero represents an error
{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "method": "update_topo",
    "data": {
        "result": 0 
    }
}

property set Struct Example

topic: thing/product/{gateway_sn}/property/set

ColumnNameTypeconstraintDescription
some_propertyProperty key that needs to be setstringRefer to Device Management-Device Property Setopen in new window
Whether a property can be set or not can be judged according to the "accessMode" identifier on the "Properties chapter". If accessMode = 2, this property can be set.
some_valueProperty value that needs to be setstring/int/floatrefer to the property that is set
{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "data": {
      "some_property": some_value
    }
}

property set_reply Struct Example

topic: thing/product/{gateway_sn}/property/set_reply

Explanation of required fields in data

ColumnNameTypeconstraintDescription
some_propertyProperty key that needs to be setstringRefer to Device Management-Device Property Setopen in new window
Whether a property can be set or not can be judged according to the "accessMode" identifier on the "Properties chapter". If accessMode = 2, this property can be set.
resultSetting resultint0: success, 1: fail, 2: time exceed, other value: refer to the error code.
{
    "tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
    "bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
    "timestamp": 1598411295123,
    "data": {
        "some_property": {
           "result": 0  // 0: success, 1: fail, 2: time exceed, other value: refer to the error code.
        }
    }
}

drc up Struct Example

topic: thing/product/{gateway_sn}/drc/up

Explanation of required fields in data

ColumnNameTypeconstraintDescription
resultResult code of device responseint-Non-zero represents an error
{
	"data": {
		"result": 0
	},
	"method": "drone_emergency_stop",
	"seq": 1
}

drc down Struct Example

topic: thing/product/{gateway_sn}/drc/down

{
	"data": {},
	"method": "drone_emergency_stop",
	"seq": 1
}
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.