pub struct TestCallManager { /* private fields */ }

Implementations§

source§

impl TestCallManager

Perform Bluetooth HFP functions by acting as the call manager (client) side of the fuchsia.bluetooth.hfp.Hfp protocol.

source

pub fn new() -> TestCallManager

source

pub async fn set_request_stream(&self, stream: CallManagerRequestStream)

source

pub async fn register_manager(&self, proxy: HfpProxy) -> Result<(), Error>

source

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

Initialize the HFP service.

source

pub async fn list_calls(&self) -> Result<Vec<(u64, String)>, Error>

Return a list of Calls by call id and remote number.

source

pub async fn new_call( &self, remote: &str, fidl_state: FidlCallState, direction: CallDirection ) -> Result<u64, Error>

Notify HFP of an ongoing call. Simulates a new call from the network in the “incoming ringing” state.

Arguments: remote: The number associated with the remote party. This can be any string formatted number (e.g. +1-555-555-5555). fidl_state: The state to assign to the newly created call.

source

pub async fn incoming_ringing_call(&self, remote: &str) -> Result<u64, Error>

Notify HFP of an incoming call. Simulates a new call from the network in the “incoming ringing” state.

Arguments: remote: The number associated with the remote party. This can be any string formatted number (e.g. +1-555-555-5555).

source

pub async fn incoming_waiting_call(&self, remote: &str) -> Result<u64, Error>

Notify HFP of an incoming waiting call. Simulates a new call from the network in the “incoming waiting” state.

Arguments: remote: The number associated with the remote party. This can be any string formatted number (e.g. +1-555-555-5555).

source

pub async fn outgoing_call(&self, remote: &str) -> Result<u64, Error>

Notify HFP of an outgoing call. Simulates a new call to the network in the “outgoing notifying” state.

Arguments: remote: The number associated with the remote party. This can be any string formatted number (e.g. +1-555-555-5555).

source

pub async fn set_call_active(&self, call_id: u64) -> Result<(), Error>

Notify HFP that a call is now active.

Arguments: call_id: The unique id of the call as assigned by the call manager.

source

pub async fn set_call_held(&self, call_id: u64) -> Result<(), Error>

Notify HFP that a call is now held.

Arguments: call_id: The unique id of the call as assigned by the call manager.

source

pub async fn set_call_terminated(&self, call_id: u64) -> Result<(), Error>

Notify HFP that a call is now terminated.

Arguments: call_id: The unique id of the call as assigned by the call manager.

source

pub async fn set_call_transferred_to_ag( &self, call_id: u64 ) -> Result<(), Error>

Notify HFP that a call’s audio is now transferred to the Audio Gateway.

Arguments: call_id: The unique id of the call as assigned by the call manager.

source

pub async fn list_peers(&self) -> Result<Vec<(u64, bool)>, Error>

Return a list of HFP peers along with a boolean specifying whether each peer is the “active” peer.

source

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

Set the active peer with the provided id. All future commands will be directed towards that peer.

Arguments: id: The unique id for the peer that initiated the request.

source

pub async fn set_speaker_gain(&self, value: u64) -> Result<(), Error>

Request that the active peer’s speaker gain be set to value.

Arguments: value: must be between 0-15 inclusive.

source

pub async fn set_microphone_gain(&self, value: u64) -> Result<(), Error>

Request that the active peer’s microphone gain be set to value.

Arguments: value: must be between 0-15 inclusive.

source

pub async fn update_network_information( &self, network: NetworkInformation ) -> Result<(), Error>

Update the facade’s network information with the provided network. Any fields in network that are None will not be updated.

Arguments: network: The updated network information fields.

source

pub async fn set_subscriber_number(&self, number: &str)

source

pub async fn set_operator(&self, value: &str)

source

pub async fn set_nrec_support(&self, value: bool)

source

pub async fn set_battery_level(&self, value: u64) -> Result<(), Error>

source

pub async fn get_state(&self) -> StateSer

source

pub async fn set_last_dialed(&self, number: Option<String>)

Set the simulated “last dialed” number.

Arguments: number: Number to be set. To clear the last dialed number, set number to None.

source

pub async fn set_memory_location( &self, location: String, number: Option<String> )

Store a number at a specific location in address book memory.

Arguments: location: The key used to look up a specific number in address book memory. number: Number to be set. To remove the address book entry, set number to None.

source

pub async fn set_dial_result(&self, number: String, status: Status)

Set the simulated result that will be returned after HFP requests an outgoing call. This result is used regardless of whether a number was specified directly through CallAction::dial_from_number or indirectly through either CallAction::dial_from_location or CallAction::redial_last.

Arguments: number: Number that maps to a simulated result. status: The simulated result value for number.

source

pub async fn set_connection_behavior( &self, autoconnect: bool ) -> Result<(), Error>

Configure the connection behavior when the component receives new search results from the bredr.Profile protocol.

Arguments: autoconnect: determine whether the component should automatically attempt to make a new RFCOMM connection.

source

pub async fn cleanup(&self)

Cleanup any HFP related objects.

Trait Implementations§

source§

impl Clone for TestCallManager

source§

fn clone(&self) -> TestCallManager

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 TestCallManager

source§

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

Formats the value using the given formatter. Read more

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> IntoAny for T
where T: 'static + Send + Sync,

§

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

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

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<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
§

impl<St> WithTag for St

§

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

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