SolarEnergy/esp32_device/main/storage.h

73 lines
1.2 KiB
C
Raw Permalink Normal View History

2024-07-27 13:31:17 +00:00
/**
* Storage management
*/
#pragma once
#include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C"
{
#endif
/**
* Initialize storage
*/
bool storage_init();
/**
* Write device name
*/
void storage_set_dev_name(const char *name);
/**
* Get current device name
*/
size_t storage_get_dev_name(char *dest);
2024-08-15 11:09:01 +00:00
/**
* Write private key
*/
void storage_set_priv_key(unsigned char *key, size_t len);
/**
* Get current private key
*/
size_t storage_get_priv_key(unsigned char *key);
2024-08-18 15:40:41 +00:00
/**
* Write secure origin
*/
2024-08-18 17:42:40 +00:00
void storage_set_secure_origin(const char *orig);
2024-08-18 15:40:41 +00:00
/**
* Get current secure origin
*/
size_t storage_get_secure_origin(char *dest);
2024-08-18 17:42:40 +00:00
/**
* Write root CA
*/
void storage_set_root_ca(const char *ca);
/**
* Get current root CA
*/
size_t storage_get_root_ca(char *dest);
2024-08-28 22:09:47 +00:00
/**
* Write device certificate
*/
void storage_set_dev_cert(const char *cert);
/**
* Get current device certificate
*/
size_t storage_get_dev_cert(char *dest);
2024-07-27 13:31:17 +00:00
#ifdef __cplusplus
}
#endif