Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
app_storage.h File Reference
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for app_storage.h:

Go to the source code of this file.

Classes

struct  app_storage_header_s
 Structure defining the header of application storage header. More...
 

Macros

#define APP_STORAGE_PROP_SETTINGS   (1 << 0)
 < bit to indicate in properties that the application storage contains settings
 
#define APP_STORAGE_PROP_DATA   (1 << 1)
 Tag length.
 
#define APP_STORAGE_TAG_LEN   4
 Tag value.
 
#define APP_STORAGE_TAG   "NVRA"
 Header structure version.
 
#define APP_STORAGE_HEADER_STRUCT_VERSION   1
 Error codes.
 
#define APP_STORAGE_SUCCESS   0
 No error.
 
#define APP_STORAGE_ERR_INVALID_ARGUMENT   -1
 Invalid argument.
 
#define APP_STORAGE_ERR_NO_DATA_AVAILABLE   -2
 Address not available for reading.
 
#define APP_STORAGE_ERR_OVERFLOW   -3
 Value too large to be stored.
 
#define APP_STORAGE_ERR_INVALID_HEADER   -4
 Invalid storage header.
 
#define APP_STORAGE_ERR_CORRUPTED   -5
 App storage is corrupted.
 
#define APP_STORAGE_INITIAL_APP_DATA_VERSION   1
 Initial app data storage version.
 

Typedefs

typedef struct app_storage_header_s app_storage_header_t
 Structure defining the header of application storage header.
 

Functions

uint32_t app_storage_get_size (void)
 
uint16_t app_storage_get_properties (void)
 
uint32_t app_storage_get_data_version (void)
 
int32_t app_storage_read (void *buf, uint32_t nbyte, uint32_t offset)
 
int32_t app_storage_write (const void *buf, uint32_t nbyte, uint32_t offset)
 
void app_storage_set_data_version (uint32_t data_version)
 
void app_storage_increment_data_version (void)
 
void app_storage_reset (void)
 

Macro Definition Documentation

◆ APP_STORAGE_ERR_CORRUPTED

#define APP_STORAGE_ERR_CORRUPTED   -5

App storage is corrupted.

Definition at line 42 of file app_storage.h.

◆ APP_STORAGE_ERR_INVALID_ARGUMENT

#define APP_STORAGE_ERR_INVALID_ARGUMENT   -1

Invalid argument.

Definition at line 38 of file app_storage.h.

◆ APP_STORAGE_ERR_INVALID_HEADER

#define APP_STORAGE_ERR_INVALID_HEADER   -4

Invalid storage header.

Definition at line 41 of file app_storage.h.

◆ APP_STORAGE_ERR_NO_DATA_AVAILABLE

#define APP_STORAGE_ERR_NO_DATA_AVAILABLE   -2

Address not available for reading.

Definition at line 39 of file app_storage.h.

◆ APP_STORAGE_ERR_OVERFLOW

#define APP_STORAGE_ERR_OVERFLOW   -3

Value too large to be stored.

Definition at line 40 of file app_storage.h.

◆ APP_STORAGE_HEADER_STRUCT_VERSION

#define APP_STORAGE_HEADER_STRUCT_VERSION   1

Error codes.

Definition at line 36 of file app_storage.h.

◆ APP_STORAGE_INITIAL_APP_DATA_VERSION

#define APP_STORAGE_INITIAL_APP_DATA_VERSION   1

Initial app data storage version.

Definition at line 45 of file app_storage.h.

◆ APP_STORAGE_PROP_DATA

#define APP_STORAGE_PROP_DATA   (1 << 1)

Tag length.

Definition at line 27 of file app_storage.h.

◆ APP_STORAGE_PROP_SETTINGS

#define APP_STORAGE_PROP_SETTINGS   (1 << 0)

< bit to indicate in properties that the application storage contains settings

bit to indicate in properties that the application contains data

Definition at line 24 of file app_storage.h.

◆ APP_STORAGE_SUCCESS

#define APP_STORAGE_SUCCESS   0

No error.

Definition at line 37 of file app_storage.h.

◆ APP_STORAGE_TAG

#define APP_STORAGE_TAG   "NVRA"

Header structure version.

Definition at line 33 of file app_storage.h.

◆ APP_STORAGE_TAG_LEN

#define APP_STORAGE_TAG_LEN   4

Tag value.

Definition at line 30 of file app_storage.h.

Typedef Documentation

◆ app_storage_header_t

Structure defining the header of application storage header.

Function Documentation

◆ app_storage_get_data_version()

uint32_t app_storage_get_data_version ( void  )

◆ app_storage_get_properties()

uint16_t app_storage_get_properties ( void  )

◆ app_storage_get_size()

uint32_t app_storage_get_size ( void  )

◆ app_storage_increment_data_version()

void app_storage_increment_data_version ( void  )

◆ app_storage_read()

int32_t app_storage_read ( void *  buf,
uint32_t  nbyte,
uint32_t  offset 
)

◆ app_storage_reset()

void app_storage_reset ( void  )

◆ app_storage_set_data_version()

void app_storage_set_data_version ( uint32_t  data_version)

◆ app_storage_write()

int32_t app_storage_write ( const void *  buf,
uint32_t  nbyte,
uint32_t  offset 
)