2 unstable releases

0.2.0 Dec 2, 2024
0.1.0 Aug 28, 2024

#1953 in Embedded development

Download history 2/week @ 2024-11-14 3/week @ 2024-11-21 159/week @ 2024-11-28 76/week @ 2024-12-05 73/week @ 2024-12-12 49/week @ 2024-12-19 42/week @ 2024-12-26 28/week @ 2025-01-02 30/week @ 2025-01-09 80/week @ 2025-01-16 22/week @ 2025-01-23 145/week @ 2025-01-30 87/week @ 2025-02-06 36/week @ 2025-02-13 33/week @ 2025-02-20 2/week @ 2025-02-27

201 downloads per month
Used in 3 crates

MIT/Apache

30KB
635 lines

Persistent Settings Management Serial Interface

Description

This crate provides a simple means to load, configure, and store device settings over a serial (i.e. text-based) interface. It is ideal to be used with serial ports and terminal emulators, and exposes a simple way to allow users to configure device operation.

Example

Let's assume that your settings structure looks as follows:

#[derive(miniconf::Tree, ...)]
struct Settings {
    broker: String,
    id: String,
}

A user would be displayed the following terminal interface:

 help
AVAILABLE ITEMS:
  get [path]
  set <path> <value>
  store [path]
  clear [path]
  platform <cmd>
  help [ <command> ]

> get
Available settings:
/broker: "test" [default: "mqtt"] [not stored]
/id: "04-91-62-d2-a8-6f" [default] [not stored]

Design

Settings are specified in a miniconf::TreeKey settings tree and are transferred over the serial interface using JSON encoding. This means that things like strings must be encased in quotes.

Limitations

Currently, there is a hardcoded limit of 128-bytes on the settings path. This is arbitrary and can be changed if needed.

Dependencies

~1.5–2.2MB
~47K SLoC