[−][src]Struct rn4870::Rn4870
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]
UART: Write<u8, Error = EW> + Read<u8, Error = ER>,
NRST: OutputPin<Error = GpioError>,
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]
&mut self,
delay: &mut DELAY
) -> Result<(), Error<ER, EW, GpioError>>
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]
&mut self,
value: u8
) -> Result<(), Error<ER, EW, GpioError>>
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,
NRST: Send,
UART: Send,
impl<UART, NRST> Sync for Rn4870<UART, NRST> where
NRST: Sync,
UART: Sync,
NRST: Sync,
UART: Sync,
impl<UART, NRST> Unpin for Rn4870<UART, NRST> where
NRST: Unpin,
UART: Unpin,
NRST: Unpin,
UART: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,