Zigbee Protocol Controller 1.6.0
|
Persistent Datastore fixture. More...
Macros | |
#define | UIC_VERSION_MAX_LEN 100 |
: MAX Length of typical version string: for e.g. ver_0.0.6_RC1-269-gb5a9d4be More... | |
Functions | |
sl_status_t | datastore_fixt_setup (const char *datastore_file) |
Fixture for setting up the datastore component. More... | |
int | datastore_fixt_teardown () |
Fixture to tear down the datastore. More... | |
sl_status_t | datastore_fixt_setup_and_handle_version (const char *datastore_file, int64_t db_version) |
Function for setting up the datastore component handling the datastore version. More... | |
Persistent Datastore fixture.
Fixture to initialize the datastore from uic_main, in order to enable the Datastore in a Unify application, add datastore_fixt_setup to the fixt_setup array, when calling Main Function for Contiki
#define UIC_VERSION_MAX_LEN 100 |
: MAX Length of typical version string: for e.g. ver_0.0.6_RC1-269-gb5a9d4be
sl_status_t datastore_fixt_setup | ( | const char * | datastore_file | ) |
Fixture for setting up the datastore component.
This function gets the config string for datastore file and opens the datastore (Sqlite database) then calls datastore_table_init And calls datastore_attribure_init
datastore_file | path for the datastore file. |
sl_status_t datastore_fixt_setup_and_handle_version | ( | const char * | datastore_file, |
int64_t | db_version | ||
) |
Function for setting up the datastore component handling the datastore version.
This function calls reads the datastore config option and calls datastore_open which opens the database and calls datastore_table_init initializes generic tables and then this function checks if the database version is same as current version. (Generic tables have the database version stored)
If the versioning is good then writes the current Unify version in generic table and calls datastore_attribure_init to initialize attribute store table If there is no database version found, it writes the current database version and writes the current Unify version in generic table and calls datastore_attribure_init to initialize attribute store
datastore_file | path for the datastore file. |
db_version | Expected version number for the database file |
int datastore_fixt_teardown | ( | ) |
Fixture to tear down the datastore.
This is basically a wrapper that calls datastore_teardown, see datastore_teardown for more details