mcumgr_toolkit/commands/
shell.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Serialize)]
5pub struct ShellCommandLineExecute<'a> {
6 pub argv: &'a [String],
8}
9
10#[derive(Debug, Deserialize, Eq, PartialEq)]
12pub struct ShellCommandLineExecuteResponse {
13 pub o: String,
15 pub ret: i32,
17}
18
19#[cfg(test)]
20mod tests {
21 use super::super::macros::command_encode_decode_test;
22 use super::*;
23 use ciborium::cbor;
24
25 command_encode_decode_test! {
26 shell,
27 (2, 9, 0),
28 ShellCommandLineExecute{
29 argv: &[
30 "kernel".to_string(),
31 "version".to_string(),
32 ],
33 },
34 cbor!({
35 "argv" => ["kernel", "version"]
36 }),
37 cbor!({
38 "o" => "some_zephyr_version",
39 "ret" => -4
40 }),
41 ShellCommandLineExecuteResponse{
42 o: "some_zephyr_version".to_string(),
43 ret: -4,
44 },
45 }
46}