Expand description
Android API wrapper handling Bluetooth classic RFCOMM/SPP connection.
This crate is looking for maintainers!
TODO:
- Add a function and an enum for checking the bluetooth state.
- Add functions for permission request and enabling bluetooth. https://developer.android.com/develop/connectivity/bluetooth/setup
- Add functions for device discovery and pairing.
- Provide an asynchronous interface.
Structs§
- Bluetooth
Device - Corresponds to
android.bluetooth.BluetoothDevice
. - Bluetooth
Socket - Manages the Bluetooth socket and IO streams. It uses a read buffer and a background thread,
because the timeout of the Java
InputStream
from theBluetoothSocket
cannot be set. The read timeout defaults to 0 (it does not block).
Constants§
- SPP_
UUID - The UUID for the well-known SPP profile.
Functions§
- get_
bonded_ devices - Gets a list of
BluetoothDevice
objects that are bonded (paired) to the adapter.is_enabled()
is checked at first; returns an empty list if it is not enabled. - is_
enabled - Return true if Bluetooth is currently enabled and ready for use.
It may return an error of
std::io::ErrorKind::PermissionDenied
, or some other error.