2 * Copyright (C) 2012 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef ANDROID_INCLUDE_BT_AV_H
18 #define ANDROID_INCLUDE_BT_AV_H
22 /* Bluetooth AV connection states */
24 BTAV_CONNECTION_STATE_DISCONNECTED
= 0,
25 BTAV_CONNECTION_STATE_CONNECTING
,
26 BTAV_CONNECTION_STATE_CONNECTED
,
27 BTAV_CONNECTION_STATE_DISCONNECTING
28 } btav_connection_state_t
;
30 /* Bluetooth AV datapath states */
32 BTAV_AUDIO_STATE_REMOTE_SUSPEND
= 0,
33 BTAV_AUDIO_STATE_STOPPED
,
34 BTAV_AUDIO_STATE_STARTED
,
38 /** Callback for connection state change.
39 * state will have one of the values from btav_connection_state_t
41 typedef void (* btav_connection_state_callback
)(btav_connection_state_t state
,
42 bt_bdaddr_t
*bd_addr
);
44 /** Callback for audiopath state change.
45 * state will have one of the values from btav_audio_state_t
47 typedef void (* btav_audio_state_callback
)(btav_audio_state_t state
,
48 bt_bdaddr_t
*bd_addr
);
50 /** BT-AV callback structure. */
52 /** set to sizeof(btav_callbacks_t) */
54 btav_connection_state_callback connection_state_cb
;
55 btav_audio_state_callback audio_state_cb
;
61 * 1. AVRCP 1.0 shall be supported initially. AVRCP passthrough commands
62 * shall be handled internally via uinput
64 * 2. A2DP data path shall be handled via a socket pipe between the AudioFlinger
65 * android_audio_hw library and the Bluetooth stack.
68 /** Represents the standard BT-AV interface. */
71 /** set to sizeof(btav_interface_t) */
74 * Register the BtAv callbacks
76 bt_status_t (*init
)( btav_callbacks_t
* callbacks
);
78 /** connect to headset */
79 bt_status_t (*connect
)( bt_bdaddr_t
*bd_addr
);
81 /** dis-connect from headset */
82 bt_status_t (*disconnect
)( bt_bdaddr_t
*bd_addr
);
84 /** Closes the interface. */
85 void (*cleanup
)( void );
90 #endif /* ANDROID_INCLUDE_BT_AV_H */