storage.h 611 B

123456789101112131415161718
  1. /*
  2. * SPDX-FileCopyrightText: 2022 Helmut Pozimski <helmut@pozimski.eu>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0-only
  5. */
  6. #include <stdint.h>
  7. #include <time.h>
  8. #include <esp_err.h>
  9. #include <nvs_flash.h>
  10. esp_err_t storage_init(char* name);
  11. esp_err_t write_wakeup_time_tm(struct tm* datetime, uint16_t value);
  12. esp_err_t write_wakeup_time_str(char* key, uint16_t value);
  13. esp_err_t read_wakeup_time_tm(struct tm* datetime, uint16_t* value);
  14. esp_err_t read_wakeup_time_str(char* key, uint16_t* value);
  15. esp_err_t delete_wakeup_time_str(char* key);
  16. void delete_outdated_entries(struct tm* datetime, char* namespace);