le_avdata_interface.h
Go to the documentation of this file.
21 * Data is setup as @b assets — a collection of fields that can be managed by the AirVantage50 * Multiple instances of the same asset can be created, as well as multiple instances of different53 * Asset definitions are specified in the @ref defFilesCdef_assets section of the app's @c cdef file.77 * open an avms session and close an avms session respectively. If the session was initiated by an79 * le_avdata_AddSessionStateHandler() and le_avdata_RemoveSessionStateHandler() can be used to add101 * le_avdata_StartTimeSeries() starts time series data on a resource, and le_avdata_StopTimeSeries()102 * stops collecting time series data on a resource. User apps can open an @c avms session, and push the108 * used. For float fields, if a factor other than 1 is used, the data will be encoded as integer to save109 * bytes transported over the air. For example, if the resolution of float data is 0.01, a factor of120 * @note Observe has to be enabled on the resource before time series can be pushed out. User apps can151 //--------------------------------------------------------------------------------------------------154 * Connect the current client thread to the service providing this API. Block until the service is157 * For each thread that wants to use this API, either ConnectService or TryConnectService must be158 * called before any other functions in this API. Normally, ConnectService is automatically called163 //--------------------------------------------------------------------------------------------------169 //--------------------------------------------------------------------------------------------------172 * Try to connect the current client thread to the service providing this API. Return with an error175 * For each thread that wants to use this API, either ConnectService or TryConnectService must be176 * called before any other functions in this API. Normally, ConnectService is automatically called183 * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.184 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).187 //--------------------------------------------------------------------------------------------------193 //--------------------------------------------------------------------------------------------------199 * longer a connection to the service, and the functions in this API can't be used. For details, see204 //--------------------------------------------------------------------------------------------------211 //--------------------------------------------------------------------------------------------------215 //--------------------------------------------------------------------------------------------------219 //--------------------------------------------------------------------------------------------------223 //--------------------------------------------------------------------------------------------------227 //--------------------------------------------------------------------------------------------------231 //--------------------------------------------------------------------------------------------------235 //--------------------------------------------------------------------------------------------------239 //--------------------------------------------------------------------------------------------------243 //--------------------------------------------------------------------------------------------------247 //--------------------------------------------------------------------------------------------------251 //--------------------------------------------------------------------------------------------------255 //--------------------------------------------------------------------------------------------------259 //--------------------------------------------------------------------------------------------------263 //--------------------------------------------------------------------------------------------------275 //--------------------------------------------------------------------------------------------------279 //--------------------------------------------------------------------------------------------------283 //--------------------------------------------------------------------------------------------------287 //--------------------------------------------------------------------------------------------------291 //--------------------------------------------------------------------------------------------------299 //--------------------------------------------------------------------------------------------------301 (308 //--------------------------------------------------------------------------------------------------316 //--------------------------------------------------------------------------------------------------318 (323 //--------------------------------------------------------------------------------------------------329 //--------------------------------------------------------------------------------------------------345 //--------------------------------------------------------------------------------------------------349 //--------------------------------------------------------------------------------------------------356 //--------------------------------------------------------------------------------------------------364 //--------------------------------------------------------------------------------------------------371 //--------------------------------------------------------------------------------------------------377 //--------------------------------------------------------------------------------------------------384 //--------------------------------------------------------------------------------------------------390 //--------------------------------------------------------------------------------------------------403 //--------------------------------------------------------------------------------------------------417 //--------------------------------------------------------------------------------------------------430 //--------------------------------------------------------------------------------------------------436 //--------------------------------------------------------------------------------------------------449 //--------------------------------------------------------------------------------------------------463 //--------------------------------------------------------------------------------------------------476 //--------------------------------------------------------------------------------------------------482 //--------------------------------------------------------------------------------------------------495 //--------------------------------------------------------------------------------------------------509 //--------------------------------------------------------------------------------------------------522 //--------------------------------------------------------------------------------------------------528 //--------------------------------------------------------------------------------------------------544 //--------------------------------------------------------------------------------------------------558 //--------------------------------------------------------------------------------------------------571 //--------------------------------------------------------------------------------------------------577 //--------------------------------------------------------------------------------------------------593 //--------------------------------------------------------------------------------------------------599 //--------------------------------------------------------------------------------------------------615 //--------------------------------------------------------------------------------------------------625 * @note Factor is applicable only for integer and float fields. For all other fields factor will be634 //--------------------------------------------------------------------------------------------------650 //--------------------------------------------------------------------------------------------------660 //--------------------------------------------------------------------------------------------------670 //--------------------------------------------------------------------------------------------------672 * Compress the accumulated CBOR encoded time series data and send it to server. After the data is683 //--------------------------------------------------------------------------------------------------696 //--------------------------------------------------------------------------------------------------702 //--------------------------------------------------------------------------------------------------712 //--------------------------------------------------------------------------------------------------716 //--------------------------------------------------------------------------------------------------723 //--------------------------------------------------------------------------------------------------731 //--------------------------------------------------------------------------------------------------747 //--------------------------------------------------------------------------------------------------765 //--------------------------------------------------------------------------------------------------781 //--------------------------------------------------------------------------------------------------787 * @note This function is the same as the SetFloat() except that it provides an option to pass the799 //--------------------------------------------------------------------------------------------------815 //--------------------------------------------------------------------------------------------------821 * @note This function is the same as the SetBool() except that it provides an option to pass the833 //--------------------------------------------------------------------------------------------------849 //--------------------------------------------------------------------------------------------------855 * @note This function is the same as the SetString() except that it provides an option to pass the867 //--------------------------------------------------------------------------------------------------883 //--------------------------------------------------------------------------------------------------893 //--------------------------------------------------------------------------------------------------906 //--------------------------------------------------------------------------------------------------914 //--------------------------------------------------------------------------------------------------920 //--------------------------------------------------------------------------------------------------925 //--------------------------------------------------------------------------------------------------void le_avdata_Delete(le_avdata_AssetInstanceRef_t instRef)void(* le_avdata_SessionStateHandlerFunc_t)(le_avdata_SessionState_t sessionState, void *contextPtr)Definition: le_avdata_interface.h:318le_result_t le_avdata_SetFloat(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, double value)void le_avdata_RemoveFieldEventHandler(le_avdata_FieldEventHandlerRef_t addHandlerRef)void le_avdata_GetString(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, char *value, size_t valueNumElements)le_result_t le_avdata_RecordInt(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, int32_t value, uint64_t timestamp)void le_avdata_SetBinary(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, const uint8_t *valuePtr, size_t valueNumElements)le_result_t le_avdata_StartTimeSeries(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, double factor, double timeStampFactor)void(* le_avdata_FieldHandlerFunc_t)(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, void *contextPtr)Definition: le_avdata_interface.h:301le_avdata_SessionStateHandlerRef_t le_avdata_AddSessionStateHandler(le_avdata_SessionStateHandlerFunc_t handlerPtr, void *contextPtr)void le_avdata_ReleaseSession(le_avdata_RequestSessionObjRef_t requestRef)struct le_avdata_RequestSessionObj * le_avdata_RequestSessionObjRef_tDefinition: le_avdata_interface.h:224le_result_t le_avdata_RecordBool(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, bool value, uint64_t timeStamp)le_result_t le_avdata_SetBool(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, bool value)void le_avdata_DisconnectService(void)le_result_t le_avdata_RecordString(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, const char *value, uint64_t timeStamp)le_avdata_RequestSessionObjRef_t le_avdata_RequestSession(void)le_result_t le_avdata_SetInt(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, int32_t value)struct le_avdata_AssetInstance * le_avdata_AssetInstanceRef_tDefinition: le_avdata_interface.h:216void le_avdata_RemoveSessionStateHandler(le_avdata_SessionStateHandlerRef_t addHandlerRef)void le_avdata_ConnectService(void)le_result_t le_avdata_GetTimeSeriesStatus(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, bool *isTimeSeriesPtr, int32_t *numDataPointPtr)void le_avdata_GetFloat(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, double *valuePtr)le_result_t le_avdata_TryConnectService(void)struct le_avdata_SessionStateHandler * le_avdata_SessionStateHandlerRef_tDefinition: le_avdata_interface.h:288le_result_t le_avdata_PushTimeSeries(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, bool isRestartTimeSeries)void le_avdata_GetBinary(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, uint8_t *valuePtr, size_t *valueNumElementsPtr)struct le_avdata_FieldEventHandler * le_avdata_FieldEventHandlerRef_tDefinition: le_avdata_interface.h:280void le_avdata_GetInt(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, int32_t *valuePtr)le_result_t le_avdata_IsObserve(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, bool *isObservePtr)le_avdata_AssetInstanceRef_t le_avdata_Create(const char *assetName)le_avdata_FieldEventHandlerRef_t le_avdata_AddFieldEventHandler(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, le_avdata_FieldHandlerFunc_t handlerPtr, void *contextPtr)le_result_t le_avdata_RecordFloat(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, double value, uint64_t timestamp)le_result_t le_avdata_StopTimeSeries(le_avdata_AssetInstanceRef_t instRef, const char *fieldName)le_result_t le_avdata_SetString(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, const char *value)void le_avdata_GetBool(le_avdata_AssetInstanceRef_t instRef, const char *fieldName, bool *valuePtr)