Snapdragon® Telematics Application Framework (TelAF) Interface Specification
le_cfgAdmin_common.h File Reference
#include "legato.h"
#include "le_cfg_common.h"

Go to the source code of this file.

Macros

#define IFGEN_LE_CFGADMIN_PROTOCOL_ID   "a027aae806d6622f4ea64008f3a707ba"
 
#define IFGEN_LE_CFGADMIN_MSG_SIZE   1044
 

Typedefs

typedef struct le_cfgAdmin_Iterator * le_cfgAdmin_IteratorRef_t
 

Functions

LE_SHARED bool ifgen_le_cfgAdmin_HasLocalBinding (void)
 
LE_SHARED void ifgen_le_cfgAdmin_InitCommonData (void)
 
LE_SHARED void ifgen_le_cfgAdmin_CleanupCommonData (le_msg_SessionRef_t _ifgen_sessionRef)
 
LE_SHARED le_result_t ifgen_le_cfgAdmin_OpenSession (le_msg_SessionRef_t _ifgen_sessionRef, bool isBlocking)
 
LE_SHARED le_result_t ifgen_le_cfgAdmin_ImportTree (le_msg_SessionRef_t _ifgen_sessionRef, le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL filePath, const char *LE_NONNULL nodePath)
 
LE_SHARED le_result_t ifgen_le_cfgAdmin_ExportTree (le_msg_SessionRef_t _ifgen_sessionRef, le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL filePath, const char *LE_NONNULL nodePath)
 
LE_SHARED void ifgen_le_cfgAdmin_DeleteTree (le_msg_SessionRef_t _ifgen_sessionRef, const char *LE_NONNULL treeName)
 
LE_SHARED le_cfgAdmin_IteratorRef_t ifgen_le_cfgAdmin_CreateTreeIterator (le_msg_SessionRef_t _ifgen_sessionRef)
 
LE_SHARED void ifgen_le_cfgAdmin_ReleaseTreeIterator (le_msg_SessionRef_t _ifgen_sessionRef, le_cfgAdmin_IteratorRef_t iteratorRef)
 
LE_SHARED le_result_t ifgen_le_cfgAdmin_GetTreeName (le_msg_SessionRef_t _ifgen_sessionRef, le_cfgAdmin_IteratorRef_t iteratorRef, char *name, size_t nameSize)
 
LE_SHARED le_result_t ifgen_le_cfgAdmin_NextTree (le_msg_SessionRef_t _ifgen_sessionRef, le_cfgAdmin_IteratorRef_t iteratorRef)
 

Macro Definition Documentation

◆ IFGEN_LE_CFGADMIN_PROTOCOL_ID

#define IFGEN_LE_CFGADMIN_PROTOCOL_ID   "a027aae806d6622f4ea64008f3a707ba"

◆ IFGEN_LE_CFGADMIN_MSG_SIZE

#define IFGEN_LE_CFGADMIN_MSG_SIZE   1044

Typedef Documentation

◆ le_cfgAdmin_IteratorRef_t

typedef struct le_cfgAdmin_Iterator* le_cfgAdmin_IteratorRef_t

Reference to an iterator object that can be used to iterate over the list of trees.

Function Documentation

◆ ifgen_le_cfgAdmin_HasLocalBinding()

LE_SHARED bool ifgen_le_cfgAdmin_HasLocalBinding ( void  )

Get if this client bound locally.

◆ ifgen_le_cfgAdmin_InitCommonData()

LE_SHARED void ifgen_le_cfgAdmin_InitCommonData ( void  )

Init data that is common across all threads

◆ ifgen_le_cfgAdmin_CleanupCommonData()

LE_SHARED void ifgen_le_cfgAdmin_CleanupCommonData ( le_msg_SessionRef_t  _ifgen_sessionRef)

Cleanup the data of a session

◆ ifgen_le_cfgAdmin_OpenSession()

LE_SHARED le_result_t ifgen_le_cfgAdmin_OpenSession ( le_msg_SessionRef_t  _ifgen_sessionRef,
bool  isBlocking 
)

Perform common initialization and open a session

◆ ifgen_le_cfgAdmin_ImportTree()

