blob: cc4a38dd96172597128d5db105bd0b284e5d178b [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.bluetooth.avdtp.test;
using fuchsia.bluetooth as bt;
/// Control service for an AVDTP Peer.
@discoverable
closed protocol PeerManager {
/// Connects to the server specified by a `peer_id`.
/// On success, `handle` will be used for initiating PeerController procedures.
/// On peer disconnect, the handle will be dropped and closed on the server side.
strict GetPeer(resource struct {
peer_id bt.PeerId;
handle server_end:PeerController;
});
/// Returns the `bt.PeerId` of each currently connected peer.
strict ConnectedPeers() -> (struct {
peer_ids vector<bt.PeerId>:MAX_PICONET_SIZE;
});
/// Incoming connection events from the AVDTP peer.
/// Returns the [`fuchsia.bluetooth..PeerId`] of the newly connected peer.
strict -> OnPeerConnected(struct {
peer_id bt.PeerId;
});
};
/// PeerController is an indirect control protocol used for driving the AVDTP library.
/// This protocol provides the client with an interface for initiating AVDTP commands
/// out of band. To drive end-to-end functionality of AVDTP see
/// [bt-profiles](//src/connectivity/bluetooth/profiles).
/// * `error PeerError` indicates a procedure failure.
/// The current Get*() & SetConfiguration() methods can be interpreted as only initiating an AVDTP
/// procedure. The implementations of the Get*() and SetConfiguration() methods use generic
/// capabilities and stream information.
closed protocol PeerController {
/// Initiate a stream configuration procedure.
/// No configuration information is specified because generic config information will
/// be used to initiate the procedure.
strict SetConfiguration() -> () error PeerError;
/// Initiate a procedure to get the configuration information of the peer stream.
/// The result is discarded because PeerController only initiates the procedure.
strict GetConfiguration() -> () error PeerError;
/// Initiate a suspend request to the stream.
/// This command will not resume nor reconfigure the stream.
strict SuspendStream() -> () error PeerError;
/// A "chained" set of procedures on the current stream.
/// SuspendStream() followed by ReconfigureStream().
/// Reconfigure() configures the stream that is currently open.
strict SuspendAndReconfigure() -> () error PeerError;
/// Initiate stream establishment with the peer.
strict EstablishStream() -> () error PeerError;
/// Release the current stream that is owned by the peer.
/// If the streaming channel doesn't exist, no action will be taken.
strict ReleaseStream() -> () error PeerError;
/// Initiate an abort procedure on the current stream.
/// If the streaming channel doesn't exist, no action will be taken.
strict AbortStream() -> () error PeerError;
/// Start streaming media on the current stream that is owned by the peer.
/// If the streaming channel doesn't exist, no action will be taken.
strict StartStream() -> () error PeerError;
/// Initiate a reconfiguration procedure for the current stream.
/// No configuration information is specified because a generic set of config
/// information will be used to initiate the procedure.
strict ReconfigureStream() -> () error PeerError;
/// Initiate a procedure to get the capabilities of the peer.
/// The result is discarded because PeerController only initiates the procedure.
strict GetCapabilities() -> () error PeerError;
/// Initiate a procedure to get the capabilities of the peer.
/// The result is discarded because PeerController only initiates the procedure.
strict GetAllCapabilities() -> () error PeerError;
};