le_avdata_interface.h
Go to the documentation of this file.
36 * Data is setup as @b Assets — a collection of fields that can be managed by the AirVantage44 * - @b setting allowing the AirVantage server to read/write the value, and can be read by an App.48 * slash ("/"), a parent path @b cannot contain a field, and a parent path cannot contain a parent66 * @note If a user enters a value 0 for float data type, an error will be returned (LE_NOT_FOUND),67 * as the system infers 0 as an integer value and the data type doesn't match. 0.0 needs to be set77 * Registered handlers are called only when activities from AV server occurs. Client activities do80 * A handler registered with a command field is invoked with an optional argument list sent from the85 * A handler registered with a command field must call the le_avdata_ReplyExecResult() at the end of146 * This feature enables user Apps to collect and keep in memory data when the device is off-line and161 * This code sample shows how to collect data and send to the server (assuming session is opened)186 * utcMilliSec = (uint64_t)(tv.tv_sec) * 1000 + (uint64_t)(tv.tv_usec) / 1000; // get current time204 * le_avdata_AddSessionStateHandler() and le_avdata_RemoveSessionStateHandler() can be used to add229 //--------------------------------------------------------------------------------------------------233 //--------------------------------------------------------------------------------------------------236 //--------------------------------------------------------------------------------------------------239 * Connect the current client thread to the service providing this API. Block until the service is242 * For each thread that wants to use this API, either ConnectService or TryConnectService must be243 * called before any other functions in this API. Normally, ConnectService is automatically called248 //--------------------------------------------------------------------------------------------------254 //--------------------------------------------------------------------------------------------------257 * Try to connect the current client thread to the service providing this API. Return with an error260 * For each thread that wants to use this API, either ConnectService or TryConnectService must be261 * called before any other functions in this API. Normally, ConnectService is automatically called270 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).273 //--------------------------------------------------------------------------------------------------279 //--------------------------------------------------------------------------------------------------283 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants286 //--------------------------------------------------------------------------------------------------293 //--------------------------------------------------------------------------------------------------299 * longer a connection to the service, and the functions in this API can't be used. For details, see304 //--------------------------------------------------------------------------------------------------311 //--------------------------------------------------------------------------------------------------315 //--------------------------------------------------------------------------------------------------318 //--------------------------------------------------------------------------------------------------321 //--------------------------------------------------------------------------------------------------324 //--------------------------------------------------------------------------------------------------328 //--------------------------------------------------------------------------------------------------331 //--------------------------------------------------------------------------------------------------334 //--------------------------------------------------------------------------------------------------337 //--------------------------------------------------------------------------------------------------344 //--------------------------------------------------------------------------------------------------357 //--------------------------------------------------------------------------------------------------361 //--------------------------------------------------------------------------------------------------371 //--------------------------------------------------------------------------------------------------375 //--------------------------------------------------------------------------------------------------392 //--------------------------------------------------------------------------------------------------397 //--------------------------------------------------------------------------------------------------408 //--------------------------------------------------------------------------------------------------412 //--------------------------------------------------------------------------------------------------416 //--------------------------------------------------------------------------------------------------420 //--------------------------------------------------------------------------------------------------424 //--------------------------------------------------------------------------------------------------428 //--------------------------------------------------------------------------------------------------432 //--------------------------------------------------------------------------------------------------436 //--------------------------------------------------------------------------------------------------440 //--------------------------------------------------------------------------------------------------444 //--------------------------------------------------------------------------------------------------455 //--------------------------------------------------------------------------------------------------459 //--------------------------------------------------------------------------------------------------463 //--------------------------------------------------------------------------------------------------467 //--------------------------------------------------------------------------------------------------469 (480 //--------------------------------------------------------------------------------------------------484 //--------------------------------------------------------------------------------------------------486 (493 //--------------------------------------------------------------------------------------------------497 //--------------------------------------------------------------------------------------------------499 (506 //--------------------------------------------------------------------------------------------------514 * For "commands", the handler function must call the "ReplyExecResult" function to send the command518 //--------------------------------------------------------------------------------------------------529 //--------------------------------------------------------------------------------------------------533 //--------------------------------------------------------------------------------------------------540 //--------------------------------------------------------------------------------------------------542 * Create an asset data with the provided path. Note that asset data type and value are determined543 * upon the first call to a Set function. When an asset data is created, it contains a null value,552 //--------------------------------------------------------------------------------------------------561 //--------------------------------------------------------------------------------------------------570 //--------------------------------------------------------------------------------------------------577 //--------------------------------------------------------------------------------------------------588 //--------------------------------------------------------------------------------------------------597 //--------------------------------------------------------------------------------------------------606 //--------------------------------------------------------------------------------------------------615 //--------------------------------------------------------------------------------------------------626 //--------------------------------------------------------------------------------------------------635 //--------------------------------------------------------------------------------------------------644 //--------------------------------------------------------------------------------------------------653 //--------------------------------------------------------------------------------------------------664 //--------------------------------------------------------------------------------------------------673 //--------------------------------------------------------------------------------------------------682 //--------------------------------------------------------------------------------------------------691 //--------------------------------------------------------------------------------------------------702 //--------------------------------------------------------------------------------------------------713 //--------------------------------------------------------------------------------------------------722 //--------------------------------------------------------------------------------------------------731 //--------------------------------------------------------------------------------------------------739 //--------------------------------------------------------------------------------------------------750 //--------------------------------------------------------------------------------------------------758 //--------------------------------------------------------------------------------------------------769 //--------------------------------------------------------------------------------------------------777 //--------------------------------------------------------------------------------------------------788 //--------------------------------------------------------------------------------------------------796 //--------------------------------------------------------------------------------------------------809 //--------------------------------------------------------------------------------------------------811 * Get the length (excluding terminating null byte) of the string argument of the specified name.817 //--------------------------------------------------------------------------------------------------828 //--------------------------------------------------------------------------------------------------830 * Reply command execution result to AVC Daemon, which can then respond to AV server. This function831 * MUST be called at the end of a command execution, in order for AV server to be notified about the834 //--------------------------------------------------------------------------------------------------843 //--------------------------------------------------------------------------------------------------854 //--------------------------------------------------------------------------------------------------865 //--------------------------------------------------------------------------------------------------874 //--------------------------------------------------------------------------------------------------887 //--------------------------------------------------------------------------------------------------893 //--------------------------------------------------------------------------------------------------899 //--------------------------------------------------------------------------------------------------903 //--------------------------------------------------------------------------------------------------910 //--------------------------------------------------------------------------------------------------914 * @note The client will be terminated if the recordRef is not valid, or the resource doesn't exist921 //--------------------------------------------------------------------------------------------------934 //--------------------------------------------------------------------------------------------------938 * @note The client will be terminated if the recordRef is not valid, or the resource doesn't exist945 //--------------------------------------------------------------------------------------------------958 //--------------------------------------------------------------------------------------------------962 * @note The client will be terminated if the recordRef is not valid, or the resource doesn't exist969 //--------------------------------------------------------------------------------------------------982 //--------------------------------------------------------------------------------------------------986 * @note The client will be terminated if the recordRef is not valid, or the resource doesn't exist993 //--------------------------------------------------------------------------------------------------1006 //--------------------------------------------------------------------------------------------------1019 //--------------------------------------------------------------------------------------------------1030 //--------------------------------------------------------------------------------------------------1036 //--------------------------------------------------------------------------------------------------1045 //--------------------------------------------------------------------------------------------------1049 //--------------------------------------------------------------------------------------------------1056 //--------------------------------------------------------------------------------------------------1064 //--------------------------------------------------------------------------------------------------1070 //--------------------------------------------------------------------------------------------------1075 //--------------------------------------------------------------------------------------------------le_result_t le_avdata_PushStream(const char *LE_NONNULL path, int fd, le_avdata_CallbackResultFunc_t handlerPtr, void *contextPtr)le_result_t le_avdata_GetInt(const char *LE_NONNULL path, int32_t *valuePtr)le_result_t le_avdata_GetFloat(const char *LE_NONNULL path, double *valuePtr)le_result_t le_avdata_CreateResource(const char *LE_NONNULL path, le_avdata_AccessMode_t accessMode)le_result_t le_avdata_RecordFloat(le_avdata_RecordRef_t recordRef, const char *LE_NONNULL path, double value, uint64_t timestamp)le_result_t le_avdata_SetNull(const char *LE_NONNULL path)le_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:437void le_avdata_RemoveResourceEventHandler(le_avdata_ResourceEventHandlerRef_t handlerRef)le_result_t le_avdata_RecordString(le_avdata_RecordRef_t recordRef, const char *LE_NONNULL path, const char *LE_NONNULL value, uint64_t timestamp)void le_avdata_DisconnectService(void)le_result_t le_avdata_GetBool(const char *LE_NONNULL path, bool *valuePtr)le_result_t le_avdata_PushRecord(le_avdata_RecordRef_t recordRef, le_avdata_CallbackResultFunc_t handlerPtr, void *contextPtr)void le_avdata_ReplyExecResult(le_avdata_ArgumentListRef_t argumentListRef, le_result_t result)le_result_t le_avdata_Push(const char *LE_NONNULL path, le_avdata_CallbackResultFunc_t handlerPtr, void *contextPtr)le_result_t le_avdata_GetStringArgLength(le_avdata_ArgumentListRef_t argumentListRef, const char *LE_NONNULL argName, int32_t *strArgLenPtr)le_avdata_RequestSessionObjRef_t le_avdata_RequestSession(void)void(* le_avdata_DisconnectHandler_t)(void *)Definition: le_avdata_interface.h:234le_result_t le_avdata_SetString(const char *LE_NONNULL path, const char *LE_NONNULL value)le_result_t le_avdata_GetBoolArg(le_avdata_ArgumentListRef_t argumentListRef, const char *LE_NONNULL argName, bool *boolArgPtr)le_result_t le_avdata_RecordInt(le_avdata_RecordRef_t recordRef, const char *LE_NONNULL path, int32_t value, uint64_t timestamp)le_result_t le_avdata_RecordBool(le_avdata_RecordRef_t recordRef, const char *LE_NONNULL path, bool value, uint64_t timestamp)void le_avdata_ConnectService(void)le_result_t le_avdata_GetString(const char *LE_NONNULL path, char *value, size_t valueSize)le_result_t le_avdata_GetStringArg(le_avdata_ArgumentListRef_t argumentListRef, const char *LE_NONNULL argName, char *strArg, size_t strArgSize)struct le_avdata_ResourceEventHandler * le_avdata_ResourceEventHandlerRef_tDefinition: le_avdata_interface.h:421le_result_t le_avdata_TryConnectService(void)void le_avdata_SetServerDisconnectHandler(le_avdata_DisconnectHandler_t disconnectHandler, void *contextPtr)le_result_t le_avdata_SetFloat(const char *LE_NONNULL path, double value)le_result_t le_avdata_GetFloatArg(le_avdata_ArgumentListRef_t argumentListRef, const char *LE_NONNULL argName, double *floatArgPtr)struct le_avdata_SessionStateHandler * le_avdata_SessionStateHandlerRef_tDefinition: le_avdata_interface.h:460void(* le_avdata_SessionStateHandlerFunc_t)(le_avdata_SessionState_t sessionState, void *contextPtr)Definition: le_avdata_interface.h:499struct le_avdata_ArgumentList * le_avdata_ArgumentListRef_tDefinition: le_avdata_interface.h:413struct le_avdata_Record * le_avdata_RecordRef_tDefinition: le_avdata_interface.h:429le_avdata_ResourceEventHandlerRef_t le_avdata_AddResourceEventHandler(const char *LE_NONNULL path, le_avdata_ResourceHandlerFunc_t handlerPtr, void *contextPtr)void(* le_avdata_CallbackResultFunc_t)(le_avdata_PushStatus_t status, void *contextPtr)Definition: le_avdata_interface.h:486le_result_t le_avdata_GetIntArg(le_avdata_ArgumentListRef_t argumentListRef, const char *LE_NONNULL argName, int32_t *intArgPtr)le_result_t le_avdata_SetInt(const char *LE_NONNULL path, int32_t value)le_avdata_RecordRef_t le_avdata_CreateRecord(void)void le_avdata_DeleteRecord(le_avdata_RecordRef_t recordRef)le_result_t le_avdata_SetBool(const char *LE_NONNULL path, bool value)void(* le_avdata_ResourceHandlerFunc_t)(const char *LE_NONNULL path, le_avdata_AccessType_t accessType, le_avdata_ArgumentListRef_t argumentListRef, void *contextPtr)Definition: le_avdata_interface.h:469void le_avdata_RemoveSessionStateHandler(le_avdata_SessionStateHandlerRef_t handlerRef)