mirror of
https://github.com/hubaldv/bioz-host-rs.git
synced 2025-12-06 05:11:17 +00:00
Working postcard communication.
This commit is contained in:
59
Cargo.lock
generated
59
Cargo.lock
generated
@@ -66,14 +66,15 @@ dependencies = [
|
|||||||
name = "bioz-host-rs"
|
name = "bioz-host-rs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bioz-icd",
|
"bioz-icd-rs",
|
||||||
|
"defmt",
|
||||||
"postcard-rpc",
|
"postcard-rpc",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-serial",
|
"tokio-serial",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bioz-icd"
|
name = "bioz-icd-rs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"postcard-rpc",
|
"postcard-rpc",
|
||||||
@@ -186,6 +187,38 @@ version = "1.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
|
checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "defmt"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 1.3.2",
|
||||||
|
"defmt-macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "defmt-macros"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e"
|
||||||
|
dependencies = [
|
||||||
|
"defmt-parser",
|
||||||
|
"proc-macro-error2",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "defmt-parser"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e"
|
||||||
|
dependencies = [
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "embedded-io"
|
name = "embedded-io"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
@@ -677,6 +710,28 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro-error-attr2"
|
||||||
|
version = "2.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro-error2"
|
||||||
|
version = "2.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-error-attr2",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.95"
|
version = "1.0.95"
|
||||||
|
|||||||
@@ -4,13 +4,14 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
defmt = { version = "1.0.1" }
|
||||||
|
|
||||||
[dependencies.bioz-icd]
|
[dependencies.bioz-icd-rs]
|
||||||
path = "../bioz-icd-rs"
|
path = "../bioz-icd-rs"
|
||||||
features = ["use-std"]
|
features = ["use-std"]
|
||||||
|
|
||||||
[dependencies.postcard-rpc]
|
[dependencies.postcard-rpc]
|
||||||
version = "0.11"
|
version = "0.11.13"
|
||||||
features = [
|
features = [
|
||||||
"use-std",
|
"use-std",
|
||||||
"raw-nusb",
|
"raw-nusb",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
use postcard_rpc::{
|
use postcard_rpc::{
|
||||||
header::VarSeqKind,
|
header::VarSeqKind,
|
||||||
host_client::{HostClient, HostErr},
|
host_client::{HostClient, HostErr},
|
||||||
standard_icd::{PingEndpoint, WireError, ERROR_PATH},
|
standard_icd::{WireError, ERROR_PATH},
|
||||||
};
|
};
|
||||||
use std::convert::Infallible;
|
use std::convert::Infallible;
|
||||||
use bioz_icd::{
|
use bioz_icd_rs::{
|
||||||
AccelRange, BadPositionError, GetUniqueIdEndpoint, Rgb8, SetAllLedEndpoint,
|
AccelRange, BadPositionError, PingEndpoint, GetUniqueIdEndpoint, Rgb8, SetAllLedEndpoint,
|
||||||
SetSingleLedEndpoint, SingleLed, StartAccel, StartAccelerationEndpoint,
|
SetSingleLedEndpoint, SingleLed, StartAccel, StartAccelerationEndpoint,
|
||||||
StopAccelerationEndpoint,
|
StopAccelerationEndpoint,
|
||||||
};
|
};
|
||||||
@@ -46,7 +46,7 @@ impl<T, E> FlattenErr for Result<T, E> {
|
|||||||
impl WorkbookClient {
|
impl WorkbookClient {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let client = HostClient::new_raw_nusb(
|
let client = HostClient::new_raw_nusb(
|
||||||
|d| d.product_string() == Some("bioz-amplifier"),
|
|d| d.product_string() == Some("Bioz Amplifier"),
|
||||||
ERROR_PATH,
|
ERROR_PATH,
|
||||||
8,
|
8,
|
||||||
VarSeqKind::Seq2,
|
VarSeqKind::Seq2,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#![deny(missing_debug_implementations)]
|
#![deny(missing_debug_implementations)]
|
||||||
|
|
||||||
pub mod client;
|
pub mod client;
|
||||||
pub use bioz_icd as icd;
|
pub use bioz_icd_rs as icd;
|
||||||
|
|
||||||
pub async fn read_line() -> String {
|
pub async fn read_line() -> String {
|
||||||
tokio::task::spawn_blocking(|| {
|
tokio::task::spawn_blocking(|| {
|
||||||
|
|||||||
Reference in New Issue
Block a user