Struct bluetooth::BluetoothManager
source · pub struct BluetoothManager {
pub(crate) receiver: IpcReceiver<BluetoothRequest>,
pub(crate) adapter: Option<BluetoothAdapter>,
pub(crate) address_to_id: HashMap<String, String>,
pub(crate) service_to_device: HashMap<String, String>,
pub(crate) characteristic_to_service: HashMap<String, String>,
pub(crate) descriptor_to_characteristic: HashMap<String, String>,
pub(crate) cached_devices: HashMap<String, BluetoothDevice>,
pub(crate) cached_services: HashMap<String, BluetoothGATTService>,
pub(crate) cached_characteristics: HashMap<String, BluetoothGATTCharacteristic>,
pub(crate) cached_descriptors: HashMap<String, BluetoothGATTDescriptor>,
pub(crate) allowed_services: HashMap<String, HashSet<String>>,
pub(crate) embedder_proxy: EmbedderProxy,
}
Fields§
§receiver: IpcReceiver<BluetoothRequest>
§adapter: Option<BluetoothAdapter>
§address_to_id: HashMap<String, String>
§service_to_device: HashMap<String, String>
§characteristic_to_service: HashMap<String, String>
§descriptor_to_characteristic: HashMap<String, String>
§cached_devices: HashMap<String, BluetoothDevice>
§cached_services: HashMap<String, BluetoothGATTService>
§cached_characteristics: HashMap<String, BluetoothGATTCharacteristic>
§cached_descriptors: HashMap<String, BluetoothGATTDescriptor>
§allowed_services: HashMap<String, HashSet<String>>
§embedder_proxy: EmbedderProxy
Implementations§
source§impl BluetoothManager
impl BluetoothManager
pub fn new( receiver: IpcReceiver<BluetoothRequest>, adapter: Option<BluetoothAdapter>, embedder_proxy: EmbedderProxy, ) -> BluetoothManager
pub(crate) fn start(&mut self)
pub(crate) fn test(&mut self, data_set_name: String) -> BluetoothResult<()>
pub(crate) fn remove_ids_from_caches( &mut self, service_ids: Vec<String>, characteristic_ids: Vec<String>, descriptor_ids: Vec<String>, )
pub fn get_or_create_adapter(&mut self) -> Option<BluetoothAdapter>
pub(crate) fn get_adapter(&mut self) -> BluetoothResult<BluetoothAdapter>
pub(crate) fn get_and_cache_devices( &mut self, adapter: &mut BluetoothAdapter, ) -> Vec<BluetoothDevice>
pub(crate) fn get_device( &mut self, adapter: &mut BluetoothAdapter, device_id: &str, ) -> Option<&BluetoothDevice>
pub(crate) fn select_device( &mut self, devices: Vec<BluetoothDevice>, adapter: &BluetoothAdapter, ) -> Option<String>
pub(crate) fn generate_device_id(&mut self) -> String
pub(crate) fn device_from_service_id( &self, service_id: &str, ) -> Option<BluetoothDevice>
pub(crate) fn device_is_cached(&self, device_id: &str) -> bool
pub(crate) fn device_matches_filter( &mut self, device_id: &str, filters: &BluetoothScanfilterSequence, ) -> BluetoothResult<bool>
pub(crate) fn get_and_cache_gatt_services( &mut self, adapter: &mut BluetoothAdapter, device_id: &str, ) -> Vec<BluetoothGATTService>
pub(crate) fn get_gatt_service( &mut self, adapter: &mut BluetoothAdapter, service_id: &str, ) -> Option<&BluetoothGATTService>
pub(crate) fn service_is_cached(&self, service_id: &str) -> bool
pub(crate) fn get_and_cache_gatt_characteristics( &mut self, adapter: &mut BluetoothAdapter, service_id: &str, ) -> Vec<BluetoothGATTCharacteristic>
pub(crate) fn get_gatt_characteristic( &mut self, adapter: &mut BluetoothAdapter, characteristic_id: &str, ) -> Option<&BluetoothGATTCharacteristic>
pub(crate) fn get_characteristic_properties( &self, characteristic: &BluetoothGATTCharacteristic, ) -> Flags
pub(crate) fn characteristic_is_cached(&self, characteristic_id: &str) -> bool
pub(crate) fn get_and_cache_gatt_descriptors( &mut self, adapter: &mut BluetoothAdapter, characteristic_id: &str, ) -> Vec<BluetoothGATTDescriptor>
pub(crate) fn get_gatt_descriptor( &mut self, adapter: &mut BluetoothAdapter, descriptor_id: &str, ) -> Option<&BluetoothGATTDescriptor>
pub(crate) fn request_device( &mut self, options: RequestDeviceoptions, ) -> BluetoothResponseResult
pub(crate) fn gatt_server_connect( &mut self, device_id: String, ) -> BluetoothResponseResult
pub(crate) fn gatt_server_disconnect( &mut self, device_id: String, ) -> BluetoothResult<()>
pub(crate) fn get_gatt_children( &mut self, id: String, uuid: Option<String>, single: bool, child_type: GATTType, ) -> BluetoothResponseResult
pub(crate) fn read_value(&mut self, id: String) -> BluetoothResponseResult
pub(crate) fn write_value( &mut self, id: String, value: Vec<u8>, ) -> BluetoothResponseResult
pub(crate) fn enable_notification( &mut self, id: String, enable: bool, ) -> BluetoothResponseResult
pub(crate) fn watch_advertisements( &mut self, _device_id: String, ) -> BluetoothResponseResult
pub(crate) fn get_availability(&mut self) -> BluetoothResponseResult
Auto Trait Implementations§
impl !Freeze for BluetoothManager
impl !RefUnwindSafe for BluetoothManager
impl Send for BluetoothManager
impl !Sync for BluetoothManager
impl Unpin for BluetoothManager
impl !UnwindSafe for BluetoothManager
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