pub struct EmulatorProxy { /* private fields */ }
Implementations§
Source§impl EmulatorProxy
impl EmulatorProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.bluetooth/Emulator.
Sourcepub fn take_event_stream(&self) -> EmulatorEventStream
pub fn take_event_stream(&self) -> EmulatorEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn publish(
&self,
payload: &EmulatorSettings,
) -> QueryResponseFut<EmulatorPublishResult, DefaultFuchsiaResourceDialect>
pub fn publish( &self, payload: &EmulatorSettings, ) -> QueryResponseFut<EmulatorPublishResult, DefaultFuchsiaResourceDialect>
Publish a bt-hci device using the provided settings
. Each Emulator instance can only
manage a single bt-hci device. Returns Emulator.HCI_ALREADY_PUBLISHED
if the device has
already been published.
Sourcepub fn add_low_energy_peer(
&self,
payload: PeerParameters,
) -> QueryResponseFut<EmulatorAddLowEnergyPeerResult, DefaultFuchsiaResourceDialect>
pub fn add_low_energy_peer( &self, payload: PeerParameters, ) -> QueryResponseFut<EmulatorAddLowEnergyPeerResult, DefaultFuchsiaResourceDialect>
Inserts a new LE peer device to be emulated by this controller. Once registered, the state
of the fake peer can be driven and observed using the peer
handle.
A reply will be sent to acknowledge the creation of the fake peer. If a peer cannot be
initialized (e.g. due to a missing required field in parameters
or for containing an
address that is already emulated) the peer
handle will be closed and an error reply will
be sent.
The peer will appear in advertising reports and respond to requests according to its
configuration as long as the peer
channel is open. The emulator stops emulating this peer
when the channel gets closed, which makes it no longer discoverable and not respond to any
requests.
Sourcepub fn add_bredr_peer(
&self,
payload: PeerParameters,
) -> QueryResponseFut<EmulatorAddBredrPeerResult, DefaultFuchsiaResourceDialect>
pub fn add_bredr_peer( &self, payload: PeerParameters, ) -> QueryResponseFut<EmulatorAddBredrPeerResult, DefaultFuchsiaResourceDialect>
Inserts a new BR/EDR peer device to be emulated by this controller. Once registered, the state
of the fake peer can be driven and observed using the peer
handle.
A reply will be sent to acknowledge the creation of the fake peer. If a peer cannot be
initialized (e.g. due to a missing required field in parameters
or for containing an
address that is already emulated) the peer
handle will be closed and an error reply will
be sent.
The peer will appear in inquiry results and respond to requests according to its
configuration as long as the peer
channel is open. The emulator stops emulating this peer
when the channel gets closed, which makes it no longer discoverable and not respond to any
requests.
Sourcepub fn watch_controller_parameters(
&self,
) -> QueryResponseFut<ControllerParameters, DefaultFuchsiaResourceDialect>
pub fn watch_controller_parameters( &self, ) -> QueryResponseFut<ControllerParameters, DefaultFuchsiaResourceDialect>
Hanging get pattern for the controller parameter state will not resolve until the state has changed from the last response.
Sourcepub fn watch_le_scan_states(
&self,
) -> QueryResponseFut<Vec<LeScanState>, DefaultFuchsiaResourceDialect>
pub fn watch_le_scan_states( &self, ) -> QueryResponseFut<Vec<LeScanState>, DefaultFuchsiaResourceDialect>
Returns a vector of the least to most recent states for the link layer LE scan procedure. This method returns when there has been at least one state change since the last invocation of this method by this client.
Multiple calls to this method can be outstanding at a given time. All calls will resolve in a response as soon as there is a change to the scan state.
Sourcepub fn watch_legacy_advertising_states(
&self,
) -> QueryResponseFut<Vec<LegacyAdvertisingState>, DefaultFuchsiaResourceDialect>
pub fn watch_legacy_advertising_states( &self, ) -> QueryResponseFut<Vec<LegacyAdvertisingState>, DefaultFuchsiaResourceDialect>
Returns a vector of the least to most recent states for the link layer LE legacy advertising procedure. This method returns when there has been at least one state change since the last invocation of this method by this client.
Multiple calls to this method can be outstanding at a given time. All calls will resolve in a response as soon as there is a change to the scan state.
Trait Implementations§
Source§impl Clone for EmulatorProxy
impl Clone for EmulatorProxy
Source§fn clone(&self) -> EmulatorProxy
fn clone(&self) -> EmulatorProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EmulatorProxy
impl Debug for EmulatorProxy
Source§impl EmulatorProxyInterface for EmulatorProxy
impl EmulatorProxyInterface for EmulatorProxy
type PublishResponseFut = QueryResponseFut<Result<(), EmulatorError>>
type AddLowEnergyPeerResponseFut = QueryResponseFut<Result<(), EmulatorPeerError>>
type AddBredrPeerResponseFut = QueryResponseFut<Result<(), EmulatorPeerError>>
type WatchControllerParametersResponseFut = QueryResponseFut<ControllerParameters>
type WatchLeScanStatesResponseFut = QueryResponseFut<Vec<LeScanState>>
type WatchLegacyAdvertisingStatesResponseFut = QueryResponseFut<Vec<LegacyAdvertisingState>>
fn publish(&self, payload: &EmulatorSettings) -> Self::PublishResponseFut
fn add_low_energy_peer( &self, payload: PeerParameters, ) -> Self::AddLowEnergyPeerResponseFut
fn add_bredr_peer( &self, payload: PeerParameters, ) -> Self::AddBredrPeerResponseFut
fn watch_controller_parameters( &self, ) -> Self::WatchControllerParametersResponseFut
fn watch_le_scan_states(&self) -> Self::WatchLeScanStatesResponseFut
fn watch_legacy_advertising_states( &self, ) -> Self::WatchLegacyAdvertisingStatesResponseFut
Source§impl Proxy for EmulatorProxy
impl Proxy for EmulatorProxy
Source§type Protocol = EmulatorMarker
type Protocol = EmulatorMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for EmulatorProxy
impl !RefUnwindSafe for EmulatorProxy
impl Send for EmulatorProxy
impl Sync for EmulatorProxy
impl Unpin for EmulatorProxy
impl !UnwindSafe for EmulatorProxy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)