Module Sdk (v1)#
REST Requests:#
Websockets:#
Websocket endpoint: GET /api/v1/sdk/notifications
Websocket Events:
Module Sdk REST API (v1)#
- GET /api/v1/sdk/description#
get sdk description
- Status Codes:
200 OK – the sdk description hashmap indexed by command id – JSON Schema: sdk_value
500 Internal Server Error – if there is a server internal error
Example:
Get the sdk description
GET /api/v1/sdk/description
{ "0x00000000": { "args": [], "cls": "Network", "cmd": "Disconnect", "id": "0x00000000", "prj": "Common" }, "0x00010000": { "args": [ { "bitfield": false, "name": "Cause", "type": "enum" } ], "cls": "NetworkEvent", "cmd": "Disconnection", "id": "0x00010000", "prj": "Common" }, "0x00030003": { "args": [ { "bitfield": false, "name": "Software", "type": "string" }, { "bitfield": false, "name": "Hardware", "type": "string" } ], "cls": "SettingsState", "cmd": "ProductVersionChanged", "id": "0x00030003", "prj": "Common" } }
- GET /api/v1/sdk/capture_filters#
get capture filter list
- Status Codes:
200 OK – the list of string reprensentation of the sdk command id in hexadecimal – JSON Schema: array(string)
500 Internal Server Error – if there is a server internal error
Example:
Get the capture filter list
GET /api/v1/sdk/capture_filters
[ "0x01190002", "0x01010000", "0x01010001", "0x01010002", "0x01040008", "0x01040006" ]
- PUT /api/v1/sdk/capture_filters/(cmd_id)#
add a capture filter
- Parameters:
cmd_id (string) – the sdk command id (can be in base 8/10/16)
- Status Codes:
200 OK – no error
400 Bad Request – if the request is incorrect
500 Internal Server Error – if there is a server internal error
Example:
add the command (id=0x01000002) to the capture filter list
PUT /api/v1/sdk/capture_filters/0x01000002 PUT /api/v1/sdk/capture_filters/16777218 PUT /api/v1/sdk/capture_filters/0100000002
- DELETE /api/v1/sdk/capture_filters/(cmd_id)#
remove a capture filter
- Parameters:
cmd_id (string) – the sdk command id (can be in base 8/10/16)
- Status Codes:
200 OK – no error
400 Bad Request – if the request is incorrect
404 Not Found – if the requested cmd is not currently filtered
500 Internal Server Error – if there is a server internal error
Example:
remove the command (id=0x01000002) from the capture filter list
DELETE /api/v1/sdk/capture_filters/0x01000002 DELETE /api/v1/sdk/capture_filters/16777218 DELETE /api/v1/sdk/capture_filters/0100000002
Module Sdk Websocket events (v1)#
Endpoint:
- GET /api/v1/sdk/notifications#
- Request Headers:
Connection – Upgrade
Upgrade – websocket
Events:
Module Sdk JSON Schema (v1)#
known_cmd_caught#
type |
object |
properties |
|
|
string |
|
unknown_cmd_caught#
type |
object |
properties |
|
|
string |
|
sdk_value#
type |
object |
|
properties |
||
|
string |
|
|
string |
|
|
string |
|
|
string |
|
|
type |
array |
items |
args#
type |
object |
properties |
|
|
string |
|
|
|
boolean |
type#
type |
string |
|
oneOf |
a 8 bits signed integer |
|
const |
i8 |
|
a 8 bits unsigned integer |
||
const |
u8 |
|
a 16 bits signed integer |
||
const |
i16 |
|
a 16 bits unsigned integer |
||
const |
u16 |
|
a 32 bits signed integer |
||
const |
i32 |
|
a 32 bits unsigned integer |
||
const |
u32 |
|
a 64 bits signed integer |
||
const |
i64 |
|
a 64 bits unsigned integer |
||
const |
u64 |
|
a 32 bits float number |
||
const |
float |
|
a 64 bits double number |
||
const |
double |
|
an utf8 string |
||
const |
string |
|
an enum value |
||
const |
enum |
known_cmd_caught_event_data#
type |
object |
properties |
|
|
unknown_cmd_caught_event_data#
type |
object |
properties |
|
|
cmd#
type |
object |
|
properties |
||
|
string |
|
|
string |
|
|
||
|
type |
array |
items |
string |
unknown_cmd#
type |
object |
properties |
|
|
string |
|
string |
|
string |
|
string |
|
direction#
type |
string |
|
oneOf |
the command is received on the drone (from the controller) |
|
const |
RX |
|
the command is transmitted to the controller (from the drone) |
||
const |
TX |