20.dock-device-management

Function Overview

Device management function supports reporting device topology information to the server, pushing device property to the server, and the server setting the device property. Users can check and modify the status of devices on server.

Interaction Sequence Diagram

sequenceDiagram
participant object as Aircraft
participant client as DJI Dock
participant server as Cloud Server

note over object,server: Device online
object ->> client: Device and gateway device are connected, the device is online.
client ->> server: Device Topology Update Topic: sys/product/{gateway_sn}/status<br/>Method: update_topo

loop  osd property is pushed at 0.5HZ
object ->> client: Aircraft property push
client ->> server: Aircraft property push Topic: thing/product/{device_sn}/osd
client ->> server: Dock property push Topic: thing/product/{device_sn}/osd
end

opt state property is pushed when property is changed
object ->> client: Aircraft property push
client ->> server: Aircraft property push Topic: thing/product/{device_sn}/state
client ->> server: Dock property push Topic: thing/product/{device_sn}/state
end

server ->> client: Device property set Topic: thing/product/{gateway_sn}/property/set
client ->> object: Change command issued
object ->> object: Device peroperty is changed
object ->> client: Aircraft response
client -->> server: Device response Topic: thing/product/{gateway_sn}/property/set_reply

note over object,server: Device offline
object --x client: Device and gateway device are not connected, the device is offline.
client ->> server: Device Topology Update Topic: sys/product/{gateway_sn}/status<br/>Method: update_topo

Detailed API Realization

  • Device Management (MQTT):

    • Device Topology Update When gateway device perceives the connection and disconnection with the sub-devices, gateway device will report the online and offline status of sub-devices. The type and sub_type value of API can be checkout from Product Type.

    • Device Property Push Device property is divided into osd property and state property. The osd property is pushed at 0.5HZ frequency. The state property is pushed when property changes. Different properties is pushed by different topic. The properties is introduced at the chapter: Aircraft Properties, Dock Properties and Remote Controller Properties.

    • Device Property Set

      • Not all the device properties can be set from the Server, we will implement that in the near future.

      • In the "Device Property" chapter, you can check the read and write status of device properties by the symbol "accessMode". If the "accessMode" is "rw" means that the properites can be set.

      • Device property set only supports setting single peoperty field. For example, property distance_limit_status has two fields state and distance-limit. When setting the property distance_limit_status, the set command should be sent twice.

Last updated