Documentation says: Add handler function for EVENT ‘le_data_ConnectionState’ - Ok, I guess that means I have to great my own function and pass it to the le_data_AddConnectionStateHandler() as a first parameter([in] handlerPtr). Is it so?
How should that function look like?
What is this [in]contextPtr? Why we need this and what is the proper way to get/great the reference?
Sorry for the slow reply. The le_avdata_AddSessionStateHandler function takes a contextPtr parameter. When the session state changes, the supplied function will be called and the contextPtr will be passed back to that function. When you don’t have a need for the contextPtr, you can just pass NULL instead. I’m having a hard time coming up with an example of when the contextPtr would be useful for the session state handler, but it’s a fairly common idiom that you will encounter in other Legato services.
I’ve been playing with “RedSensorToCloud” code to enable the sending of GPS data to Airvantage (would love to see my mangOH red position on the Airvantage website!).
The code seems to be GPS ready under the flag “GPS_ENABLE”.
The project compiles fine once I enable the flag (“define GPS_ENABLE”) but starting the app returns the following message:
" redSensorToCloud[8524]/avPublisherComponent T=main | avPublisher.c SampleTimerHandler() 386 | Failed to read gps".
This doesn’t seem to be an issue with making a GPS fix but an issue with the Airvantage handler (other data such as temperature etc. is successfully sent to Airvantage).
Have you seen this error message / problem before?
Do you have any code (avPublisher.c etc.) working fine? If so could you send it to me?