2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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.
19 #ifndef _BT_SERVICE_AUDIO_H_
20 #define _BT_SERVICE_AUDIO_H_
23 #include <sys/types.h>
24 #include "bluetooth-api.h"
33 int disconnection_type;
41 } bt_player_settinngs_t;
44 BT_PENDING_NONE = 0x00,
47 } bt_pending_request_t;
52 bt_pending_request_t pending;
54 } bt_audio_function_data_t;
69 BT_STATE_DISCONNECTING,
71 } bt_headset_device_state_t;
73 #define BT_CONTENT_PROTECTION_PATH "/org/tizen/bluetooth/a2dpcontentprotection"
74 #define BT_CONTENT_PROTECTION_INTERFACE "org.tizen.bluetooth.A2dpContentProtection"
76 #ifdef TIZEN_BT_A2DP_SINK_AUTO_CONNECT
77 #define BT_AUTO_CONNECT_TIMEOUT_AFTER_BT_ACTIVATED 2 /* 2 sec */
78 #define BT_AUTO_CONNECT_TIMEOUT_AFTER_LINKLOSS 30 /* 30 sec */
79 #define BT_AUTO_CONNECT_TIMEOUT_RETRY_TIME 3600 /* 60 minute */
82 int _bt_audio_connect(int request_id, int type,
83 bluetooth_device_address_t *device_address,
86 int _bt_audio_disconnect(int request_id, int type,
87 bluetooth_device_address_t *device_address,
90 int _bt_hf_connect(int request_id,
91 bluetooth_device_address_t *device_address,
94 int _bt_hf_disconnect(int request_id,
95 bluetooth_device_address_t *device_address,
98 int _bt_audio_get_speaker_gain(unsigned int *gain);
100 int _bt_audio_set_speaker_gain(unsigned int gain);
102 int _bt_audio_set_content_protect(gboolean status);
104 void _bt_set_audio_wait_data_flag(gboolean flag);
106 bt_headset_wait_t *_bt_get_audio_wait_data(void);
108 void _bt_rel_wait_data(void);
110 void _bt_add_headset_to_list(int type, int status, const char *address);
112 void _bt_remove_headset_from_list(int type, const char *address);
114 gboolean _bt_is_headset_type_connected(int type, char *address);
115 void _bt_remove_from_connected_list(const char *address);
117 int _bt_get_device_state_from_list(int type, const char *address);
119 void _bt_remove_from_connected_list(const char *address);
121 void _bt_audio_check_pending_connect();
123 gboolean _bt_is_service_connected(char *address, int type);
125 #ifdef TIZEN_BT_A2DP_SINK_AUTO_CONNECT
126 int _bt_audio_start_auto_connect(gboolean linkloss_flag);
128 int _bt_audio_stop_auto_connect(void);
130 void _bt_audio_set_auto_connect_device_addr(const char *address);
135 #endif /* __cplusplus */
136 #endif /*_BT_SERVICE_AUDIO_H_*/