Skip to content

Commit 382e8fe

Browse files
committed
fixes
Signed-off-by: Jess Frazelle <[email protected]>
1 parent 77de611 commit 382e8fe

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

bambulabs/src/client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ impl Client {
117117
self.responses.insert(SequenceId::status(), message);
118118
return Ok(());
119119
}
120+
121+
println!("{:#?}", message);
120122
self.responses.insert(sequence_id, message);
121123
return Ok(());
122124
}

bambulabs/src/message.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,15 @@ pub struct GcodeLine {
130130
/// The sequence id.
131131
pub sequence_id: SequenceId,
132132
/// The gcode line.
133-
pub line: String,
133+
pub param: Option<String>,
134+
/// The reason for the message.
135+
pub reason: Reason,
136+
/// The result of the command.
137+
pub result: Result,
138+
/// The source.
139+
pub source: Option<i64>,
140+
/// The return code.
141+
pub return_code: Option<String>,
134142
#[serde(flatten)]
135143
other: BTreeMap<String, Value>,
136144
}
@@ -151,7 +159,7 @@ pub struct ProjectFile {
151159
/// The subtask name.
152160
pub subtask_name: String,
153161
/// The gcode file.
154-
pub gcode_file: String,
162+
pub gcode_file: Option<String>,
155163
#[serde(flatten)]
156164
other: BTreeMap<String, Value>,
157165
}

openapi/api.json

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,30 @@
842842
],
843843
"type": "string"
844844
},
845-
"line": {
845+
"param": {
846846
"description": "The gcode line.",
847+
"nullable": true,
848+
"type": "string"
849+
},
850+
"reason": {
851+
"allOf": [
852+
{
853+
"$ref": "#/components/schemas/Reason"
854+
}
855+
],
856+
"description": "The reason for the message."
857+
},
858+
"result": {
859+
"allOf": [
860+
{
861+
"$ref": "#/components/schemas/Result"
862+
}
863+
],
864+
"description": "The result of the command."
865+
},
866+
"return_code": {
867+
"description": "The return code.",
868+
"nullable": true,
847869
"type": "string"
848870
},
849871
"sequence_id": {
@@ -853,11 +875,18 @@
853875
}
854876
],
855877
"description": "The sequence id."
878+
},
879+
"source": {
880+
"description": "The source.",
881+
"format": "int64",
882+
"nullable": true,
883+
"type": "integer"
856884
}
857885
},
858886
"required": [
859887
"command",
860-
"line",
888+
"reason",
889+
"result",
861890
"sequence_id"
862891
],
863892
"type": "object"
@@ -874,6 +903,7 @@
874903
},
875904
"gcode_file": {
876905
"description": "The gcode file.",
906+
"nullable": true,
877907
"type": "string"
878908
},
879909
"profile_id": {
@@ -907,7 +937,6 @@
907937
},
908938
"required": [
909939
"command",
910-
"gcode_file",
911940
"profile_id",
912941
"project_id",
913942
"sequence_id",

0 commit comments

Comments
 (0)