[][src]Struct drogue_rak811::Rak811Driver

pub struct Rak811Driver<W, R, RST> where
    W: Write<u8>,
    R: Read<u8>,
    RST: OutputPin
{ /* fields omitted */ }

Implementations

impl<W, R, RST> Rak811Driver<W, R, RST> where
    W: Write<u8>,
    R: Read<u8>,
    RST: OutputPin
[src]

pub fn new(
    tx: W,
    rx: R,
    rst: RST
) -> Result<Rak811Driver<W, R, RST>, DriverError>
[src]

Create a new instance of the driver. The driver will trigger a reset of the module and expect a response from the firmware.

pub fn initialize(&mut self) -> Result<(), DriverError>[src]

Initialize the driver. This will cause the RAK811 module to be reset.

pub fn reset(&mut self, mode: ResetMode) -> Result<(), DriverError>[src]

Send reset command to lora module. Depending on the mode, this will restart the module or reload its configuration from EEPROM.

pub fn join(&mut self, mode: ConnectMode) -> Result<(), DriverError>[src]

Join a LoRa Network using the specified mode.

pub fn set_band(&mut self, band: LoraRegion) -> Result<(), DriverError>[src]

Set the frequency band based on the region.

pub fn set_mode(&mut self, mode: LoraMode) -> Result<(), DriverError>[src]

Set the mode of operation, peer to peer or network mode.

pub fn set_device_address(&mut self, addr: &DevAddr) -> Result<(), DriverError>[src]

pub fn set_device_eui(&mut self, eui: &EUI) -> Result<(), DriverError>[src]

pub fn set_app_eui(&mut self, eui: &EUI) -> Result<(), DriverError>[src]

pub fn set_app_key(&mut self, key: &AppKey) -> Result<(), DriverError>[src]

pub fn send(
    &mut self,
    qos: QoS,
    port: Port,
    data: &[u8]
) -> Result<(), DriverError>
[src]

Transmit data using the specified confirmation mode and given port.

pub fn try_recv(
    &mut self,
    port: Port,
    rx_buf: &mut [u8]
) -> Result<usize, DriverError>
[src]

Poll for any received data and copy it to the provided buffer. If data have been received, the length of the data is returned.

pub fn process(&mut self) -> Result<(), DriverError>[src]

Attempt to read data from UART and store it in the parse buffer. This should be invoked whenever data should be read.

pub fn digest(&mut self) -> Result<(), DriverError>[src]

Attempt to parse the internal buffer and enqueue any response data found.

pub fn send_command(
    &mut self,
    command: Command<'_>
) -> Result<Response, DriverError>
[src]

Send an AT command to the lora module and await a response.

Auto Trait Implementations

impl<W, R, RST> Send for Rak811Driver<W, R, RST> where
    R: Send,
    RST: Send,
    W: Send
[src]

impl<W, R, RST> !Sync for Rak811Driver<W, R, RST>[src]

impl<W, R, RST> Unpin for Rak811Driver<W, R, RST> where
    R: Unpin,
    RST: Unpin,
    W: Unpin
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.