pub struct BluetoothSysFacade { /* private fields */ }

Implementations§

source§

impl BluetoothSysFacade

Perform Bluetooth Access operations.

Note this object is shared among all threads created by server.

source

pub fn new() -> BluetoothSysFacade

source

pub fn init_proxies(&self) -> Result<(), Error>

source

pub async fn monitor_pairing_delegate_request_stream( stream: PairingDelegateRequestStream, pin_receiver: Receiver<String>, pin_sender: Sender<String> ) -> Result<(), Error>

source

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, KEYBOARD
  • output - A String representing the output capability Available values: NONE, DISPLAY
source

pub async fn init_access_proxy(&self) -> Result<(), Error>

Sets an access proxy to use if one is not already in use.

source

pub async fn input_pairing_pin(&self, pin: String) -> Result<(), Error>

source

pub async fn get_pairing_pin(&self) -> Result<String, Error>

source

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.
source

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.
source

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.
source

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.

source

pub async fn forget(&self, id: u64) -> Result<(), Error>

Forgets (Unbonds) an input device ID.

§Arguments
  • id - A u64 representing the device ID.
source

pub async fn connect(&self, id: u64) -> Result<(), Error>

Connects over BR/EDR to an input device ID.

§Arguments
  • id - A u64 representing the device ID.
source

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/EDR
  • bondable - 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
source

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.
source

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.
source

pub async fn get_active_adapter_address(&self) -> Result<String, Error>

Returns the current Active Adapter’s Address.

source

pub fn cleanup(&self)

Cleans up objects in use.

source

pub fn print(&self)

Prints useful information.

Trait Implementations§

source§

impl Debug for BluetoothSysFacade

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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,

Asynchronously handle the incoming request for the given method and arguments, returning a future object representing the pending operation.
source§

fn cleanup(&self)

In response to a request to /cleanup, cleanup any cross-request state.
source§

fn print(&self)

In response to a request to /print, log relevant facade state.

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> DebugExt for T
where T: Debug,

source§

fn debug(&self) -> String

source§

impl<T> Encode<Ambiguous1> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> Encode<Ambiguous2> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Cast the given object into a dyn std::any::Any.
source§

impl<T, U> IntoExt<U> for T
where U: FromExt<T>,

source§

fn into_ext(self) -> U

Performs the conversion.
source§

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

source§

const PRESENT: Presence<Self> = _

source§

const ABSENT: Presence<Self> = _

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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<T, U> TryIntoExt<U> for T
where U: TryFromExt<T>,

§

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

source§

fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>

Tries to perform the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<St> WithTag for St

source§

fn tagged<T>(self, tag: T) -> Tagged<T, St>

Produce a new stream from this one which yields item tupled with a constant tag