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?
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.
来源:https://stackoverflow.com/questions/51657382/how-to-use-getdatafrommsdk