Struct sl4f_lib::bluetooth::avdtp_facade::AvdtpFacade
source · pub struct AvdtpFacade { /* private fields */ }
Implementations§
source§impl AvdtpFacade
impl AvdtpFacade
Perform Bluetooth AVDTP fucntions for both Sink and Source.
Note this object is shared among all threads created by server.
pub fn new() -> AvdtpFacade
sourcepub async fn init_avdtp_service_proxy(
&self,
initiator_delay: Option<String>
) -> Result<(), Error>
pub async fn init_avdtp_service_proxy( &self, initiator_delay: Option<String> ) -> Result<(), Error>
Initialize the Avdtp service and starts A2DP.
§Arguments
initiator_delay
: A String representing the stream initiator delay in milliseconds. This delay is used in our tests to determine the initiator when connecting. The device to initiate first becomes the initiator.
sourcepub async fn get_connected_peers(&self) -> Result<Vec<u64>, Error>
pub async fn get_connected_peers(&self) -> Result<Vec<u64>, Error>
Gets the currently connected peers.
sourcepub async fn set_configuration(&self, peer_id: u64) -> Result<(), Error>
pub async fn set_configuration(&self, peer_id: u64) -> Result<(), Error>
Initiate a stream configuration procedure for the input peer_id.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn get_configuration(&self, peer_id: u64) -> Result<(), Error>
pub async fn get_configuration(&self, peer_id: u64) -> Result<(), Error>
Initiate a procedure to get the configuration information of the peer stream for the input peer_id.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn get_capabilities(&self, peer_id: u64) -> Result<(), Error>
pub async fn get_capabilities(&self, peer_id: u64) -> Result<(), Error>
Initiate a procedure to get the capabilities for the input peer_id.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn get_all_capabilities(&self, peer_id: u64) -> Result<(), Error>
pub async fn get_all_capabilities(&self, peer_id: u64) -> Result<(), Error>
Initiate a procedure to get all the capabilities for the input peer_id.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn reconfigure_stream(&self, peer_id: u64) -> Result<(), Error>
pub async fn reconfigure_stream(&self, peer_id: u64) -> Result<(), Error>
Initiate a suspend request to the stream for the input peer_id. This command will not resume nor reconfigure the stream.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn suspend_stream(&self, peer_id: u64) -> Result<(), Error>
pub async fn suspend_stream(&self, peer_id: u64) -> Result<(), Error>
A “chained” set of procedures on the current stream for the input peer_id. SuspendStream() followed by ReconfigureStream(). Reconfigure() configures the stream that is currently open.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn suspend_and_reconfigure(&self, peer_id: u64) -> Result<(), Error>
pub async fn suspend_and_reconfigure(&self, peer_id: u64) -> Result<(), Error>
Initiate a procedure to get the capabilities for the input peer_id.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn release_stream(&self, peer_id: u64) -> Result<(), Error>
pub async fn release_stream(&self, peer_id: u64) -> Result<(), Error>
Release the current stream that is owned by the input peer_id. If the streaming channel doesn’t exist, no action will be taken.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn establish_stream(&self, peer_id: u64) -> Result<(), Error>
pub async fn establish_stream(&self, peer_id: u64) -> Result<(), Error>
Initiate stream establishment for the input peer_id.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn start_stream(&self, peer_id: u64) -> Result<(), Error>
pub async fn start_stream(&self, peer_id: u64) -> Result<(), Error>
Start stream for the input peer_id.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn abort_stream(&self, peer_id: u64) -> Result<(), Error>
pub async fn abort_stream(&self, peer_id: u64) -> Result<(), Error>
Abort stream for the input peer_id.
§Arguments
peer_id
: The peer id associated with the PeerController.
sourcepub async fn remove_service(&self)
pub async fn remove_service(&self)
A function to remove the profile service proxy and clear connected devices.