-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #944 from quartiq/feature/serial-settings-release
Preping for serial-settings release
- Loading branch information
Showing
5 changed files
with
53 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,20 @@ | |
name = "serial-settings" | ||
version = "0.1.0" | ||
edition = "2021" | ||
readme = "README.md" | ||
description = "Embedded device settings management over serial terminal and flash" | ||
authors = [ | ||
"Robert Jördens <[email protected]>", | ||
"Ryan Summers <[email protected]>", | ||
] | ||
categories = ["embedded", "no-std", "hardware-support"] | ||
categories = ["embedded", "no-std", "config", "command-line-interface"] | ||
license = "MIT OR Apache-2.0" | ||
keywords = ["serial", "settings", "cli", "management", "async"] | ||
repository = "https://github.com/quartiq/stabilizer" | ||
|
||
[badges] | ||
maintenance = { status = "actively-developed" } | ||
|
||
[dependencies] | ||
miniconf = { version = "0.13", features = ["json-core", "postcard"] } | ||
menu = { version = "0.5", features = ["echo"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# 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: | ||
```rust | ||
#[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 | ||
qutoes. | ||
|
||
## Limitations | ||
Currently, there is a hardcoded limit of 128-bytes on the settings path. This is arbitrary and | ||
can be changed if needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters