How to use getDataFromMSDK()?

允我心安 提交于 2019-12-08 03:45:14

问题


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:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!