pub struct BluetoothSysFacade { /* private fields */ }
Implementations§
Source§impl BluetoothSysFacade
impl BluetoothSysFacade
Perform Bluetooth Access operations.
Note this object is shared among all threads created by server.
pub fn new() -> BluetoothSysFacade
pub fn init_proxies(&self) -> Result<(), Error>
pub async fn monitor_pairing_delegate_request_stream( stream: PairingDelegateRequestStream, pin_receiver: Receiver<String>, pin_sender: Sender<String>, ) -> Result<(), Error>
Sourcepub async fn accept_pairing(
&self,
input: &str,
output: &str,
) -> Result<(), Error>
pub async fn accept_pairing( &self, input: &str, output: &str, ) -> Result<(), Error>
Starts the pairing delegate with I/O Capabilities as required inputs.
§Arguments
input
- A String representing the input capability. Available values: NONE, CONFIRMATION, KEYBOARDoutput
- A String representing the output capability Available values: NONE, DISPLAY
Sourcepub async fn init_access_proxy(&self) -> Result<(), Error>
pub async fn init_access_proxy(&self) -> Result<(), Error>
Sets an access proxy to use if one is not already in use.
pub async fn input_pairing_pin(&self, pin: String) -> Result<(), Error>
pub async fn get_pairing_pin(&self) -> Result<String, Error>
Sourcepub async fn set_discoverable(&self, discoverable: bool) -> Result<(), Error>
pub async fn set_discoverable(&self, discoverable: bool) -> Result<(), Error>
Sets the current access proxy to be discoverable.
§Arguments
- ‘discoverable’ - A bool object for setting Bluetooth device discoverable or not.
Sourcepub async fn set_name(&self, name: String) -> Result<(), Error>
pub async fn set_name(&self, name: String) -> Result<(), Error>
Sets the current access proxy name.
§Arguments
- ‘name’ - A String object representing the name to set.
Sourcepub async fn start_discovery(&self, discovery: bool) -> Result<(), Error>
pub async fn start_discovery(&self, discovery: bool) -> Result<(), Error>
Starts discovery on the Bluetooth Access Proxy.
§Arguments
- ‘discovery’ - A bool representing starting and stopping discovery.
Sourcepub async fn get_known_remote_devices(
&self,
) -> Result<HashMap<u64, SerializablePeer>, Error>
pub async fn get_known_remote_devices( &self, ) -> Result<HashMap<u64, SerializablePeer>, Error>
Returns a hashmap of the known devices on the Bluetooth Access proxy.
Sourcepub async fn pair(
&self,
id: u64,
pairing_security_level_value: Option<u64>,
bondable: Option<bool>,
transport_value: u64,
) -> Result<(), Error>
pub async fn pair( &self, id: u64, pairing_security_level_value: Option<u64>, bondable: Option<bool>, transport_value: u64, ) -> Result<(), Error>
Sends an outgoing pairing request over BR/EDR or LE to an input device ID.
§Arguments
id
- A u64 representing the device ID.pairing_security_level_value
- The security level required for this pairing request represented as a u64. (Only for LE pairing) Available Values 1 - ENCRYPTED: Encrypted without MITM protection (unauthenticated) 2 - AUTHENTICATED: Encrypted with MITM protection (authenticated). None: Used for BR/EDRbondable
- A bool representing whether the pairing mode is bondable or not. None is also accepted. False if non bondable, True if bondable.transport_value
- A u64 representing the transport type. Available Values 1 - BREDR: Classic BR/EDR transport 2 - LE: Bluetooth Low Energy Transport
Sourcepub async fn disconnect(&self, id: u64) -> Result<(), Error>
pub async fn disconnect(&self, id: u64) -> Result<(), Error>
Disconnects an active BR/EDR connection by input device ID.
§Arguments
id
- A u64 representing the device ID.
Sourcepub async fn update_settings(&self, settings: Settings) -> Result<(), Error>
pub async fn update_settings(&self, settings: Settings) -> Result<(), Error>
Updates the configuration of the active host device
§Arguments
settings
- The table of settings. Any settings that are not present will not be changed.
Sourcepub async fn get_active_adapter_address(&self) -> Result<String, Error>
pub async fn get_active_adapter_address(&self) -> Result<String, Error>
Returns the current Active Adapter’s Address.
Trait Implementations§
Source§impl Debug for BluetoothSysFacade
impl Debug for BluetoothSysFacade
Source§impl Facade for BluetoothSysFacade
impl Facade for BluetoothSysFacade
Source§fn handle_request<'life0, 'async_trait>(
&'life0 self,
method: String,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_request<'life0, 'async_trait>(
&'life0 self,
method: String,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Asynchronously handle the incoming request for the given method and arguments, returning a
future object representing the pending operation.
Auto Trait Implementations§
impl !Freeze for BluetoothSysFacade
impl !RefUnwindSafe for BluetoothSysFacade
impl Send for BluetoothSysFacade
impl Sync for BluetoothSysFacade
impl Unpin for BluetoothSysFacade
impl !UnwindSafe for BluetoothSysFacade
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> OptionalField for Twhere
T: ?Sized,
impl<T> OptionalField for Twhere
T: ?Sized,
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
Source§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.