Struct rn4870::Rn4870[][src]

pub struct Rn4870<RX, TX, NRST> { /* fields omitted */ }
Expand description

Rn4870 Object

Implementations

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

pub fn new(rx: RX, tx: TX, 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 RX, &mut TX)>(&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 soft_reset(&mut self) -> Result<(), Error<ER, EW, GpioError>>[src]

Software reset, see section 2.6.28 of the User Guide (DS50002466C)

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

Sets a serialized Bluetooth name for the device

This function only works when in Command Mode.

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

Sets the device name

This function only works when in Command Mode.

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

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

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

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

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

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

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

Set default services

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

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

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

pub fn release(self) -> (TX, RX)[src]

Release the serial interfaces

Auto Trait Implementations

impl<RX, TX, NRST> Send for Rn4870<RX, TX, NRST> where
    NRST: Send,
    RX: Send,
    TX: Send

impl<RX, TX, NRST> Sync for Rn4870<RX, TX, NRST> where
    NRST: Sync,
    RX: Sync,
    TX: Sync

impl<RX, TX, NRST> Unpin for Rn4870<RX, TX, NRST> where
    NRST: Unpin,
    RX: Unpin,
    TX: Unpin

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.