pub struct BtProfileComponent { /* private fields */ }
Expand description
Represents a Bluetooth profile-under-test in the test topology.
Provides helpers designed to observe what the real profile implementation is doing.
Provides access to any capabilities that have been exposed by this profile.
Note: Only capabilities that are specified in the expose_capabilities
field of the
PiconetHarness::add_profile_with_capabilities() method will be available for connection.
Implementations§
Source§impl BtProfileComponent
impl BtProfileComponent
pub fn new(stream: PeerObserverRequestStream, id: PeerId) -> Self
pub fn peer_id(&self) -> PeerId
Sourcepub fn connect_to_protocol<S: DiscoverableProtocolMarker>(
&self,
topology: &RealmInstance,
) -> Result<S::Proxy, Error>
pub fn connect_to_protocol<S: DiscoverableProtocolMarker>( &self, topology: &RealmInstance, ) -> Result<S::Proxy, Error>
Connects to the protocol S
provided by this Profile. Returns the client end on success,
Error if the capability is not available.
Sourcepub async fn expect_observer_request(
&mut self,
) -> Result<PeerObserverRequest, Error>
pub async fn expect_observer_request( &mut self, ) -> Result<PeerObserverRequest, Error>
Expects a request over the PeerObserver
protocol for this MockPeer.
Returns the request if successful.
Sourcepub async fn expect_observer_connection_request(
&mut self,
other: PeerId,
) -> Result<(), Error>
pub async fn expect_observer_connection_request( &mut self, other: PeerId, ) -> Result<(), Error>
Expects a connection request between the profile under test and the other
peer.
Returns Ok on success, Error if there was no connection request on the observer or the request was for a different peer.
Sourcepub async fn expect_observer_service_found_request(
&mut self,
other: PeerId,
) -> Result<(), Error>
pub async fn expect_observer_service_found_request( &mut self, other: PeerId, ) -> Result<(), Error>
Expects the profile under test to discover the services of the other
peer.
Returns Ok on success, Error if there was no ServiceFound request on the observer or the request was for a different peer.