The KeyManager class provides a set of methods to access the parameters of the hardware module and control the behavior of the hardware module, including DJIKey Value setting, Value acquisition, Value monitoring, and Action execution. The DJIKey instance can be created more conveniently through the createKey method provided by the KeyTools class.
- DJIKey's setValue method.
- DJIKey's getValue method.
- DJIKey's value listener.
- DJIKey's action execution.
You can easily create a DJIKey instance bu calling the createKey() method from KeyTools class.
In MSDK V4, the usage of DJIKey has been encapsulated as setter and getter method such as setHomeLocation() and getHomeLocation(). In fact the setHomeLocation() is calling the setValue method for DJIKey HOME_LOCATION. In MSDK V5, all DJIKey will not be encapsulated and it requires you to use the very basic method to execute those keys.
There are 7 types of DJIKey is opened to public:
- ProductKey
- AirlinkKey
- CameraKey
- GimbalKey
- FlightControllerKey
- RemoteControllerKey
- BatteryKey
The following figure shows the calling process of using the KeyManager interface to determine that the flight controller is connected normally and the GPS signal level is greater than or equal to level 2, then setting the home point for the aircraft, and finally executing the return operation. For detailed usage, please check the API documentation of Mobile SDK.
Comments
1 comment
In sdk 4 the keylistener callbacks by default occurred on a dji_callback_thread. It appears that some, maybe all callbacks in sdk 5 occur on the main thread. Is that expected behaviour?
Please sign in to leave a comment.