Replace proto-based bambu_protocol with plain-Rust bambu_commands/

One file per command (get_version.rs, pushall.rs), each holding its
request AND response together. CommandEnvelope (sequence_id + command) is
the shared-fields piece every command embeds via #[serde(flatten)] — the
'inheritance' replacement for these structs, same composition idea as
BambuGenericPrinter in bambu.rs, just expressed as a struct field instead
of impl-block delegation.

examples/bambu_commands_demo.rs round-trips both commands against Bambu's
exact real JSON (from the original conversation) and confirms byte-for-
byte matches, same as the removed proto version did — this replacement is
behaviorally identical, just without protoc/build.rs in the loop.
This commit is contained in:
2026-08-28 22:49:06 +00:00
parent 8e5d85202f
commit 166761479b
8 changed files with 145 additions and 78 deletions
+2 -2
View File
@@ -30,8 +30,8 @@ name = "auto_connect_bambu"
path = "examples/auto_connect_bambu.rs"
[[example]]
name = "bambu_protocol_demo"
path = "examples/bambu_protocol_demo.rs"
name = "bambu_commands_demo"
path = "examples/bambu_commands_demo.rs"
[dependencies]
tokio = { version = "1.40", features = ["full"] }