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

source

pub fn new( receiver: IpcReceiver<BluetoothRequest>, adapter: Option<BluetoothAdapter>, embedder_proxy: EmbedderProxy, ) -> BluetoothManager

source

pub(crate) fn start(&mut self)

source

pub(crate) fn test(&mut self, data_set_name: String) -> BluetoothResult<()>

source

pub(crate) fn remove_ids_from_caches( &mut self, service_ids: Vec<String>, characteristic_ids: Vec<String>, descriptor_ids: Vec<String>, )

source

pub fn get_or_create_adapter(&mut self) -> Option<BluetoothAdapter>

source

pub(crate) fn get_adapter(&mut self) -> BluetoothResult<BluetoothAdapter>

source

pub(crate) fn get_and_cache_devices( &mut self, adapter: &mut BluetoothAdapter, ) -> Vec<BluetoothDevice>

source

pub(crate) fn get_device( &mut self, adapter: &mut BluetoothAdapter, device_id: &str, ) -> Option<&BluetoothDevice>

source

pub(crate) fn select_device( &mut self, devices: Vec<BluetoothDevice>, adapter: &BluetoothAdapter, ) -> Option<String>

source

pub(crate) fn generate_device_id(&mut self) -> String

source

pub(crate) fn device_from_service_id( &self, service_id: &str, ) -> Option<BluetoothDevice>

source

pub(crate) fn device_is_cached(&self, device_id: &str) -> bool

source

pub(crate) fn device_matches_filter( &mut self, device_id: &str, filters: &BluetoothScanfilterSequence, ) -> BluetoothResult<bool>

source

pub(crate) fn get_and_cache_gatt_services( &mut self, adapter: &mut BluetoothAdapter, device_id: &str, ) -> Vec<BluetoothGATTService>

source

pub(crate) fn get_gatt_service( &mut self, adapter: &mut BluetoothAdapter, service_id: &str, ) -> Option<&BluetoothGATTService>

source

pub(crate) fn service_is_cached(&self, service_id: &str) -> bool

source

pub(crate) fn get_and_cache_gatt_characteristics( &mut self, adapter: &mut BluetoothAdapter, service_id: &str, ) -> Vec<BluetoothGATTCharacteristic>

source

pub(crate) fn get_gatt_characteristic( &mut self, adapter: &mut BluetoothAdapter, characteristic_id: &str, ) -> Option<&BluetoothGATTCharacteristic>

source

pub(crate) fn get_characteristic_properties( &self, characteristic: &BluetoothGATTCharacteristic, ) -> Flags

source

pub(crate) fn characteristic_is_cached(&self, characteristic_id: &str) -> bool

source

pub(crate) fn get_and_cache_gatt_descriptors( &mut self, adapter: &mut BluetoothAdapter, characteristic_id: &str, ) -> Vec<BluetoothGATTDescriptor>

source

pub(crate) fn get_gatt_descriptor( &mut self, adapter: &mut BluetoothAdapter, descriptor_id: &str, ) -> Option<&BluetoothGATTDescriptor>

source

pub(crate) fn request_device( &mut self, options: RequestDeviceoptions, ) -> BluetoothResponseResult

source

pub(crate) fn gatt_server_connect( &mut self, device_id: String, ) -> BluetoothResponseResult

source

pub(crate) fn gatt_server_disconnect( &mut self, device_id: String, ) -> BluetoothResult<()>

source

pub(crate) fn get_gatt_children( &mut self, id: String, uuid: Option<String>, single: bool, child_type: GATTType, ) -> BluetoothResponseResult

source

pub(crate) fn read_value(&mut self, id: String) -> BluetoothResponseResult

source

pub(crate) fn write_value( &mut self, id: String, value: Vec<u8>, ) -> BluetoothResponseResult

source

pub(crate) fn enable_notification( &mut self, id: String, enable: bool, ) -> BluetoothResponseResult

source

pub(crate) fn watch_advertisements( &mut self, _device_id: String, ) -> BluetoothResponseResult

source

pub(crate) fn get_availability(&mut self) -> BluetoothResponseResult

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T