pub struct Ezsp { /* private fields */ }Expand description
An EZSP client. Clones share one connection; commands are sent one at a time, as EZSP requires.
Implementations§
Source§impl Ezsp
impl Ezsp
Sourcepub async fn start<T>(
io: T,
config: ClientConfig,
) -> Result<(Ezsp, NcpInfo, UnboundedReceiver<EzspEvent>), EzspError>where
T: AsyncRead + AsyncWrite + Send + 'static,
pub async fn start<T>(
io: T,
config: ClientConfig,
) -> Result<(Ezsp, NcpInfo, UnboundedReceiver<EzspEvent>), EzspError>where
T: AsyncRead + AsyncWrite + Send + 'static,
Connect over io: reset the link, negotiate the protocol version
and read the stack version. Callbacks arrive on the receiver; it is
unbounded so a slow consumer never stalls command responses.
Sourcepub fn version(&self) -> ProtocolVersion
pub fn version(&self) -> ProtocolVersion
The negotiated protocol version.
Sourcepub async fn call(&self, command: Command) -> Result<Response, EzspError>
pub async fn call(&self, command: Command) -> Result<Response, EzspError>
Send a command and wait for its response.
Sourcepub async fn call_ok(&self, command: Command) -> Result<(), EzspError>
pub async fn call_ok(&self, command: Command) -> Result<(), EzspError>
Send a command whose response is a status and require success.
Sourcepub async fn get_value(&self, value_id: u8) -> Result<Vec<u8>, EzspError>
pub async fn get_value(&self, value_id: u8) -> Result<Vec<u8>, EzspError>
getValue, requiring success.
Sourcepub async fn set_value(
&self,
value_id: u8,
value: Vec<u8>,
) -> Result<(), EzspError>
pub async fn set_value( &self, value_id: u8, value: Vec<u8>, ) -> Result<(), EzspError>
setValue, requiring success.
Sourcepub async fn set_config(
&self,
config_id: u8,
value: u16,
) -> Result<(), EzspError>
pub async fn set_config( &self, config_id: u8, value: u16, ) -> Result<(), EzspError>
setConfigurationValue, requiring success.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Ezsp
impl !UnwindSafe for Ezsp
impl Freeze for Ezsp
impl Send for Ezsp
impl Sync for Ezsp
impl Unpin for Ezsp
impl UnsafeUnpin for Ezsp
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