Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(iti): KAM-214: improv-wifi support #66

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
205 changes: 204 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
resolver = "2"
members = [
"crates/bestool",
"crates/improv-wifi",
"crates/rpi-st7789v2-driver",
]

Expand Down
25 changes: 25 additions & 0 deletions crates/improv-wifi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "improv-wifi"
version = "0.1.0"
edition = "2021"
rust-version = "1.76.0"
resolver = "2"

authors = ["Félix Saparelli <[email protected]>", "BES Developers <[email protected]>"]
license = "GPL-3.0-or-later"
description = "Implementation of the Improv-WiFi protocol for Linux"
keywords = ["improv-wifi", "linux", "wifi", "ble", "networkmanager"]
categories = ["embedded"]
repository = "https://github.com/beyondessential/bestool"

[dependencies]
bluer = { version = "0.17.1", features = ["bluetoothd"] }
miette = { version = "7.2.0", optional = true }
thiserror = "1.0.59"
tokio = { version = "1.37.0", features = ["sync", "rt"] }
tracing = { version = "0.1.40", features = ["attributes"] }
winnow = "0.6.8"

[features]
miette = ["dep:miette"]
networkmanager = []
4 changes: 4 additions & 0 deletions crates/improv-wifi/release.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
publish = true
tag-message = "release: improv-wifi {{version}}"
pre-release-commit-message = "release: improv-wifi {{version}}"
pre-release-hook = ["git", "cliff", "-r", "../..", "-c", "../../cliff.toml", "-o", "../../CHANGELOG.md", "--tag", "{{version}}"]
24 changes: 24 additions & 0 deletions crates/improv-wifi/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum Error {
/// RPC packet was malformed/invalid.
InvalidRPC = 0x01,

/// The command sent is unknown.
UnknownRPC = 0x02,

/// The credentials have been received and an attempt to connect to the network has failed.
UnableToConnect = 0x03,

/// Credentials were sent via RPC but the Improv service is not authorized.
NotAuthorized = 0x04,

/// Unknown error.
Unknown = 0xFF,
}

impl Error {
pub fn as_byte(&self) -> u8 {
*self as _
}
}
Loading
Loading