IoTivity-Lite
oc_storage.h File Reference
#include "oc_export.h"
#include "util/oc_compiler.h"
#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
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 (cannot be NULL)
bufthe buffer to store the contents (cannot be NULL)
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, cannot be NULL)
bufthe buffer to write (cannot be NULL)
sizethe size of the buffer to write
Returns
long >= 0 amount of bytes written on success
long < 0 on failure