The official git repository for OSD-Contiki, the open source OS for the Internet of Things
Find a file
Robert Quattlebaum 28a1e40ebd core/lib/settings: Generalized Settings Manager to work on any platform
This commit moves the Settings Manager from the AVR codebase
into the Contiki core library. Any platform that implements
the Contiki EEPROM API can now use the Settings Manager's
key-value store for storing their persistent configuration info.

The Settings Manager is a EEPROM-based key-value store. Keys
are 16-bit integers and values may be up to 16,383 bytes long.
It is intended to be used to store configuration-related information,
like network settings, radio channels, etc.

 * Robust data format which requires no initialization.
 * Supports multiple values with the same key.
 * Data can be appended without erasing EEPROM.
 * Max size of settings data can be easily increased in the future,
   as long as it doesn't overlap with application data.

The format was inspired by the [OLPC manufacturing data format][].

Since the beginning of EEPROM often contains application-specific
information, the best place to store settings is at the end of EEPROM
(the "top"). Because we are starting at the end of EEPROM, it makes
sense to grow the list of key-value pairs downward, toward the start of
EEPROM.

Each key-value pair is stored in memory in the following format:

Order    | Size     | Name         | Description
--------:|---------:|--------------|-------------------------------
       0 |        2 | `key`        | 16-bit key
      -2 |        1 | `size_check` | One's-complement of next byte
      -3 |   1 or 2 | `size`       | The size of `value`, in bytes
-4 or -5 | variable | `value`      | Value associated with `key`

The end of the key-value pairs is denoted by the first invalid entry.
An invalid entry has any of the following attributes:

 * The `size_check` byte doesn't match the one's compliment of the
   `size` byte (or `size_low` byte).
 * The key has a value of 0x0000.

[OLPC manufacturing data format]: http://wiki.laptop.org/go/Manufacturing_data
2013-03-20 11:57:13 -07:00
apps shell: Fix GUI build 2013-03-19 19:23:08 +01:00
core core/lib/settings: Generalized Settings Manager to work on any platform 2013-03-20 11:57:13 -07:00
cpu core/lib/settings: Generalized Settings Manager to work on any platform 2013-03-20 11:57:13 -07:00
doc Define IPv6 and RPL related macros in Doxygen config 2012-11-07 17:04:13 +01:00
examples core/lib/settings: Generalized Settings Manager to work on any platform 2013-03-20 11:57:13 -07:00
platform core/lib/settings: Generalized Settings Manager to work on any platform 2013-03-20 11:57:13 -07:00
regression-tests core/lib/settings: Generalized Settings Manager to work on any platform 2013-03-20 11:57:13 -07:00
tools core/net/uip: Rename uip_ethaddr to uip_lladdr. 2013-03-10 11:39:11 -07:00
.gitignore Added Apple II 3.5" floppy image. 2013-02-05 21:07:54 +01:00
.travis.yml Split the collect test into collect and collect-lossy to make each individual 2013-03-18 09:07:33 +01:00
LICENSE Removed the explicit year 2012 to make it more generic 2012-10-25 23:08:54 +02:00
Makefile.include core/lib/settings: Generalized Settings Manager to work on any platform 2013-03-20 11:57:13 -07:00
README Updated README with new website and shorter text 2012-07-12 11:30:21 +02:00
README-BUILDING Add some info on the DEFINES= / savedefines mechanism. 2008-06-12 22:13:59 +00:00
README-EXAMPLES Added CTK standalone FTP client example. 2010-10-16 10:36:20 +00:00

The Contiki Operating System

Contiki is an open source operating system that runs on tiny low-power
microcontrollers and makes it possible to develop applications that
make efficient use of the hardware while providing standardized
low-power wireless communication for a range of hardware platforms.

Contiki is used in numerous commercial and non-commercial systems,
such as city sound monitoring, street lights, networked electrical
power meters, industrial monitoring, radiation monitoring,
construction site monitoring, alarm systems, remote house monitoring,
and so on.

For more information, see the Contiki website:

http://www.contiki-os.org/