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

[Help] Sending Data to Onboard

Author: Valkaryn 2017-5-22 17:42
6 268

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

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
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
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

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

// Initialization

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

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


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
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