pub struct AccessProxy { /* private fields */ }

Implementations§

source§

impl AccessProxy

source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for fuchsia.bluetooth.sys/Access.

source

pub fn take_event_stream(&self) -> AccessEventStream

Get a Stream of events from the remote end of the protocol.

§Panics

Panics if the event stream was already taken.

source

pub fn set_pairing_delegate( &self, input: InputCapability, output: OutputCapability, delegate: ClientEnd<PairingDelegateMarker> ) -> Result<(), Error>

Assign a PairingDelegate to respond to drive pairing procedures. The delegate will be configured to use the provided I/O capabilities to determine the pairing method.

Only one PairingDelegate can be registered at a time. Closing a PairingDelegate aborts all on-going pairing procedures associated with a delegate and closes the PairingDelegate previously assigned for this Access instance.

  • request input Bluetooth input capability
  • request output Bluetooth output capability
  • request delegate The client end of a PairingDelegate channel.
§Deprecation - This method is folded into the fuchsia.bluetooth.sys/Pairing protocol. See

https://fxbug.dev/42180744 for more details on the migration.

source

pub fn set_local_name(&self, name: &str) -> Result<(), Error>

Assign a local name for the Bluetooth system. This name will be visible to nearby peers when the system is in discoverable mode and during name discovery procedures.

  • request name The complete local name to assign to the system.
source

pub fn set_device_class(&self, device_class: &DeviceClass) -> Result<(), Error>

Set the local device class that will be visible to nearby peers when the system is in discoverable mode.

  • request device_class The device class to assign to the system.
source

pub fn make_discoverable( &self, token: ServerEnd<ProcedureTokenMarker> ) -> QueryResponseFut<AccessMakeDiscoverableResult>

Put the system into the “General Discoverable” mode on the BR/EDR transport. The active host will respond to general inquiry (by regularly entering the inquiry scan mode).

  • request token [fuchsia.bluetooth.sys/ProcedureToken] that will remain valid while a discoverable mode session is active. NOTE: The system may remain discoverable until all [fuchsia.bluetooth.sys/Access] clients drop their tokens.
  • error Reports Error.FAILED if inquiry mode cannot be entered.
source

pub fn start_discovery( &self, token: ServerEnd<ProcedureTokenMarker> ) -> QueryResponseFut<AccessStartDiscoveryResult>

Start a general discovery procedure. All general discoverable BR/EDR, LE, and BR/EDR/LE devices will appear in the peer list, which can be observed by calling [fuchsia.bluetooth.sys/Access.WatchPeers].

  • request token [fuchsia.bluetooth.sys/ProcedureToken] that will remain valid while discovery is in progress. NOTE: The radio will continue performing discovery until all [fuchsia.bluetooth.sys/Access] drop their tokens.
  • error Reports Error.FAILED if discovery on either transport cannot be initiated.
source

pub fn watch_peers(&self) -> QueryResponseFut<(Vec<Peer>, Vec<PeerId>)>

Returns a list of all peers (connectable Bluetooth devices) known to the system. The first call results in a snapshot of all known peers to be sent immediately in the updated return paremeter. Subsequent calls receive a response only when one or more entries have been added, modified, or removed from the entries reported since the most recent call.

  • response updated Peers that were added or updated since the last call to WatchPeers().
  • response removed Ids of peers that were removed since the last call to WatchPeers().
source

pub fn connect(&self, id: &PeerId) -> QueryResponseFut<AccessConnectResult>

Initiate a connection to the peer with the given id. This method connects both BR/EDR and LE transports depending on the technologies that the peer is known to support.

  • request id The id of the peer to connect.
  • error Reports Error.FAILED if a connection to the peer cannot be initiated.
  • error Reports Error.PEER_NOT_FOUND if id is not recognized.
source

pub fn disconnect( &self, id: &PeerId ) -> QueryResponseFut<AccessDisconnectResult>

