2 * Open Adaptation Layer (OAL)
4 * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _OAL_AVRCP_HOST_H_
21 #define _OAL_AVRCP_HOST_H_
24 #include <sys/types.h>
25 #include <oal-manager.h>
26 #include "oal-event.h"
32 #define OAL_MAX_ATTR_STR_LEN 255
34 /* Maximum service name length */
35 #define BT_AVRCP_NAME_LENGTH_MAX 35
38 * @brief AVRCP CMD send to remote BT device
50 * @brief Media's different properties type set to remote BT device
52 * @see avrcp_set_property
55 AVRCP_EQUALIZER = 0x01,
61 } oal_media_prop_type;
64 * @brief Player repeat status
66 * @see avrcp_set_property
69 OAL_PLAYER_VAL_OFF_REPEAT = 0x01,
70 OAL_PLAYER_VAL_SINGLE_REPEAT = 0x02,
71 OAL_PLAYER_VAL_ALL_REPEAT = 0x03,
72 OAL_PLAYER_VAL_GROUP_REPEAT = 0x04
73 } oal_player_repeat_status;
76 * @brief Player shuffel mode
78 * @see avrcp_set_property
81 OAL_PLAYER_VAL_OFF_SHUFFLE = 0x01,
82 OAL_PLAYER_VAL_ALL_SHUFFLE = 0x02,
83 OAL_PLAYER_VAL_GROUP_SHUFFLE = 0x03
84 } oal_player_shuffle_status;
87 * @brief Player play state
89 * @see avrcp_set_property
92 OAL_PLAYSTATE_STOPPED = 0x00, /* Stopped */
93 OAL_PLAYSTATE_PLAYING = 0x01, /* Playing */
94 OAL_PLAYSTATE_PAUSED = 0x02, /* Paused */
95 OAL_PLAYSTATE_FWD_SEEK = 0x03, /* Fwd Seek*/
96 OAL_PLAYSTATE_REV_SEEK = 0x04, /* Rev Seek*/
97 OAL_PLAYSTATE_ERROR = 0xFF, /* Error */
101 * @brief Media Track's attibutes set to remote BT device
103 * @see avrcp_set_track_info
106 char title[OAL_MAX_ATTR_STR_LEN];
107 char artist[OAL_MAX_ATTR_STR_LEN];
108 char album[OAL_MAX_ATTR_STR_LEN];
109 char genre[OAL_MAX_ATTR_STR_LEN];
110 unsigned int total_tracks;
112 unsigned int duration;
113 } oal_media_metadata_attributes_t;
116 * @brief AVRCP Volume and mute
118 * @see OAL_EVENT_AVRCP_VOLUME_MUTE_CHANGED
121 gboolean mute_status ;
123 } oal_avrcp_volume_mute_t;
126 * @brief AVRCP stream Delay
128 * @see OAL_EVENT_AVRCP_DELAY_CHANGED
136 bt_address_t address;
137 char avrcp_serv_name[BT_AVRCP_NAME_LENGTH_MAX+1];
138 char avrcp_prov_name[BT_AVRCP_NAME_LENGTH_MAX+1];
142 * @brief Enable AVRCP Feature
144 * @remarks AVRCP Feature (like play/pause, media information etc) will be enabled.
145 * @remarks Used in conjunction with a2dp_enable
147 * @return OAL_STATUS_SUCCESS on success, otherwise non-zero error value.
148 * @retval #OAL_STATUS_SUCCESS Successful
150 * @pre OAL API must be initialized with oal_bt_init().
152 * @see avrcp_disable()
155 oal_status_t avrcp_enable(void);
158 * @brief Disable AVRCP Feature
160 * @remarks AVRCP Feature (like play/pause, media information etc) will be disabled.
161 * @remarks Used in conjunction with a2dp_disable.
163 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
164 * @retval #OAL_STATUS_SUCCESS Successful
166 * @pre AVRCP should be enabled with avrcp_enable().
168 * @see avrcp_enable()
169 * @see a2dp_disable()
171 oal_status_t avrcp_disable(void);
174 * @brief Initiate a connection with AVRCP controller device
176 * @details Result will be notified through an OAL event
178 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
179 * @retval #OAL_STATUS_SUCCESS Successful
181 * @pre BT Audio should be enabled with avrcp_tg_enable().
183 * @see OAL_EVENT_AVRCP_CONNECTED
185 oal_status_t avrcp_tg_connect(bt_address_t *rem_addr);
189 * @brief Remove a connection with AVRCP controller device
191 * @details Result will be notified through an OAL event
193 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
194 * @retval #OAL_STATUS_SUCCESS Successful
196 * @pre BT Audio should be connected with a BT Sound device.
198 * @see OAL_EVENT_AVRCP_DISCONNECTED
200 oal_status_t avrcp_tg_disconnect(bt_address_t *rem_addr);
203 * @brief Set the AVRCP property to BT audio remote device
205 * @details Used to set the different type of AVRCP property.
207 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
208 * @retval #OAL_STATUS_SUCCESS Successful
210 * @pre AVRCP should be enabled with avrcp_enable().
212 * @see avrcp_enable()
214 oal_status_t avrcp_set_property(int type, unsigned int value);
217 * @brief Set the media track info to BT audio remote device
219 * @details Used to set the different parameters(title, album, genre etc) of media track.
221 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
222 * @retval #OAL_STATUS_SUCCESS Successful
224 * @pre AVRCP should be enabled with avrcp_enable().
226 * @see avrcp_enable()
228 oal_status_t avrcp_set_track_info(oal_media_metadata_attributes_t *meta_data);
232 #endif /* __cplusplus */
233 #endif /*_OAL_AVRCP_HOST_H_*/