DJI Mobile SDK Documentation

      class BluetoothProductConnector

      class BluetoothProductConnector
      Package:dji.sdk.sdkmanager
      Description:

      Some DJI products can be controlled using the Mobile SDK over a Bluetooth wireless connection. This class contains methods to search for, connect to, and disconnect from such products.

      Class Members:
      method setBluetoothDevicesListCallback
      void setBluetoothDevicesListCallback(@Nullable BluetoothDevicesListCallback callback)
      Package:dji.sdk.sdkmanager
      Description:

      Set DJIBluetoothProductConnector Listener.

      Input Parameters:
      @Nullable BluetoothDevicesListCallback callbackThe callback of BluetoothDevicesListCallback.
      method searchBluetoothProducts
      void searchBluetoothProducts(@Nullable final CompletionCallback callback)
      Package:dji.sdk.sdkmanager
      Description:

      Used to start searching for DJI Products that are near the mobile device and can be controlled with the Mobile SDK using Bluetooth. Use onUpdate to receive the product list.

      Input Parameters:
      @Nullable final CompletionCallback callbackCompletion block returns the command execution result. It is called once the searching is started.
      Connection
      method
      method connect
      void connect(BluetoothDevice product, final CompletionCallback callback)
      Package:dji.sdk.sdkmanager
      Description:

      Connects to the DJI product using Bluetooth. Once it is connected, DJISDKManager can be used to access the product.

      Input Parameters:
      BluetoothDevice productThe Bluetooth product to connect to.
      final CompletionCallback callbackThe completion block returns the command execution result.
      method disconnect
      void disconnect(final CompletionCallback callback)
      Package:dji.sdk.sdkmanager
      Description:

      Disconnects connected Bluetooth product.

      Input Parameters:
      final CompletionCallback callbackThe completion block returns the command execution result.
      State Updates
      interface
      interface BluetoothDevicesListCallback
      interface BluetoothDevicesListCallback
      Package:dji.sdk.sdkmanager
      Description:

      Delegate that receives the product list found by the connector.

      Interface Methods:
      State
      method
      method onUpdate
      void onUpdate(@NonNull List<BluetoothDevice> devices)
      Package:dji.sdk.sdkmanager
      Description:

      Provides the list of DJI products that can be connected with the mobile device over Bluetooth. Delegate will continue to receive an updated list after searchBluetoothProducts is called until the searching is finished (either product is connected or after 10s).

      Input Parameters:
      @NonNull List<BluetoothDevice> devicesA list of DJI products found by the connector.