[go: up one dir, main page]

Skip to content

LuKks/iot-nvs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iot-nvs

Non-Volatile Storage functions in C for IoT

Usage

#include <nvs_flash.h>
#include <esp_err.h>

#include "iot_nvs.h"

void app_main () {
  ESP_ERROR_CHECK(nvs_flash_init());

  nvs_create("wifi");

  nvs_write_string("wifi", "connect-ssid", "Home AP");
  nvs_write_string("wifi", "connect-pass", "1234");

  char *ssid = nvs_read_string("wifi", "connect-ssid");
  char *pass = nvs_read_string("wifi", "connect-pass");

  // ...

  free(ssid);
  free(pass);

  ESP_ERROR_CHECK(nvs_flash_deinit());
}

API

See include/iot_nvs.h for the public API.

License

MIT

About

Non-Volatile Storage functions in C for IoT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published