[riot-notifications] [RIOT-OS/RIOT] doc/memos: RDM Runtime Configuration Architecture (#10622)

José Alamos notifications at github.com
Wed Jan 2 14:27:44 CET 2019

jia200x commented on this pull request.

> +standards.
+# 2. Architecture
+The RCS is formed by [the RIOT Registry](3-the-riot-registry), one or more [Registry Handlers](4-registry-handlers), one or more
+[storage facilities](5-storage-facilities) and a [configuration manager](6-configuration-manager) with one or more interfaces. The
+runtime configuration manager could in the future be replaced by a generic
+manager.  ![](./files/rdm-draft-alamos-lanzieri-runtime-configuration-architecture/architecture.png "Runtime Configuration Architecture")
+# 3. The RIOT Registry
+The RIOT Registry exposes an API for handling 
+**persistent module configurations**. The RIOT registry
+allows, among others, to:
+- Get or set configuration parameters via registry handlers
+- Commit a configuration group via the given registry handler
+- Load and set configuration parameters from a persistent storage device
+- Export configuration parameters (e.g copy to a buffer, print, etc)

The `get` functions work exactly in the same way as netdev `get` function. It _copies_ the actual value of the given key to a buffer. 

The `export` receives a _callback function_ as an argument. It has to call this _callback function_ once for each configuration parameter. This is the interface used to either print all configurations to STDOUT or save them to a storage. A dummy example of the first:

void export_print(char *key, char *value)
    /* print the given key and value */
    printf("%s: %s\n", key, value);

int my_export_handler(int (*export_func)(const char *name, char *val), ...)
   /* Call export_func for each configuration parameter in this module */
   export_func("module/a_conf", ...);
   export_func("module/another_conf", ...);

registry_handler_t my_handler = {
/* ... */
.export = my_export_handler

int main(void)
/* Register handlers, init, etc */

/* This will print all configurations and their value to STDOUT */
my_handler->export(export_print, ...);

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190102/45d855b8/attachment-0001.html>

More information about the notifications mailing list