Skip to content

Commit 6e9762c

Browse files
authored
bump dropshot and friends (#109)
Signed-off-by: Jess Frazelle <[email protected]>
1 parent 6bc0569 commit 6e9762c

36 files changed

+128
-85
lines changed

Cargo.lock

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ clap = { version = "4.5.18", features = ["cargo", "derive", "env", "unicode"] }
3030
console-subscriber = { version = "0", optional = true }
3131
dashmap = "6.1.0"
3232
delouse = { version = "0.1", optional = true }
33-
dropshot = "0.11"
33+
dropshot = "0.12"
3434
futures = "0.3.28"
3535
futures-util = "0.3.30"
36+
http = "1"
37+
hyper = "1"
3638
libmdns = "0.9.1"
37-
multer = { version = "3.1.0", features = ["json"] }
3839
moonraker = { path = "moonraker", optional = true }
40+
multer = { version = "3.1.0", features = ["json"] }
3941
opentelemetry = "0.24.0"
4042
opentelemetry-otlp = "0.17.0"
4143
opentelemetry_sdk = { version = "0.24.1", features = ["rt-tokio"] }
@@ -50,15 +52,13 @@ slog-json = "2.6.1"
5052
slog-term = "2.9.1"
5153
thiserror = "1.0.64"
5254
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time", "net"] }
55+
tokio-serial = { version = "5", optional = true, features = ["tokio-util", "libudev"] }
5356
toml = "0.8.19"
5457
tracing = "0.1"
5558
tracing-opentelemetry = "0.25.0"
59+
tracing-slog = "0.3.0"
5660
tracing-subscriber = { version = "0.3.18", features = ["registry", "std", "fmt", "smallvec", "ansi", "tracing-log", "json", "env-filter"] }
5761
uuid = "1.10.0"
58-
tokio-serial = { version = "5", optional = true, features = ["tokio-util", "libudev"] }
59-
tracing-slog = "0.3.0"
60-
http = "0.2.9"
61-
hyper = "0.14"
6262

6363
[dev-dependencies]
6464
async-trait = "0.1"

src/any_machine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::{Control as ControlTrait, MachineInfo, MachineMakeModel, MachineType, Volume};
21
use anyhow::Result;
32

3+
use crate::{Control as ControlTrait, MachineInfo, MachineMakeModel, MachineType, Volume};
4+
45
/// AnyMachine is any supported machine.
56
#[non_exhaustive]
67
pub enum AnyMachine {

src/bambu/control.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
use anyhow::Result;
2+
use bambulabs::{client::Client, command::Command};
3+
14
use super::{PrinterInfo, X1Carbon};
25
use crate::{
36
Control as ControlTrait, MachineInfo as MachineInfoTrait, MachineMakeModel, MachineType,
47
SuspendControl as SuspendControlTrait, ThreeMfControl as ThreeMfControlTrait, ThreeMfTemporaryFile, Volume,
58
};
6-
use anyhow::Result;
7-
use bambulabs::{client::Client, command::Command};
89

910
impl X1Carbon {
1011
/// Return a borrow of the underlying Client.

src/bambu/discover.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
use super::{PrinterInfo, X1Carbon};
2-
use crate::{slicer, Discover as DiscoverTrait, Machine, MachineMakeModel};
3-
use anyhow::Result;
4-
use serde::{Deserialize, Serialize};
51
use std::{
62
collections::HashMap,
73
net::{IpAddr, Ipv4Addr},
84
sync::Arc,
95
};
6+
7+
use anyhow::Result;
8+
use serde::{Deserialize, Serialize};
109
use tokio::{net::UdpSocket, sync::RwLock};
1110

11+
use super::{PrinterInfo, X1Carbon};
12+
use crate::{slicer, Discover as DiscoverTrait, Machine, MachineMakeModel};
13+
1214
/// Specific make/model of Bambu device.
1315
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
1416
#[non_exhaustive]

src/bambu/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
mod control;
44
mod discover;
55

6+
use std::{net::IpAddr, sync::Arc};
7+
8+
use bambulabs::client::Client;
69
pub use discover::{BambuVariant, Config, X1CarbonDiscover};
710

811
use crate::MachineMakeModel;
9-
use bambulabs::client::Client;
10-
use std::{net::IpAddr, sync::Arc};
1112

1213
/// Control channel handle to a Bambu Labs X1 Carbon.
1314
#[derive(Clone)]

src/bin/machine-api/cmd_serve.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
use super::{Cli, Config};
1+
use std::{collections::HashMap, net::SocketAddr, sync::Arc};
2+
23
use anyhow::Result;
34
use machine_api::server;
4-
use std::{collections::HashMap, net::SocketAddr, sync::Arc};
55
use tokio::sync::RwLock;
66

7+
use super::{Cli, Config};
8+
79
pub async fn main(_cli: &Cli, cfg: &Config, bind: &str) -> Result<()> {
810
let machines = Arc::new(RwLock::new(HashMap::new()));
911

src/bin/machine-api/config/bambu.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
use super::{Config, MachineConfig};
1+
use std::{collections::HashMap, sync::Arc};
2+
23
use anyhow::Result;
34
use machine_api::{bambu, Discover, Machine};
4-
use std::{collections::HashMap, sync::Arc};
55
use tokio::sync::RwLock;
66

7+
use super::{Config, MachineConfig};
8+
79
impl Config {
810
pub async fn spawn_discover_bambu(&self, machines: Arc<RwLock<HashMap<String, RwLock<Machine>>>>) -> Result<()> {
911
let discovery = bambu::X1CarbonDiscover::new(

src/bin/machine-api/config/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
use std::collections::HashMap;
2+
13
use machine_api::{bambu as crate_bambu, moonraker as crate_moonraker, usb as crate_usb};
24
use serde::{Deserialize, Serialize};
3-
use std::collections::HashMap;
45

56
mod bambu;
67
mod moonraker;

src/bin/machine-api/config/moonraker.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
use super::{Config, MachineConfig};
1+
use std::{collections::HashMap, sync::Arc};
2+
23
use anyhow::Result;
34
use machine_api::{moonraker, Machine, MachineMakeModel};
4-
use std::{collections::HashMap, sync::Arc};
55
use tokio::sync::RwLock;
66

7+
use super::{Config, MachineConfig};
8+
79
impl Config {
810
pub async fn create_moonraker(&self, machines: Arc<RwLock<HashMap<String, RwLock<Machine>>>>) -> Result<()> {
911
for (key, config) in self

0 commit comments

Comments
 (0)