C2-SFL100 SDK Interface Documentation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

C2-SFL100 SDK Interface Documentation​

Introduction to SDK and SFL100 Control:​


C2-SDK software is a lightweight and flexible interface for connecting to SFL100 and reducing
the cost of secondary development for customers. The C2-SDK interface can be accessed across
different computing languages such as C, C++, Java, different platforms such as Windows, Linux.
The simplicity and flexibility of the C2-SDK interface make it possible to communicate robustly
and efficiently with SFL100.​
2. SDK feature description​
C2-SDK is an executable program with the file name cuav_proxy. It can be deployed on Windows
or Linux machines and connected to SFL100 through a network cable. C2-SDK provides Http and
Websocket interfaces to the outside world. SFL100 control commands are issued through the
Http protocol, and SFL100 data is uploaded through the Webscocket protocol.​
3. Usage:​
SFL100 needs to be connected to the network through a network cable. The server that deploys
C2-SDK needs to ensure that it is in the same network segment as the network that SFL100
accesses. If the IP of SFL100 is 192.168.2.34, the server that deploys C2-SDK needs to have the
same default gateway as the Tracer with 192.168.2.34 IP, otherwise C2-SDK cannot connect to
SFL100.​
3.1 Use on Windows platform​
3.1.1 Environment preparation for use​
Before using the cuav_proxy software, please make sure that the local network port 1860 is not
occupied. To check if the port is occupied, you can use the netstat -an | findstr "1860" command
in the cmd or powershell of Windows. As shown in Figure 1, if there is no output after executing
the command, it means that the port is not occupied. (Please make sure that the cuav_proxy
network and device are in the same LAN and have the same gateway address.)​
Figure 1​
3.1.2 Device connection and use cuav_proxy open functional interface.​
Double-click to run the cuav_proxy application, as shown in Figure 2, and you can see that the
proxy_proxy has started.​

Figure 2​
Connect to the software via WebSocket port 1860 to obtain information reported by cuav_proxy.
When no SFL100 device is connected, cuav_proxy no reported information.​
By enabling SFL100 to access the cuav_proxy software, you can obtain the information and
device status information of the drone reported by SFL100. Figure 4 shows the cuav_proxy
software connected to SFL100 reporting the drone information detected by SFL100.​
Figure 3​
Figure 4 shows the horizontal rotation operation of the SFL100 device through the HTTP
interface.​
Figure 4​
4. Interface list:​
4.1 Set strike point information​
4.1.1 interface description​
Set strike parameters​
4.1.2 request address​
http://Ip:1860/device/sfl/hit-angle​
4.1.3 request parameters​
Direction​ Post Request​
Request​ Type​ Description​
sn​ string​ SFL100 Device Serial Number​
hitAngleBegin​ int32​ Starting angle of strike range​
Request hitAngleEnd​ int32​ End of strike angle​
parameters​ hitTime​ int32​ Strike duration, unit seconds​
hitPitchBegin​ int32​ Strike starting pitch angle​

hitPitchEnd​ int32​ Strike termination pitch angle​


Answer​ Yes​

Direction​ Post response​


Response Response​ Type​ Description​
parameter​
result​ object​ Return the result​
code​ int​ Error code: 0 for success​
msg​ string​ Error message​
data​ object​ Return data​
status​ int​ 0 failure, 1 success​

4.1.4 Usage Example​


POST http://127.0.0.1:1860/device/sfl/hit-angle​
Request structure​
{​
"sn":"Sfl-001",​
"hitAngleBegin":10,​
"hitAngleEnd":20,​
"hitTime":30,​
"hitPitchBegin":5​
"hitPitchEnd":10​
}​

Return structure​
{​
"result": {​
"code": 0,​
"msg": "Success"​
},​
"data": {​
"status": 1​
}​
}​

4.1.5 remarks​

Error Error description​


code​
-1001​ Incorrect request data parameter​
-1002​ Internal service errors, such as devices not online, response
timeouts caused by poor network quality, etc.​
-1003​ Internal service error, device returns message error​

4.2 Manual horizontal rotation of the sentry tower​


4.2.1 interface description​
Manual horizontal control sentry tower rotation​
4.2.2 request address​
http://IP:1860/device/sfl/horizontal-turn​
4.2.3 request parameters​
Direction​ Post Request​
Request​ Type​ Description​
sn​ string​ SFL100 Device Serial Number​
startStopTurn​ int32​ 1 Start rotating 2 Stop rotating​
direction​ int32​ 1: clockwise rotation 2:
counterclockwise rotation​
angle​ int32​ The target angle unit of rotation is
Request 0.01 degrees. When Direction = 0xFF,
parameters​ the valid range of this value is 0-
36000, and other values are invalid​
speed​ int32​ Rotational speed, unit is
degrees/second 0: indicates the
maximum speed of rotation. When
the specified maximum speed is
greater than the speed of the
equipment, the equipment will rotate
at the maximum speed​
Answer​ Yes​

Direction​ Post response​


Response​ Type​ Description​
Response
parameter​ result​ object​ Return the result​
code​ int​ Error code: 0 for success​
msg​ string​ Error message​
data​ object​ Return data​
status​ int​ 0 failure, 1 success​

4.2.4 Usage Examples​


POST http://127.0.0.1:1860/device/sfl/horizontal-turn​
Request structure​
{​
"sn":"Sfl-001",​
"startStopTurn":1,​
"direction":1​
}​

Return structure​
{​
"result": {​
"code": 0,​
"msg": "Success"​
},​
"data": {​
"status": 1​
}​
}​
4.2.5 remarks​
Error Error description​
code​
-1001​ Incorrect request data parameter​
-1002​ Internal service errors, such as devices not online, response
timeouts caused by poor network quality, etc.​
-1003​ Internal service error, device returns message error​

4.3 Manual vertical rotation sentry tower​


4.3.1 interface description​
Manual vertical control sentry tower rotation​
4.3.2 request address​
http://IP:1860/device/sfl/vertical-turn
4.3.3 request parameters​
Direction​ Post Request​
Request​ Type​ Description​
sn​ string​ SFL100 Device Serial Number​
startStopTurn​ int32​ 1 Start rotating 2 Stop rotating​
direction​ int32​ 1: clockwise rotation 2:
counterclockwise rotation​
angle​ int32​ The target angle unit of rotation is
Request 0.01 degrees. When Direction = 0xFF,
parameters​ the valid range of this value is 0-
36000, and other values are invalid​
speed​ int32​ Rotational speed, unit is
degrees/second 0: indicates the
maximum speed of rotation. When
the specified maximum speed is
greater than the speed of the
equipment, the equipment will rotate
at the maximum speed​
Answer​ Yes​

Direction​ Post response​


Response Response​ Type​ Description​
parameter​
result​ object​ Return the result​
code​ int​ Error code: 0 for success​
msg​ string​ Error message​
data​ object​ Return data​
status​ int​ 0 failure, 1 success​

4.3.4 Usage Examples​


POST http://127.0.0.1:1860/device/sfl/vertical-turn​
Request structure​
{​
"sn":"Sfl-001",​
"startStopTurn":1,​
"direction":1​
}​

Return structure​
{​
"result": {​
"code": 0,​
"msg": "Success"​
},​
"data": {​
"status": 1​
}​
}​
4.3.5 remarks​
Error Error description​
code​
-1001​ Incorrect request data parameter​
-1002​ Internal service errors, such as devices not online, response
timeouts caused by poor network quality, etc.​
-1003​ Internal service error, device returns message error​

4.4 Set Strike Mode​


4.4.1 interface description​
Set strike mode​
4.4.2 request address​
http://Ip:1860/device/sfl/hit-mode-set​
4.4.3 request parameters​
Direction​ Post Request​
Request​ Type​ Description​
sn​ string​ SFL100 Device Serial Number​
hitMode​ int32​ 2: Crack down on flight control image
transmission​
Request 3. Combating GNSS​
parameters​ 4: Combat flight control image
transmission + combat GNSS​
14: Combat FPV​
128: Strike full frequency band​
129: Strike full-band + GNSS​
Answer​ Yes​

Direction​ Post response​


Response Response​ Type​ Description​
parameter​
result​ object​ Return the result​
code​ int​ Error code: 0 for success​
msg​ string​ Error message​
data​ object​ Return data​
status​ int​ 0 failure, 1 success​

4.4.4 Usage Examples​


POST http://127.0.0.1:1860/device/sfl/hit-mode-set​
Request structure​
{​
"sn":"Sfl-001",​
"hitMode":2​
}​

Return structure​
{​
"result": {​
"code": 0,​
"msg": "Success"​
},​
"data": {​
"status": 1​
}​
}​
4.4.5 remarks​
Error Error description​
code​
-1001​ Incorrect request data parameter​
-1002​
Internal service errors, such as devices not online, response
timeouts caused by poor network quality, etc.​
-1003​ Internal service error, device returns message error​

4.5 Manual Start/Stop Strike​


4.5.1 interface description​
Manually start, stop strike​
4.5.2 request address​
http://Ip:1860/device/sfl/turn-hit​
4.5.3 request parameters​
Direction​ Post Request​
Request​ Type​ Description​
Request sn​ string​ SFL100 Device Serial Number​
parameters​
startStop int32​ 1: Start Strike 2: Stop Strike​
Answer​ Yes​

Direction​ Post response​


Response​ Type​ Description​
result​ object​ Return the result​
Response code​ int​ Error code: 0 for success​
parameter​ msg​ string​ Error message​
data​ object​ Return data​
status​ int​ 0 failure, 1 success​

