use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize)]
pub struct ShellCommandLineExecute<'a> {
pub argv: &'a [String],
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
pub struct ShellCommandLineExecuteResponse {
pub o: String,
pub ret: i32,
}
#[cfg(test)]
mod tests {
use super::super::macros::command_encode_decode_test;
use super::*;
use ciborium::cbor;
command_encode_decode_test! {
shell,
(2, 9, 0),
ShellCommandLineExecute{
argv: &[
"kernel".to_string(),
"version".to_string(),
],
},
cbor!({
"argv" => ["kernel", "version"]
}),
cbor!({
"o" => "some_zephyr_version",
"ret" => -4
}),
ShellCommandLineExecuteResponse{
o: "some_zephyr_version".to_string(),
ret: -4,
},
}
}