Getting RC model - MSDK 4
CompletedHi, I am trying to get the model of the current connected RC.
Using MSDK 4 latest version, I am getting the DISPLAY_NAME key value, and comparing it to the ENUMs that start with the keyword DisplayName in RemoteController class (ex. "DisplayNameDJIAir2s").
The problem is, some RC do not support getting the DISPLAY_NAME, I am getting NULL value when getting that key, so I can't identify the connected RC model.
My code for getting the DISPLAY_NAME of RemoteController:
KeyManager.getInstance().addListener(RemoteControllerKey.create(RemoteControllerKey.DISPLAY_NAME), (o, o1) -> {
String name = (String) o1;
Logger.i(TAG, String.format("DISPLAY_NAME name: %s", o1));
model = SupportedRemoteControllerModel.fromName(name);
});
What am I doing wrong? Is there any other way to get the DISPLAY_NAME or maybe getting the Model of the connected RC?
-
Our engineers will be on holiday for the Chinese New Year(2-06~ 2-17), which may cause some delays in responding to your ticket. We appreciate your patience and apologize for the inconvenience this may cause you. You can first search for related articles in our knowledge base https://djisdksupport.zendesk.com/hc/en-us. We will answer your ticket as quickly as possible when the holiday is over. -
Using the following method, you can obtain the name of the remote control. KeyManager.getInstance().getValue(RemoteControllerKey.create(RemoteControllerKey.DISPLAY_NAME), new GetCallback() { @Override public void onSuccess(@NonNull Object o) { String name = (String) o; Log.d("RemoteController", "DISPLAY_NAME: "+name); } @Override public void onFailure(@NonNull DJIError djiError) { Log.d("RemoteController", "onFailure: "+djiError.getDescription()); }}); -
Works for you and also works on other controllers we have.
But on that specific Smart controller we get null value.
Must be a faulty device, I will try reset to factory settings. Thank you!
Please sign in to leave a comment.
Comments
11 comments