Struct TestCallManager

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

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,

Source§

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

Source§

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

Source§

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