dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
981 stars 579 forks source link

HardwareState: FlightModeSwitch: Ambiguity in DJI Api reference Document #290

Open Kishan003 opened 6 years ago

Kishan003 commented 6 years ago

Hi Team,

There is an Ambiguity in DJI Api reference Document ( https://developer.dji.com/api-reference/android-api/Components/RemoteController/DJIRemoteController_DJIRCHardwareState.html?search=flightmode&i=1&#djiremotecontroller_djiremotecontrollerflightmodeswitchposition_inline ) about the position of FlightMode switch, When I Verified in Phantom 4, Mavic Pro and spark the position of Sport mode is always 2(POSITION_TWO) but Document misconstrues it. Can you please verify and Please Update me on this?

According to my understanding, POSITION_ONE is missing for Mavic Pro and spark, Please correct me if am wrong here.

I have to Check when user switch to "Sport mode" so I am looking for a optimal way of handling it for all supported models here.

ligongzixing commented 6 years ago

How can you get the FlightModeSwitch? Through the DJIKey or the setHardwareStateCallback?

kenargo commented 6 years ago

Either is available, chose the one that best fits your application architecture..

You can use the key: file:///C:\Users\kenar\Documents\DJI\Mobile-SDK-Android\docs\API%20Reference\Components\KeyManager\DJIRemoteControllerKey.html#remotecontrollerkey_flight_mode_switch_position_key RemoteControllerKey.FLIGHT_MODE_SWITCH_POSITION

And you can also use the callback: setHardwareStateCallback()

Both should return the identical information.

From: ligongzixing [mailto:notifications@github.com] Sent: Friday, August 17, 2018 6:27 AM To: dji-sdk/Mobile-SDK-Android Mobile-SDK-Android@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [dji-sdk/Mobile-SDK-Android] HardwareState: FlightModeSwitch: Ambiguity in DJI Api reference Document (#290)

How can you get the FlightModeSwitch? Through the DJIKey or the setHardwareStateCallback?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dji-sdk/Mobile-SDK-Android/issues/290#issuecomment-413865472 , or mute the thread https://github.com/notifications/unsubscribe-auth/AM7-OESbepdmdOAJwmLtSKUXOA5qT3D8ks5uRsSkgaJpZM4T0Wr_ . https://github.com/notifications/beacon/AM7-ODU_5mj9_oRTSQHhOa9NXZq4rgHIks5uRsSkgaJpZM4T0Wr_.gif