Skip to content

Commit

Permalink
Merge pull request #944 from quartiq/feature/serial-settings-release
Browse files Browse the repository at this point in the history
Preping for serial-settings release
  • Loading branch information
jordens authored Aug 28, 2024
2 parents 3c7da0c + 95c768c commit ded49f0
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 53 deletions.
7 changes: 6 additions & 1 deletion serial-settings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
42 changes: 42 additions & 0 deletions serial-settings/README.md
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.
49 changes: 1 addition & 48 deletions serial-settings/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,51 +1,4 @@
//! 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> ]
//!
//! > plaform dfu
//! Reset to DFU is not supported
//!
//! > plaform service
//! Service data not available
//!
//! > get
//! Available settings:
//! /broker: "test" [default: "mqtt"] [not stored]
//! /id: "04-91-62-d2-a8-6f" [default: "04-91-62-d2-a8-6f"] [not stored]
//! ```
//!
//! # Design
//! Settings are specified in a [`miniconf::Tree`] 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 64-bytes on the settings path. This is arbitrary and
//! can be changed if needed.
#![doc = include_str!("../README.md")]
#![no_std]

use embedded_io::{ErrorType, Read, ReadReady, Write};
Expand Down
4 changes: 2 additions & 2 deletions src/bin/dual-iir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
//! application.
//!
//! ## Telemetry
//! Refer to [Telemetry] for information about telemetry reported by this application.
//! Refer to [stabilizer::net::telemetry::Telemetry] for information about telemetry reported by this application.
//!
//! ## Stream
//! This application streams raw ADC and DAC data over UDP. Refer to
//! [stabilizer::net::data_stream](../stabilizer/net/data_stream/index.html) for more information.
//! [stabilizer::net::data_stream] for more information.
#![no_std]
#![no_main]

Expand Down
4 changes: 2 additions & 2 deletions src/bin/lockin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
//! for this application.
//!
//! ## Telemetry
//! Refer to [Telemetry] for information about telemetry reported by this application.
//! Refer to [stabilizer::net::telemetry::Telemetry] for information about telemetry reported by this application.
//!
//! ## Stream
//! This application streams raw ADC and DAC data over UDP. Refer to
//! [stabilizer::net::data_stream](../stabilizer/net/data_stream/index.html) for more information.
//! [stabilizer::net::data_stream] for more information.
#![no_std]
#![no_main]

Expand Down

0 comments on commit ded49f0

Please sign in to comment.