4.5.4 Usage Examples​


POST http://127.0.0.1:1860/device/sfl/turn-hit​
Request structure​
{​
"sn":"Sfl-001",​
"startStop":2​
}​

Return structure​
{​
"result": {​
"code": 0,​
"msg": "Success"​
},​
"data": {​
"status": 1​
}​
}​
4.5.5 remarks​
Error Error description​
code​
-1001​ Incorrect request data parameter​
-1002​ Internal service errors, such as devices not online, response
timeouts caused by poor network quality, etc.​
-1003​ Internal service error, device returns message error​

4.6 Upload SFL100 heartbeat data​


4.6.1 interface description​
Device reports heartbeat message, including device angle and status​
4.6.2 request address​
ws://IP:1860/ws/v1/report​
4.6.3 report parameters​

Direction​ Device reports message​


Response Response​ Type​ Description​
parameter​
Sn​ string​ Device sn​
TimeStamp​ int32​ System timestamp​
WorkStatus​ int32​ Working state​
0: Standby​
1: Omnidirectional detection​
2: Directional detection​
Detection completed​
4: Aim​
5: Combat flight control image
transmission​
6: Combating GNSS​
7: Combat flight control image
transmission + combat GNSS​
8: Combat FPV​
9: Low battery does not strike​
10: Do not strike at high temperatures​
11: Power on and starting up​
12: power off​
13: OTA​
14: PTZ self-test
IsOnline​ int32​ Online 0 Online 1 Offline​
HitFreq​ int32​ 0: Strike all ranges​
1: Strike less than 2G​
2: Strike 2-4G​
3: Strike 4-6G​
4: Strike 2G, 2-4G​
5: Strike 2-4G, 4-6G​
6: Strike 2G, 4-6G​
DetectFreq​ float64​ Detection scan frequency (MHz)​
Elevation​ float64​ Gun pitch angle (0.01 °)​
GunDirection​ float64​ Gun orientation (0.01 °)​
GunLongitude​ float64​ Longitude​
GunLatitude​ float64​ Latitude​
GunAltitude​ float64​ Altitude (m)​
SatellitesNum​ int32​ Number of GNSS satellites​
FaultLevel​ int32​ Anomaly level​
0: None​
Level 1:1 exception, limited functionality​
Level 2 exception, unable to use​
Others: reserved​
CtrlFault​ int32​ Control module exception.
0 is normal, greater than 0 is a fault code​
AeagFault​ int32​ Countermeasure module exception.​
0 is normal, greater than 0 is a fault code​
TracerFault​ int32​ Tracer module exception.​
0 is normal, greater than 0 is a fault code​
WorkStatusParam​ int32​ Parameters of workStatus​
1. When workStatus is "14: PTZ self-test",
it indicates the remaining self-test time
in seconds.​
2. When workStatus is another value, the
value is invalid. Always 0.​

4.7 Upload SFL probe message​


4.7.1 interface description​
SFL reports detected drone information​
4.7.2 request address​
ws://IP:1860/ws/v1/report​
4.7.3 report parameters​
Direction​ Device reports message​
Response ProductType​ int32​ Type of drone​
parameter​
DroneName​ string​ Name of drone​
SerialNum​ string​ Drone SN​
DroneLongitude​ float64​ Longitude of drone​
DroneLatitude​ float64​ Drone latitude​
DroneHeight​ float64​ Drone relative ground height (0.1m)​
DroneYawAngle​ float64​ Drone Angle (0.01 deg)​
DroneSpeed​ float64​ Absolute speed of drone (0.01m/s)​
DroneVerticalSpeed​ float64​ Drone vertical speed (0.01m/s)​
SpeedDirection​ int32​ 0: drone horizontal forward lite​
1: drone horizontally lite backwards​
2: drone horizontally lite to the left​
3: drone horizontally lite to the right​
4: drone vertical​
Invalid value is 0xFF​
DroneSailLongitude​ float64​ Drone Waypoint Longitude (/1e7)​
DroneSailLatitude​ float64​ Drone Waypoint Longitude (/1e7)​
PilotLongitude​ float64​ Pilot longitude​
PilotLatitude​ float64​ Flyer latitude​
DroneHorizon​ float64​ Target horizontal angle​
DronePitch​ float64​ Target pitch angle​
UFreq​ float64​ Drone signal frequency​
UDistance​ int32​ Distance of drone to equipment​
UDangerLevels​ int32​ Danger level​
Role​ int32​ Drone Characters: 1-Enemy 2-Friendly 3-
Unknown 4-Neutral​
UZC​ int32​ ZC sequence value​
UDirStatus​ int32​ Orientation Status 0: Non-Orientation
Status 1: Orientation In Progress 2:
Orientation Successful, Other: Reserved​
UNumber​ uint32​ Number​
WifiMac​ []byte​ wifi MAC​

You might also like