Please select Into the mobile phone version | Continue to access the computer ver.
Close
You need to log in before you can reply       Login | Register now

[Help] Sending Data to Onboard

Author: Valkaryn 2017-5-22 17:42
7 355
Hello,

I am trying to send data from the Android mobile device to Onboard device. On the mobile level transmission completes correctly, but in terminal on the onboard level I see only "STATUS recvReqData, line 179: Receive data from mobile".

Can you help me please, is the any way to display received data in the terminal?

This post contains more resources

You need to Login Before they can download or view, Not have an account?Register now

x
Reply
Replies
ChrisJagielski
I'm not familiar with the code, but look at the "line 179" that prints out that message... and from there add a new cout to display the data you want to see! Good luck!
2017-5-23 23:36
Valkaryn
Unfortunately, it's not so easy. I don't know where sending data received to on the Onboard level. I thought that data received to the
  1. protocolHeader + sizeof(Header) + 2
Copy the code
so I tried to write this data to the buffer:
  1. memcpy(buf, (unsigned char*)protocolHeader + sizeof(Header) + 2, 100);
Copy the code
But in the terminal displays strange data, which does not match with the data I send from Android.
2017-5-24 17:10
ChrisJagielski
Maybe the type is different, I've noticed DJI uses lots of structs and unique variable types... perhaps there's conversion/casting that doesn't work?
2017-5-25 23:24
al6uiz

How did you get mobile packet?
This is my method.

// Initialization
api->setFromMobileCallback(OnReceivePacketFromMobile)

// Callback
void OnReceivePacketFromMobile(CoreAPI api, Ptr pHeader, UserData data)
        {
            var pMyPacket = pHeader + CoreAPI.HEADER_SIZE + 2;

...
}
2017-6-5 02:32
Valkaryn
Thanks. I found out the way to receive data from mobile device correctly.
2017-6-6 17:55
phorstrand
Valkaryn Posted at 2017-6-6 17:55
Thanks. I found out the way to receive data from mobile device correctly.

Hi,

Could you tell me how you solved the issue? I'm facing the same problem here.
In my case, I'm sending data from the iOS app using the sendDataToOnBoardSDKDevice, but then on the other end, the OES I'm unable to properly read the data.
I'm currently using the function available at the mobile_sample:

parseFromMobileCallback(Vehicle* vehicle, RecvContainer recvFrame, UserData userData){
uint16_t mobile_data_id;
mobile_data_id = *(reinterpret_cast<uint16_t*>(&recvFrame.recvData.raw_ack_array));
}

But I have no idea how to treat recvFrame.

Thanks for your support.
2017-9-6 20:36
Andres4
Valkaryn Posted at 2017-6-6 17:55
Thanks. I found out the way to receive data from mobile device correctly.

Hi can you show me how to code android sdk to send the data correctly to onboard thank you!
2017-10-24 01:18
You need to log in before you can reply Login | Register now

Quick Reply Back to top Back to list
Quick Reply Back to top Back to list