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:
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.