pub struct AvcPeer { /* private fields */ }
Expand description
Represents a peer connection to a remote device that uses the AV\C protocol over AVCTP encoded L2CAP socket. Primarily used for the the control channel in AVRCP.
Implementations§
Source§impl Peer
impl Peer
Sourcepub fn new(channel: Channel) -> Self
pub fn new(channel: Channel) -> Self
Create a new peer object from a established L2CAP socket with the peer.
Sourcepub fn take_command_stream(&self) -> CommandStream
pub fn take_command_stream(&self) -> CommandStream
Takes the command stream for incoming commands from the remote peer.
Sourcepub fn send_vendor_dependent_command<'a>(
&'a self,
command_type: CommandType,
payload: &'a [u8],
) -> Result<impl Stream<Item = Result<CommandResponse, Error>>, Error>
pub fn send_vendor_dependent_command<'a>( &'a self, command_type: CommandType, payload: &'a [u8], ) -> Result<impl Stream<Item = Result<CommandResponse, Error>>, Error>
Sends a vendor specific command to the remote peer. Returns a CommandResponseStream to poll for the responses to the sent command. Returns error if the underlying socket is closed.
Sourcepub async fn send_avc_passthrough_command<'a>(
&'a self,
payload: &'a [u8],
) -> Result<CommandResponse, Error>
pub async fn send_avc_passthrough_command<'a>( &'a self, payload: &'a [u8], ) -> Result<CommandResponse, Error>
Sends an AVC passthrough command to the remote peer. Returns the command response ignoring any interim responses. Returns error if the underlying socket is closed or the command isn’t acknowledged with an interim response after 1000 ms.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Peer
impl !RefUnwindSafe for Peer
impl Send for Peer
impl Sync for Peer
impl Unpin for Peer
impl !UnwindSafe for Peer
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
Mutably borrows from an owned value. Read more