WebSocket

2022-07-19
No Rating

For some features, Websocket communication is required, so DJI Pilot 2 and the server need to establish a WebSocket channel. When DJI Pilot 2 logs in and goes online through Webview, the server needs to respond to the URL address of the WebSocket to DJI Pilot 2, and then DJI Pilot 2 will make a WebSocket connection request.

The specific general message push interface protocol format is as follows:

url: xxxx.xx.xxx  
method:post

body:
{
    "biz_code": "device_topo_update",
    "version":"1.0"
    "timestamp": 146052438362,
    "data":{
        "operator": "zhangsan", //It is recommended to use callsign directly
         // The specific content is adjusted with biz_code or sub_biz_code
    }
}