Android Question DJI OcuSyncLink class access [solved]

madru

Active Member
Licensed User
Longtime User
Hi,

I try to get the getFrequencyBand from the SDK as described here: https://developer.dji.com/api-refer...ynclink_getfrequencybandwithcompletion_inline

unfortunately
B4X:
OcuSyncLink.RunMethod("getFrequencyBand", Array(cc))
fails with no reason, what am I doing wrong?


B4X:
Sub getFrequencyBand As ResumableSub
    If aircraft.Connected Then
        Dim airlink As JavaObject = aircraft
        airlink = airlink.RunMethod("getAirLink", Null)
        If airlink.IsInitialized Then
            Dim OcuSyncLink As JavaObject = airlink.RunMethod("getOcuSyncLink", Null)
            If OcuSyncLink.IsInitialized Then
                Dim cc As Object = OcuSyncLink.CreateEventFromUI("dji.common.util.CommonCallbacks$CompletionCallbackWith", "callback", Null)
                OcuSyncLink.RunMethod("getFrequencyBand", Array(cc))' not workin no cc
                Wait For (OcuSyncLink) Callback_Event (MethodName As String, Args() As Object) ' always failure
                If MethodName = "onSuccess" Then
                    Log("getFrequencyBand "&Args(0))
                    Return Args(0)
                Else
                    Log("OcuSyncLink onSuccess getFrequencyBand failed")
                End If
            End If
        End If
    Else
        Log("not connected")
    End If
End Sub
 

madru

Active Member
Licensed User
Longtime User
using the same code (replacing OcuSync with Lightbride) with a Lightbridhe drone does work, so the code must be OK. No idea why a Mavic Pro returns nothing.....
 
Upvote 0
Top