Struct test_call_manager::TestCallManager
source · pub struct TestCallManager { /* private fields */ }
Implementations§
source§impl TestCallManager
impl TestCallManager
Perform Bluetooth HFP functions by acting as the call manager (client) side of the fuchsia.bluetooth.hfp.Hfp protocol.
pub fn new() -> TestCallManager
pub async fn set_request_stream(&self, stream: CallManagerRequestStream)
pub async fn register_manager(&self, proxy: HfpProxy) -> Result<(), Error>
sourcepub async fn init_hfp_service(&self) -> Result<(), Error>
pub async fn init_hfp_service(&self) -> Result<(), Error>
Initialize the HFP service.
sourcepub async fn list_calls(&self) -> Result<Vec<(u64, String)>, Error>
pub async fn list_calls(&self) -> Result<Vec<(u64, String)>, Error>
Return a list of Calls by call id and remote number.
sourcepub async fn new_call(
&self,
remote: &str,
fidl_state: FidlCallState,
direction: CallDirection,
) -> Result<u64, Error>
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.
sourcepub async fn incoming_ringing_call(&self, remote: &str) -> Result<u64, Error>
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).
sourcepub async fn incoming_waiting_call(&self, remote: &str) -> Result<u64, Error>
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).
sourcepub async fn outgoing_call(&self, remote: &str) -> Result<u64, Error>
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).
sourcepub async fn set_call_active(&self, call_id: u64) -> Result<(), Error>
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.
sourcepub async fn set_call_held(&self, call_id: u64) -> Result<(), Error>
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.
sourcepub async fn set_call_terminated(&self, call_id: u64) -> Result<(), Error>
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.
sourcepub async fn set_call_transferred_to_ag(
&self,
call_id: u64,
) -> Result<(), Error>
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.
sourcepub async fn list_peers(&self) -> Result<Vec<(u64, bool)>, Error>
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.
sourcepub async fn set_active_peer(&self, id: u64) -> Result<(), Error>
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.
sourcepub async fn set_speaker_gain(&self, value: u64) -> Result<(), Error>
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.
sourcepub async fn set_microphone_gain(&self, value: u64) -> Result<(), Error>
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.
sourcepub async fn update_network_information(
&self,
network: NetworkInformation,
) -> Result<(), Error>
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.
pub async fn set_subscriber_number(&self, number: &str)
pub async fn set_operator(&self, value: &str)
pub async fn set_nrec_support(&self, value: bool)
pub async fn set_battery_level(&self, value: u64) -> Result<(), Error>
pub async fn get_state(&self) -> StateSer
sourcepub async fn set_last_dialed(&self, number: Option<String>)
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
.
sourcepub async fn set_memory_location(
&self,
location: String,
number: Option<String>,
)
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
.
sourcepub async fn set_dial_result(&self, number: String, status: Status)
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
.
sourcepub async fn set_connection_behavior(
&self,
autoconnect: bool,
) -> Result<(), Error>
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.
Trait Implementations§
source§impl Clone for TestCallManager
impl Clone for TestCallManager
source§fn clone(&self) -> TestCallManager
fn clone(&self) -> TestCallManager
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for TestCallManager
impl !RefUnwindSafe for TestCallManager
impl Send for TestCallManager
impl Sync for TestCallManager
impl Unpin for TestCallManager
impl !UnwindSafe for TestCallManager
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)