pub enum Command {
Show 18 variants
PushAll,
GetVersion,
Pause,
Resume,
Stop,
CleanPrintError,
GcodeLine(String),
GcodeFile(String),
PrintSpeed(SpeedLevel),
ProjectFile(ProjectFile),
Led {
node: LedNode,
on: bool,
},
IpcamTimelapse(TimelapseControl),
Reboot,
AmsControl(AmsControl),
AmsChangeFilament {
target: u32,
curr_temp: i64,
tar_temp: i64,
},
AmsUserSetting {
ams_id: u32,
startup_read: bool,
tray_read: bool,
},
AmsFilamentSetting(Box<AmsFilamentSetting>),
Calibration {
bed_level: bool,
vibration: bool,
motor_noise: bool,
},
}Expand description
A control/query command sent to the printer.
Pure and data-only: rendering to JSON (Command::to_payload) takes the
caller-allocated sequence_id, so the value itself carries no mutable state.
Variants§
PushAll
Request a full state snapshot (pushing.pushall).
GetVersion
Request the module/firmware inventory (info.get_version). A read; the
response comes back under /info with a module[] array.
Pause
Pause the current print.
Resume
Resume a paused print.
Stop
Stop (cancel) the current print — irreversible.
CleanPrintError
Clear a print error / dismiss the error popup (print.clean_print_error).
This is what Bambu Studio sends to acknowledge an error popup. Command name
is from vendor docs; the A1 mini ACKs it success (observed). What it
does NOT do, observed on this unit: it did not move gcode_state out of
FAILED (tested with print_error already 0), and ams_change_filament
stayed rejected while FAILED. So treat it as “dismiss the error”, not
“return to idle”. Sending it while an error is active is still
uncharacterised. [spec]
GcodeLine(String)
Send a single raw G-code line (print.gcode_line).
GcodeFile(String)
Print a raw G-code file already on the printer (print.gcode_file,
single-material — no AMS mapping). The value is the on-printer path.
PrintSpeed(SpeedLevel)
Set the print-speed profile (print.print_speed). Effect is read back
from spd_lvl; can be sent mid-print.
ProjectFile(ProjectFile)
Start a print of a sliced 3MF on the printer (print.project_file).
Led
Turn an LED on/off (system.ledctrl). Effect is read back from
lights_report for the matching node, not the ACK alone.
IpcamTimelapse(TimelapseControl)
Enable/disable the printer’s per-print timelapse recording
(camera.ipcam_timelapse). Its effect is read back from the
ipcam.timelapse report field. [spec] — shape is from OpenBambuAPI;
not device-confirmed (this unit’s camera is hardware-dead).
Reboot
Reboot the printer (system.reboot). Undocumented in the spec but
accepted by the A1 mini (observed). The connection drops and the
printer restarts, so there is no ACK — send it fire-and-forget.
AmsControl(AmsControl)
Basic AMS control (print.ams_control): resume/reset/pause. [spec]
AmsChangeFilament
Change the loaded filament via the AMS (print.ams_change_filament):
target tray, with the old (curr_temp) and new (tar_temp) nozzle
temps. Physically moves filament. [spec] — not device-confirmed.
AmsUserSetting
AMS RFID-read settings (print.ams_user_setting). [spec]
Fields
AmsFilamentSetting(Box<AmsFilamentSetting>)
Set a tray’s filament profile (print.ams_filament_setting). [spec]
Calibration
Run printer calibration (print.calibration, an option bitmask).
(Lidar — bit 0 — is X1-only and intentionally not exposed here.)
Implementations§
Source§impl Command
impl Command
Sourcepub fn category(&self) -> &'static str
pub fn category(&self) -> &'static str
The top-level message category — the single JSON key this command nests
under, and the key its ACK comes back under (print commands are ACKed
at /print/..., system commands at /system/...).
Sourcepub fn to_payload(&self, sequence_id: &str) -> Value
pub fn to_payload(&self, sequence_id: &str) -> Value
Render this command to its request-payload JSON, stamping sequence_id.
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.