Disconnect all logical links to the peer with the given id. This includes LE and BR/EDR links that have been initiated using all Access and fuchsia.bluetooth.le protocol instances.

  • request id The id of the peer to disconnect.
  • error Reports Error.PEER_NOT_FOUND if id is not recognized.
source

pub fn pair( &self, id: &PeerId, options: &PairingOptions ) -> QueryResponseFut<AccessPairResult>

Initiate a pairing to the remote id with the given options. This call completes only once the pairing procedure has completed or aborted. Returns an error if no connected peer with id is found or the pairing procedure fails. If the named peer is already paired, this returns immediately with a success value - unless the pairing is over LE and the PairingOptions.le_security_level is more secure than the current security level, in which case we will attempt to raise security to the requested level.

Pairing will take place over whichever transport is indicated by options.transport. If that transport isn’t currently connected, the pairing will fail with Error.PEER_NOT_FOUND. Currently, if DUAL_MODE is requested, we will attempt to pair over the LE transport.

  • request id The id of the peer to initiate pairing with
  • request options The configuration options to use for this pairing request
  • error Reports Error.PEER_NOT_FOUND if id is not recognized, or the peer is not connected on the requested transport.
  • error Reports Error.INVALID_ARGUMENTS if ill-formed options are passed
  • error Reports Error.FAILED if an error occurs during pairing
source

pub fn forget(&self, id: &PeerId) -> QueryResponseFut<AccessForgetResult>

Removes all bonding information and disconnects any existing links with the peer with the given id.

  • request id The id of the peer to forget.
  • error Reports Error.PEER_NOT_FOUND if id is not recognized.

Trait Implementations§

source§

impl AccessProxyInterface for AccessProxy

source§

fn set_pairing_delegate( &self, input: InputCapability, output: OutputCapability, delegate: ClientEnd<PairingDelegateMarker> ) -> Result<(), Error>

source§

fn set_local_name(&self, name: &str) -> Result<(), Error>

source§

fn set_device_class(&self, device_class: &DeviceClass) -> Result<(), Error>

§

type MakeDiscoverableResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn make_discoverable( &self, token: ServerEnd<ProcedureTokenMarker> ) -> Self::MakeDiscoverableResponseFut

§

type StartDiscoveryResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn start_discovery( &self, token: ServerEnd<ProcedureTokenMarker> ) -> Self::StartDiscoveryResponseFut

§

type WatchPeersResponseFut = QueryResponseFut<(Vec<Peer>, Vec<PeerId>)>

source§

fn watch_peers(&self) -> Self::WatchPeersResponseFut

§

type ConnectResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn connect(&self, id: &PeerId) -> Self::ConnectResponseFut

§

type DisconnectResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn disconnect(&self, id: &PeerId) -> Self::DisconnectResponseFut

§

type PairResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn pair(&self, id: &PeerId, options: &PairingOptions) -> Self::PairResponseFut

§

type ForgetResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn forget(&self, id: &PeerId) -> Self::ForgetResponseFut

source§

impl Clone for AccessProxy

source§

fn clone(&self) -> AccessProxy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AccessProxy

source§

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

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

impl Proxy for AccessProxy

§

type Protocol = AccessMarker

The protocol which this Proxy controls.
source§

fn from_channel(inner: AsyncChannel) -> Self

Create a proxy over the given channel.
source§

fn into_channel(self) -> Result<AsyncChannel, Self>

Attempt to convert the proxy back into a channel. Read more
source§

fn as_channel(&self) -> &AsyncChannel

Get a reference to the proxy’s underlying channel. Read more
§

fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>

Attempt to convert the proxy back into a client end. Read more
§

fn is_closed(&self) -> bool

Returns true if the proxy has received the PEER_CLOSED signal.
§

fn on_closed(&self) -> OnSignals<'_>

Returns a future that completes when the proxy receives the PEER_CLOSED signal.

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
§

impl<T> Encode<Ambiguous1> for T

§

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
§

impl<T> Encode<Ambiguous2> for T

§

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> 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
§

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