|  | // Copyright 2020 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. | 
|  | @available(added=7) | 
|  | library fuchsia.bluetooth.a2dp; | 
|  |  | 
|  | /// Enum corresponding to the A2DP SRC/SNK roles as defined in the | 
|  | /// A2DP v1.3.2 profile specification, section 2.2. | 
|  | type Role = strict enum { | 
|  | /// Act as a source of digital audio streams, sending audio to peers. | 
|  | SOURCE = 1; | 
|  | /// Act as a sink of digital audio streams and play audio sent from peers. | 
|  | SINK = 2; | 
|  | }; | 
|  |  | 
|  | /// A protocol for specifying which A2DP role this device should operate. | 
|  | @discoverable | 
|  | protocol AudioMode { | 
|  | /// Switch the device to act as the specified A2DP Role. If the device is already | 
|  | /// set to the requested role, calling this method is a no-op. | 
|  | /// | 
|  | /// When this method returns, a client can depend on the following: | 
|  | /// 1. If the role was switched, the previous profile has requested removal | 
|  | ///    from the hosts' SDP databases, and all L2CAP channels associated with | 
|  | ///    the previous profile have initiated or completed the process of closing. | 
|  | /// 2. The device is in the requested A2DP role. | 
|  | /// | 
|  | /// If the role cannot be set due to an internal error, the server will close | 
|  | /// the channel. | 
|  | SetRole(struct { | 
|  | role Role; | 
|  | }) -> (); | 
|  | }; |