2017-06-17 18:36:10 -05:00
|
|
|
#ifndef _PERSISTENT_STORE_H_
|
|
|
|
#define _PERSISTENT_STORE_H_
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2018-08-13 17:30:26 -05:00
|
|
|
class PersistentStore {
|
|
|
|
public:
|
|
|
|
static bool access_start();
|
|
|
|
static bool access_finish();
|
|
|
|
static bool write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc);
|
|
|
|
static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true);
|
|
|
|
static bool write_data(const int pos, uint8_t* value, size_t size);
|
|
|
|
static bool read_data(const int pos, uint8_t* value, size_t size);
|
|
|
|
static const size_t capacity();
|
|
|
|
};
|
2017-06-17 18:36:10 -05:00
|
|
|
|
2018-08-13 17:30:26 -05:00
|
|
|
extern PersistentStore persistentStore;
|
2017-06-17 18:36:10 -05:00
|
|
|
|
2017-09-06 06:28:32 -05:00
|
|
|
#endif // _PERSISTENT_STORE_H_
|