0

It is stated, in this answer : That when you want to receive data from dji-mobile sdk, you set a callback function.

Then :

The OSDK will call a user-defined callback whenever data is received from the MSDK.

Does this mean, that if i have a code like this :

void fromMobileSDKCallback(
Vehicle* vehicle, RecvContainer recvFrame, UserData userData) {
 //statements with recvFrame;
 // update a global variable recvGlobal
}

vehicle->moc->setFromMSDKCallback(fromMobileSDKCallback, linuxEnvironment);

then, later on in a program, a block like :

while(true) {
// check if recvGlobal is updated
}

will work, and i will be able to see the changes reflected in recvGlobal indefinitely?

Thank you.

Sean
  • 789
  • 6
  • 26

1 Answers1

0

I don't have too much experience with the Onboard SDK, but in theory I believe the answer is yes your approach should work.

I've done something similar in the opposite case, using mobile SDK and sendDataToOnboardSDKDevice (see my currently unanswered question) and through other mobile callbacks (startMission, SdCardCallbacks, etc.) where I change a global variable and it updates something elsewhere.

So, in principle the answer is yes, but I don't know enough about the onboard sdk (c++?) to know that your specific code is implemented properly.