LE_SHARED le_result_t ifgen_le_cfgAdmin_ImportTree ( le_msg_SessionRef_t  _ifgen_sessionRef,
le_cfg_IteratorRef_t  iteratorRef,
const char *LE_NONNULL  filePath,
const char *LE_NONNULL  nodePath 
)

Read a subset of the configuration tree from the given filePath. The tree then overwrites the node at the given nodePath.

This function will import a sub-tree as part of the iterator's current transaction. This allows you to create an iterator on a given node. Import a sub-tree, and then examine the contents of the import before deciding to commit the new data.

Returns
This function will return one of the following values:
    - LE_OK            - The commit was completed successfuly.
    - LE_FAULT         - An I/O error occured while reading the data.
    - LE_FORMAT_ERROR  - The configuration data being imported appears corrupted.
Parameters
[in]iteratorRefWrite iterator that is being used for the import.
[in]filePathImport the tree data from the this file.
[in]nodePathWhere in the tree should this import happen? Leave as an empty string to use the iterator's current node.

◆ ifgen_le_cfgAdmin_ExportTree()

LE_SHARED le_result_t ifgen_le_cfgAdmin_ExportTree ( le_msg_SessionRef_t  _ifgen_sessionRef,
le_cfg_IteratorRef_t  iteratorRef,
const char *LE_NONNULL  filePath,
const char *LE_NONNULL  nodePath 
)

Take a node given from nodePath and stream it and it's children to the file given by filePath.

This funciton uses the iterator's read transaction, and takes a snapshot of the current state of the tree. The data write happens immediately.

Returns
This function will return one of the following values:
    - LE_OK     - The commit was completed successfuly.
    - LE_FAULT  - An I/O error occured while writing the data.
Parameters
[in]iteratorRefWrite iterator that is being used for the export.
[in]filePathImport the tree data from the this file.
[in]nodePathWhere in the tree should this export happen? Leave as an empty string to use the iterator's current node.

◆ ifgen_le_cfgAdmin_DeleteTree()

LE_SHARED void ifgen_le_cfgAdmin_DeleteTree ( le_msg_SessionRef_t  _ifgen_sessionRef,
const char *LE_NONNULL  treeName 
)

Delete a tree from the system, both from the filesystem and from memory.

Parameters
[in]treeNameName of the tree to delete.

◆ ifgen_le_cfgAdmin_CreateTreeIterator()

LE_SHARED le_cfgAdmin_IteratorRef_t ifgen_le_cfgAdmin_CreateTreeIterator ( le_msg_SessionRef_t  _ifgen_sessionRef)

Create a new iterator object for iterating over the list of trees currently managed by the config tree daemon.

◆ ifgen_le_cfgAdmin_ReleaseTreeIterator()

LE_SHARED void ifgen_le_cfgAdmin_ReleaseTreeIterator ( le_msg_SessionRef_t  _ifgen_sessionRef,
le_cfgAdmin_IteratorRef_t  iteratorRef 
)

Release the iterator and free it's memory back to the system.

Parameters
[in]iteratorRefIterator object to release.

◆ ifgen_le_cfgAdmin_GetTreeName()

LE_SHARED le_result_t ifgen_le_cfgAdmin_GetTreeName ( le_msg_SessionRef_t  _ifgen_sessionRef,
le_cfgAdmin_IteratorRef_t  iteratorRef,
char *  name,
size_t  nameSize 
)

Read the name of the tree currently pointed at by the iterator.

Returns
LE_OK if there is enough room to copy the name into the supplied buffer. LE_OVERFLOW if not. LE_NOT_FOUND is returned if the list is empty or if the iterator hasn't been moved onto the first item yet.
Parameters
[in]iteratorRefIterator object to read.
[out]nameName of the currently referenced tree is passed in this out parameter.
[in]nameSize

◆ ifgen_le_cfgAdmin_NextTree()

LE_SHARED le_result_t ifgen_le_cfgAdmin_NextTree ( le_msg_SessionRef_t  _ifgen_sessionRef,
le_cfgAdmin_IteratorRef_t  iteratorRef 
)

Move onto the next tree in the list. If there are no more trees this function returns false, otherwise true is returned.

Returns
LE_OK if there are more trees to iterate through. LE_NOT_FOUND if not.
Parameters
[in]iteratorRefIterator to iterate.