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) -> Result<(), Error>
pub async fn init_avdtp_service_proxy(&self) -> Result<(), Error>
Initialize the Avdtp service and starts A2DP.
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.