pub struct BluetoothTransport { /* private fields */ }Expand description
Native macOS Bluetooth transport using IOBluetooth RFCOMM.
Implementations§
Source§impl BluetoothTransport
impl BluetoothTransport
Sourcepub fn open(device_name: Option<&str>) -> Result<Self, TransportError>
pub fn open(device_name: Option<&str>) -> Result<Self, TransportError>
Connect to a TH-D75 radio via Bluetooth RFCOMM.
§Errors
Returns TransportError::NotFound if no device found or RFCOMM fails.
Trait Implementations§
Source§impl Debug for BluetoothTransport
impl Debug for BluetoothTransport
Source§impl Drop for BluetoothTransport
impl Drop for BluetoothTransport
Source§impl Transport for BluetoothTransport
impl Transport for BluetoothTransport
Source§async fn write(&mut self, data: &[u8]) -> Result<(), TransportError>
async fn write(&mut self, data: &[u8]) -> Result<(), TransportError>
Send raw bytes to the radio.
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, TransportError>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, TransportError>
Read available bytes into buffer, return count of bytes read.
Source§fn set_baud_rate(&mut self, _baud: u32) -> Result<(), TransportError>
fn set_baud_rate(&mut self, _baud: u32) -> Result<(), TransportError>
Change the transport baud rate. Read more
impl Send for BluetoothTransport
impl Sync for BluetoothTransport
Auto Trait Implementations§
impl Freeze for BluetoothTransport
impl RefUnwindSafe for BluetoothTransport
impl Unpin for BluetoothTransport
impl UnwindSafe for BluetoothTransport
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