IoTivity-Lite
oc_storage.h File Reference
#include <stddef.h>
#include <stdint.h>

Functions

int oc_storage_config (const char *store)
 open the storage More...
 
long oc_storage_read (const char *store, uint8_t *buf, size_t size)
 read from the storage More...
 
long oc_storage_write (const char *store, const uint8_t *buf, size_t size)
 write to storage More...
 

Function Documentation

◆ oc_storage_config()

int oc_storage_config ( const char *  store)

open the storage

Parameters
storethe storage path (cannot be NULL)
Returns
0 on success
<0 on failure

◆ oc_storage_read()

long oc_storage_read ( const char *  store,
uint8_t *  buf,
size_t  size 
)

read from the storage

Parameters
storethe path to be read
bufthe buffer to store the contents
sizeamount of bytes to read
Returns
long amount of bytes read

◆ oc_storage_write()

long oc_storage_write ( const char *  store,
const uint8_t *  buf,
size_t  size 
)

write to storage

Parameters
storethe store (file path)
bufthe buffer to write
sizethe size of the buffer to write
Returns
long >= 0 amount of bytes written on success
long < 0 on failure