pub struct Connection { /* private fields */ }Expand description
An SMP protocol layer connection to a device.
In most cases this struct will not be used directly by the user,
but instead it is used indirectly through MCUmgrClient.
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn set_timeout(&self, timeout: Duration) -> Result<(), Report>
pub fn set_timeout(&self, timeout: Duration) -> Result<(), Report>
Changes the communication timeout.
When the device does not respond to packets within the set duration, an error will be raised.
Sourcepub fn execute_command<R: McuMgrCommand>(
&self,
request: &R,
) -> Result<R::Response, ExecuteError>
pub fn execute_command<R: McuMgrCommand>( &self, request: &R, ) -> Result<R::Response, ExecuteError>
Executes a given CBOR based SMP command.
Sourcepub fn execute_raw_command(
&self,
write_operation: bool,
group_id: u16,
command_id: u8,
data: &[u8],
) -> Result<Box<[u8]>, ExecuteError>
pub fn execute_raw_command( &self, write_operation: bool, group_id: u16, command_id: u8, data: &[u8], ) -> Result<Box<[u8]>, ExecuteError>
Executes a raw SMP command.
Same as Connection::execute_command, but the payload can be anything and must not
necessarily be CBOR encoded.
Errors are also not decoded but instead will be returned as raw CBOR data.
Read Zephyr’s SMP Protocol Specification for more information.
Auto Trait Implementations§
impl !Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
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
Mutably borrows from an owned value. Read more