simple-storage (community library)

Summary

Name Value
Name simple-storage
Version 1.0.0
Installs 969
License MIT
Author Julien Vanier jvanier@gmail.com
URL https://github.com/monkbroc/particle-simple-storage
Repository https://github.com/monkbroc/particle-simple-storage.git
Download .tar.gz

Load and store configuration from the EEPROM Automatically handle default and customize config migration

Example Build Testing

Device OS Version:

This table is generated from an automated build. Success only indicates that the code compiled successfully.

Library Read Me

This content is provided by the library maintainer and has not been validated or approved.

Simple Storage

A Particle library for simple persistent storage in EEPROM.

Usage

Define the config fields you want to store, provide default config and load the config on boot. Store the config after you modify it.

#include "simple-storage.h"

struct Config {
uint32_t app;
int counter;
} config;

Config defaultConfig = {
/* app */ APP_CODE('C','N', 'T', 1),
/* counter */ 0,
};

Storage<Config> storage(defaultConfig);

void setup() {
storage.load(config);
}

void loop() {
config.counter++;
if (config.counter % 1000 == 0) {
storage.store(counter);
}
}

See the examples folder for more details.

Documentation

TODO: Describe Storage

LICENSE

Copyright 2017 Julien Vanier jvanier@gmail.com

Licensed under the MIT license

Browse Library Files