fn build_and_register_service(
        mock_peer: &mut MockPeer,
    ) -> (
        bredr::ConnectionReceiverRequestStream,
        impl Future<Output = ()>,
        HashSet<bredr::ServiceClassProfileIdentifier>,
    ) {
        // Build the A2DP Sink Service Definition.
        let (a2dp_def, _) = build_a2dp_service_definition(Psm::new(bredr::PSM_AVDTP));
        let mut expected_ids = HashSet::new();
        expected_ids.insert(bredr::ServiceClassProfileIdentifier::AudioSink);

        // Register the service.
        let (receiver, stream) =
            create_proxy_and_stream::<bredr::ConnectionReceiverMarker>().unwrap();
        let res = mock_peer.new_advertisement(vec![a2dp_def], receiver);
        assert!(res.is_ok());
        let (svc_ids, adv_fut) = res.unwrap();
        assert_eq!(expected_ids, svc_ids);

        (stream, adv_fut, svc_ids)
    }
/// Builds and registers an A2DP Sink service advertisement.
/// Returns 1) ServerEnd of the ConnectionReceiver that will be used to receive l2cap
/// connections, 2) A future that signals the termination of the service advertisement
/// and 3) The ServiceClassProfileIds that were registered.
Builds and registers an A2DP Sink service advertisement.
Returns 1) ServerEnd of the ConnectionReceiver that will be used to receive l2cap
connections, 2) A future that signals the termination of the service advertisement
and 3) The ServiceClassProfileIds that were registered.
Builds and registers an A2DP Sink service advertisement . Returns 1 ) ServerEnd of the ConnectionReceiver that will be used to receive l2cap connections 2 ) A future that signals the termination of the service advertisement and 3 ) The ServiceClassProfileIds that were registered .
fn build_and_register_service(
        mock_peer: &mut MockPeer,
    ) -> (
        bredr::ConnectionReceiverRequestStream,
        impl Future<Output = ()>,
        HashSet<bredr::ServiceClassProfileIdentifier>,
    ) {
        // Build the A2DP Sink Service Definition.
        let (a2dp_def, _) = build_a2dp_service_definition(Psm::new(bredr::PSM_AVDTP));
        let mut expected_ids = HashSet::new();
        expected_ids.insert(bredr::ServiceClassProfileIdentifier::AudioSink);
        // Register the service.
        let (receiver, stream) =
            create_proxy_and_stream::<bredr::ConnectionReceiverMarker>().unwrap();
        let res = mock_peer.new_advertisement(vec![a2dp_def], receiver);
        assert!(res.is_ok());
        let (svc_ids, adv_fut) = res.unwrap();
        assert_eq!(expected_ids, svc_ids);
        (stream, adv_fut, svc_ids)
    }
fn build_and_register_service ( mock_peer : & mut MockPeer , ) -> ( bredr :: ConnectionReceiverRequestStream , impl Future < Output = ( ) > , HashSet < bredr :: ServiceClassProfileIdentifier > , ) { // Build the A2DP Sink Service Definition. let ( a2dp_def , _ ) = build_a2dp_service_definition ( Psm :: new ( bredr :: PSM_AVDTP ) ) ; let mut expected_ids = HashSet :: new ( ) ; expected_ids . insert ( bredr :: ServiceClassProfileIdentifier :: AudioSink ) ; // Register the service. let ( receiver , stream ) = create_proxy_and_stream :: < bredr :: ConnectionReceiverMarker > ( ) . unwrap ( ) ; let res = mock_peer . new_advertisement ( vec ! [ a2dp_def ] , receiver ) ; assert ! ( res is_ok ( ) ) ; let ( svc_ids , adv_fut ) = res . unwrap ( ) ; assert_eq ! ( expected_ids svc_ids ) ; ( stream , adv_fut , svc_ids ) }
Builds and registers an A2DP Sink service advertisement.
Builds and registers an A2DP Sink service advertisement .
mock_peer
&mut MockPeer
mock_peer
&mut MockPeer