1

I have an upstream from the mobile device to the OSDK(sending a message). The data is being sent correctly but I am having issues receiving it. When looking at the OSDK API Reference, I expected the functions to use to be under the MobileCommunication class reference. The only thing I found related to upstreaming was the getDataFromMSDK function. I don't get how this function works, and also don't understand how receiving data on the OSDK actually works. I also don't see this function in any mobile communication samples.

How do I setup a constant listener for incoming MSDK data?
How does the getDataFromMSDK function come into play in this process?

1 Answers1

3

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

To do this, first define a callback function that matches the typical VehicleCallback signature (for an example, see the L42 in the Mobile Communication Sample from OSDK 3.6). Next, call the setFromMSDKCallback API passing a pointer to your callback function and any data you might want to have accessible within that callback function (for an example, see L128 in the same sample code).

The final step is to access recvFrame.recvData.raw_ack_array in your callback function; this is the raw byte data you sent from the mobile device.

Rohit Sant
  • 343
  • 1
  • 5
  • Thanks a lot, really helped! Just to confirm, I define the vehicle callback handler struct as a parameter for setFromMSDKCallback, then from this function I pass a pointer (of the handler?) to my getDataFromMSDKCallback function, and in that callback function I am able to use the data by converting raw_ack_array(which is a byte array), to whatever I want. If you couldn't tell, i'm new to this stuff. :) – LarryYourWaiter Aug 03 '18 at 15:35
  • wait what I said is wrong, I think I figured it out, haha. – LarryYourWaiter Aug 03 '18 at 15:55