[][src]Struct rn4870::Rn4870

pub struct Rn4870<UART, NRST> { /* fields omitted */ }

Rn4870 Object

Implementations

impl<UART, NRST, EW, ER, GpioError> Rn4870<UART, NRST> where
    UART: Write<u8, Error = EW> + Read<u8, Error = ER>,
    NRST: OutputPin<Error = GpioError>, 
[src]

pub fn new(uart: UART, nrst: NRST) -> Self[src]

Construct a new Rn4870 Object

pub fn hard_reset<DELAY: DelayMs<u16>>(
    &mut self,
    delay: &mut DELAY
) -> Result<(), Error<ER, EW, GpioError>>
[src]

Reset the RN4870 module

Note that this must be done before the RN4870 will start responding to serial commands.

pub fn handle_error<T: Fn(&mut UART)>(&mut self, func: T)[src]

Escape hatch for handling hardware errors

Until the embedded_hal traits include error handling there is no device-agnostic way to deal with hardware errors. This is an escape hatch to allow users to access the UART peripheral.

pub fn enter_cmd_mode(&mut self) -> Result<(), Error<ER, EW, GpioError>>[src]

Enter Command Mode

pub fn enter_data_mode(&mut self) -> Result<(), Error<ER, EW, GpioError>>[src]

Enter Data Mode

pub fn set_name(&mut self, name: &str) -> Result<(), Error<ER, EW, GpioError>>[src]

Set the BLE name

This function only works when in Command Mode.

pub fn set_default_services(
    &mut self,
    value: u8
) -> Result<(), Error<ER, EW, GpioError>>
[src]

Set default services

pub fn send_raw(&mut self, values: &[u8]) -> Result<(), EW>[src]

pub fn read_raw(&mut self) -> Result<u8, ER>[src]

Auto Trait Implementations

impl<UART, NRST> Send for Rn4870<UART, NRST> where
    NRST: Send,
    UART: Send

impl<UART, NRST> Sync for Rn4870<UART, NRST> where
    NRST: Sync,
    UART: Sync

impl<UART, NRST> Unpin for Rn4870<UART, NRST> where
    NRST: Unpin,
    UART: Unpin

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, 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.