platform abstraction for storage (e.g.
More...
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
platform abstraction for storage (e.g.
file writing)
Definition in file oc_storage.h.
◆ oc_storage_config()
int oc_storage_config |
( |
const char * |
store | ) |
|
open the storage NOTE: For embedded devices, this function doesn't do anything.
However, it needs to be called for hosted/virtual devices.
- Parameters
-
- Returns
- int
◆ oc_storage_erase()
int oc_storage_erase |
( |
const char * |
store | ) |
|
erase a stored file
- Parameters
-
store | the store (file path) |
- Returns
- int 0 on success
◆ oc_storage_read()
long oc_storage_read |
( |
const char * |
store, |
|
|
uint8_t * |
buf, |
|
|
size_t |
size |
|
) |
| |
read from the storage
- Parameters
-
store | the path to be read |
buf | the buffer to store the contents |
size | amount of bytes to read |
- Returns
- long amount of bytes read
◆ oc_storage_write()
long oc_storage_write |
( |
const char * |
store, |
|
|
uint8_t * |
buf, |
|
|
size_t |
size |
|
) |
| |
write to storage
- Parameters
-
store | the store (file path) |
buf | the buffer to write |
size | the size of the buffer to write |
- Returns
- long amount of bytes written