V5 has made a big change in this part of the logic, so in this article we will do a comparison with V4, and then explain how V5 is going to get and listen to the connection status.
1)V4 vs V5
V4 listens to the drone and each component through the SDKManagerCallback, and any change in the state of the device will trigger a callback.
Although V5 also provides SDKManagerCallback interface, it only triggers when the software is disconnected from the remote control, which means the software is completely disconnected from the hardware, so the callback will not be triggered when the M30 series disconnects the drone, because the software recognizes the remote control.
2)How V5 gets and listens to the connection status
V5 abandoned the form of V4 listening to all modules through the same interface, and instead used the KeyConnection of each module to obtain and listen to the connection status.
The modules currently given are ProductKey, AirLinkKey, CameraKey, GimbalKey, FlightControllerKey, RemoteControllerKey and BatteryKey. The connection status of each of these modules can be determined by the KeyConnection of the relevant module.
3)How to get and listen to the connection status of the drone
In fact, we can determine whether the drone is connected by the KeyConnection of FlightControllerKey, because the flight control component must be bound to the drone. Or determine whether the currently connected device is an aircraft by the KeyConnection and KeyProductType of the ProductKey.
Comments
0 comments
Please sign in to leave a comment.