Detect when drone powered down while RC is still powered on

Completed

Comments

4 comments

  • DJI Developer Support
    There is no way to detect if the power is off because for app side. All 2 possible reasons will give you exactly the same phenomenon, you will see a product is null/none etc. 1. Lose airlink connection. 2. Power off.
    0
    Comment actions Permalink
  • Brien Crean

    Sorry I do not understand your reply. Can you please clarify? Is it possible to detect when the drone has disconnected from the RC? Is there some SDK property or function I can call to see if the connection between the RC and Aircraft is active??

    When I power off the aircraft and query the SDK the isConnected property of each of these returns true

    airLink, camera, battery, flightController

    The product is not null. Everything appears as if the drone is still connected.

    The only behaviour I see is that most of the delegate methods, e.g flightControllerdidUpdateState, airLink didUpdateDownlinkSignalQuality/didUpdateUplinkSignalQuality stop sending updates. 

    Thank you

    0
    Comment actions Permalink
  • Brien Crean

    Also testing with the sample app. I added the DJISDKManager componentConnectedWithKey, componentDisconnectedWithKey, productChanged delegate functions. None of these functions are called when the drone is powered down (RC still powered on). These functions are only called when the drone is powered back on

    0
    Comment actions Permalink
  • Brien Crean

    It turns out componentDisconnectedWithKey and productChanged delegate functions were not firing for me because the instance running the DJISDKManagerDelegate protocol was not running on the main thread so bizarrely sometimes they would fire and sometimes not. By specifying that it runs on the main thread fixed my issue.

     

    - (dispatch_queue_t)methodQueue

    {

        return dispatch_get_main_queue();

    }

    0
    Comment actions Permalink

Please sign in to leave a comment.