c6b26b0228b7ad03f40cc7613c39f2f5c686f0f3
[platform/core/connectivity/bluetooth-agent.git] / ag-agent / bluetooth-ag-agent.h
1 /*
2  * Bluetooth-ag-agent.h
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:     Hocheol Seo <hocheol.seo@samsung.com>
7  *              Chethan TN <chethan.tn@samsung.com>
8  *              Chanyeol Park <chanyeol.park@samsung.com>
9  *              Rakesh MK <rakesh.mk@samsung.com>
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  *              http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  */
24
25 #ifndef __DEF_BT_AG_AGENT_H_
26 #define __DEF_BT_AG_AGENT_H_
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #undef LOG_TAG
33 #define LOG_TAG "BLUETOOTH_AG_AGENT"
34
35 #define LOG_COLOR_RESET    "\033[0m"
36 #define LOG_COLOR_RED      "\033[31m"
37 #define LOG_COLOR_YELLOW   "\033[33m"
38 #define LOG_COLOR_GREEN         "\033[32m"
39 #define LOG_COLOR_BLUE          "\033[36m"
40 #define LOG_COLOR_PURPLE   "\033[35m"
41
42 #define DBG(fmt, args...) SLOGD(fmt, ##args)
43 #define INFO(fmt, args...) SLOGI(fmt, ##args)
44 #define ERR(fmt, args...) SLOGE(fmt, ##args)
45 #define DBG_SECURE(fmt, args...) SECURE_SLOGD(fmt, ##args)
46 #define INFO_SECURE(fmt, args...) SECURE_SLOGI(fmt, ##args)
47 #define ERR_SECURE(fmt, args...) SECURE_SLOGE(fmt, ##args)
48 #define DBG_SECURE(fmt, args...) SECURE_SLOGD(fmt, ##args)
49 #define ERR_SECURE(fmt, args...) SECURE_SLOGE(fmt, ##args)
50 #define INFO_C(fmt, arg...) \
51         SLOGI_IF(TRUE,  LOG_COLOR_BLUE" "fmt" "LOG_COLOR_RESET, ##arg)
52 #define ERR_C(fmt, arg...) \
53         SLOGI_IF(TRUE,  LOG_COLOR_RED" "fmt" "LOG_COLOR_RESET, ##arg)
54
55 #include <unistd.h>
56 #include <dlog.h>
57 #include <stdio.h>
58 #include <signal.h>
59 #include <string.h>
60 #include <unistd.h>
61 #include <fcntl.h>
62 #include <inttypes.h>
63 #include <sys/socket.h>
64 #include <glib.h>
65 #include <gio/gio.h>
66 #include <errno.h>
67
68 #include "vconf.h"
69 #include "vconf-keys.h"
70
71 #define BT_AG_SERVICE_NAME "org.bluez.ag_agent"
72 #define BT_AG_AGENT_OBJECT_PATH "/org/bluez/hfp_agent"
73 #define BT_HS_AG_AGENT_OBJECT_PATH "/org/bluez/hsp_agent"
74 #define BLUEZ_AG_INTERFACE_NAME "Hands-Free Audio Gateway"
75 #define BLUEZ_SERVICE_NAME "org.bluez"
76 #define BLUEZ_PROFILE_MGMT_INTERFACE "org.bluez.ProfileManager1"
77 #define BT_MANAGER_INTERFACE "org.freedesktop.DBus.ObjectManager"
78 #define HFP_APP_INTERFACE "Org.Hfp.App.Interface"
79 #define TELEPHONY_APP_INTERFACE "org.tizen.csd.Call.Instance"
80 #define BT_HEADSET_INTERFACE "org.bluez.Headset"
81 #define BT_ADAPTER_INTERFACE    "org.bluez.Adapter1"
82 #define BT_INTERFACES_ADDED "InterfacesAdded"
83 #define BT_INTERFACES_REMOVED "InterfacesRemoved"
84 #ifdef TIZEN_FEATURE_BT_MEDIA_ENHANCE
85 #define BT_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
86 #define BLUEZ_MEDIA_TRANSPORT_INTERFACE "org.bluez.MediaTransport1"
87 #define BLUEZ_MEDIA_ENDPOINT_INTERFACE "org.bluez.MediaEndpoint1"
88 #define BLUEZ_DEVICE_INTERFACE  "org.bluez.Device1"
89 #define A2DP_SOURCE_ENDPOINT "/MediaEndpoint/A2DPSource"
90 #endif
91
92 #define BT_ADAPTER_OBJECT_PATH_MAX 50
93
94 #define BT_ADDRESS_STRING_SIZE 18
95 #define MAX_BUFFER_SIZE 1024
96
97 /* Response and hold values */
98 #define BT_RSP_HOLD_NOT_SUPPORTED       -2
99 #define HANDSFREE_FEATURE_CALL_WAITING_AND_3WAY 0x0002
100
101 /* HFP Agent Indicator event values */
102 #define INDICATOR_EVENT_SERVICE_NONE                    0
103 #define INDICATOR_EVENT_SERVICE_PRESENT         1
104
105 #define INDICATOR_EVENT_CALL_INACTIVE                   0
106 #define INDICATOR_EVENT_CALL_ACTIVE                     1
107
108 #define INDICATOR_EVENT_CALLSETUP_INACTIVE               0
109 #define INDICATOR_EVENT_CALLSETUP_INCOMING               1
110 #define INDICATOR_EVENT_CALLSETUP_OUTGOING               2
111 #define INDICATOR_EVENT_CALLSETUP_ALERTING               3
112
113 #define INDICATOR_EVENT_CALLHELD_NONE                   0
114 #define INDICATOR_EVENT_CALLHELD_MULTIPLE               1
115 #define INDICATOR_EVENT_CALLHELD_ON_HOLD                2
116
117 #define INDICATOR_EVENT_ROAM_INACTIVE                   0
118 #define INDICATOR_EVENT_ROAM_ACTIVE                     1
119
120 /* Telephony number types */
121 #define AGENT_NUMBER_TYPE_TELEPHONY             129
122 #define AGENT_NUMBER_TYPE_INTERNATIONAL 145
123
124 /* Call direction parameters */
125 #define AGENT_CALL_DIRECTION_OUTGOING   0
126 #define AGENT_CALL_DIRECTION_INCOMING           1
127
128 #define AGENT_CALL_STATUS_ACTIVE                0
129 #define AGENT_CALL_STATUS_HELD          1
130 #define AGENT_CALL_STATUS_DIALING               2
131 #define AGENT_CALL_STATUS_ALERTING      3
132 #define AGENT_CALL_STATUS_INCOMING      4
133 #define AGENT_CALL_STATUS_WAITING               5
134
135 #define AGENT_CALL_MODE_VOICE           0
136 #define AGENT_CALL_MODE_DATA            1
137 #define AGENT_CALL_MODE_FAX             2
138
139 #define AGENT_CALL_MULTIPARTY_NO                0
140 #define AGENT_CALL_MULTIPARTY_YES               1
141
142 /* Subscriber number parameters*/
143 #define AGENT_SUBSCRIBER_SERVICE_VOICE  4
144
145 /* Operator selection mode values */
146 #define AGENT_OPERATOR_MODE_AUTO                        0
147 #define HSP_VERSION_1_2  0x0102
148
149 /* Voice recognition blacklist file */
150 #define AGENT_VR_BLACKLIST_FILE (APP_SYSCONFDIR"/voice-recognition-blacklist")
151
152 #define BT_LOWER_ADDRESS_LENGTH 9
153
154 enum hfp_version {
155         HFP_VERSION_1_5 = 0x0105,
156         HFP_VERSION_1_6 = 0x0106,
157         HFP_VERSION_1_7 = 0x0107,
158         HFP_VERSION_LATEST = HFP_VERSION_1_7,
159 };
160
161 /* BD Address */
162 typedef struct {
163         uint8_t b[6];
164 } __attribute__((packed)) bt_addrs;
165
166 /**
167  * @brief Outgoing call type status
168  *
169  * 0 : Follow last call log \n
170  * 1 : Voice call \n
171  * 2 : Video call \n
172  */
173 #define BT_FOLLOW_CALL_LOG 0
174 #define BT_VOICE_CALL 1
175 #define BT_VIDEO_CALL 2
176
177 /**
178  * @brief The status of making outgoing calls with BT headsets
179  *
180  * 0 : Even when device locked \n
181  * 1 : Only when device unlocked \n
182  */
183 #define BT_MO_EVEN_LOCKED 0
184 #define BT_MO_ONLY_UNLOCKED 1
185
186 #define BT_CVSD_CODEC_ID 1
187 #define BT_MSBC_CODEC_ID 2
188
189 #define BT_CVSD_CODEC_MASK 0x0001
190 #define BT_MSBC_CODEC_MASK 0x0002
191
192 #define BT_HFP_MSBC_VOICE                       0x0063
193 #define BT_HFP_CVSD_VOICE                       0x0060
194
195 #define BT_SOCKET_LEVEL                 274
196 #define BT_VOICE_NUM                    11
197
198 #define BT_SCO_PRTCL    2
199
200 #define HFP_CODEC_NEGOTIATION_TIMEOUT 3 /* 3 seconds */
201
202 #define BT_SCO_OPEN_DELAY_TIMER 1000 /*1000 milliseconds*/
203
204 /* AT+CSQ : Returns received signal strength indication.
205      Command response: +CSQ: <rssi>,<ber>
206     <ber> is not supported and has a constant value of 99, included for compatibility reasons.
207 */
208 #define BT_SIGNAL_QUALITY_BER 99
209
210 /*Length of the string used to send telephone number*/
211 #define BT_MAX_TEL_NUM_STRING 30
212
213 #define FUCNTION_CALLS
214 #ifdef FUCNTION_CALLS
215 #define FN_START        DBG("ENTER==>")
216 #define FN_END          DBG("EXIT===>")
217 #else
218 #define FN_START
219 #define FN_END
220 #endif
221
222 /* HS states */
223 typedef enum {
224         HEADSET_STATE_DISCONNECTED,
225         HEADSET_STATE_CONNECTING,
226         HEADSET_STATE_CONNECTED,
227         HEADSET_STATE_PLAY_IN_PROGRESS,
228         HEADSET_STATE_ON_CALL
229 } hs_state_t;
230
231 typedef enum {
232         HFP_STATE_MNGR_ERR_AG_FAILURE = 0,
233         HFP_STATE_MNGR_NO_PHONE_CONNECTION = 1,
234         HFP_STATE_MNGR_ERR_NOT_ALLOWED  = 3,
235         HFP_STATE_MNGR_ERR_NOT_SUPPORTED        = 4,
236         HFP_STATE_MNGR_ERR_SIM_BUSY     = 14,
237         HFP_STATE_MNGR_ERR_INVALID_INDEX        = 21,
238         HFP_STATE_MNGR_ERR_INVALID_CHAR_IN_STRING       = 25,
239         HFP_STATE_MNGR_ERR_NO_NETWORK_SERVICE   = 30,
240         HFP_STATE_MNGR_ERR_NONE = 0x8000
241 } hfp_state_manager_err_t;
242
243 typedef enum {
244         BT_AG_FEATURE_THREE_WAY_CALL                    = 0x0001,
245         BT_AG_FEATURE_EC_AND_NR                         = 0x0002,
246         BT_AG_FEATURE_VOICE_RECOGNITION                 = 0x0004,
247         BT_AG_FEATURE_INBAND_RINGTONE                   = 0x0008,
248         BT_AG_FEATURE_ATTACH_NUMBER_TO_VOICETAG         = 0x0010,
249         BT_AG_FEATURE_REJECT_CALL                       = 0x0020,
250         BT_AG_FEATURE_ENHANCED_CALL_STATUS              = 0x0040,
251         BT_AG_FEATURE_ENHANCED_CALL_CONTROL             = 0x0080,
252         BT_AG_FEATURE_EXTENDED_ERROR_RESULT_CODES       = 0x0100,
253         BT_AG_FEATURE_CODEC_NEGOTIATION                 = 0x0200,
254         BT_AG_FEATURE_HF_INDICATORS                     = 0x0400,
255         BT_AG_FEATURE_ESCO_S4_T2_SUPPORT                = 0x0800,
256 } bt_ag_agent_feature_t;
257
258 typedef enum {
259         BT_HF_FEATURE_EC_ANDOR_NR                       = 0x0001,
260         BT_HF_FEATURE_CALL_WAITING_AND_3WAY     = 0x0002,
261         BT_HF_FEATURE_CLI_PRESENTATION          = 0x0004,
262         BT_HF_FEATURE_VOICE_RECOGNITION         = 0x0008,
263         BT_HF_FEATURE_REMOTE_VOLUME_CONTROL     = 0x0010,
264         BT_HF_FEATURE_ENHANCED_CALL_STATUS              = 0x0020,
265         BT_HF_FEATURE_ENHANCED_CALL_CONTROL     = 0x0040,
266         BT_HF_FEATURE_CODEC_NEGOTIATION = 0x0080,
267 } bt_hf_agent_feature_t;
268
269 /* HFP AG service record bitmap. Bluetooth HFP 1.6 spec page 95 */
270 #define BT_AG_FEATURE_SDP_3WAY                  0x1
271 #define BT_AG_FEATURE_SDP_ECNR                  0x2
272 #define BT_AG_FEATURE_SDP_VOICE_RECOG           0x4
273 #define BT_AG_FEATURE_SDP_IN_BAND_RING_TONE     0x8
274 #define BT_AG_FEATURE_SDP_ATTACH_VOICE_TAG              0x10
275 #define BT_AG_FEATURE_SDP_WIDEBAND_SPEECH               0x20
276
277 #define BT_AG_AGENT_ERROR (__bt_ag_agent_error_quark())
278
279 #define BT_ERROR_INTERNAL "InternalError"
280 #define BT_ERROR_NOT_AVAILABLE "NotAvailable"
281 #define BT_ERROR_NOT_CONNECTED "NotConnected"
282 #define BT_ERROR_BUSY "InProgress"
283 #define BT_ERROR_INVALID_PARAM "InvalidArguments"
284 #define BT_ERROR_ALREADY_EXSIST "AlreadyExists"
285 #define BT_ERROR_ALREADY_CONNECTED "Already Connected"
286 #define BT_ERROR_NO_MEMORY "No memory"
287 #define BT_ERROR_I_O_ERROR "I/O error"
288 #define BT_ERROR_OPERATION_NOT_AVAILABLE "Operation currently not available"
289 #define BT_ERROR_BATTERY "Battery error "
290 #define BT_ERROR_SIGNAL "Signal error"
291 #define BT_ERROR_NO_CALL_LOG "No Call log"
292 #define BT_ERROR_INVLAID_DTMF "Invalid dtmf"
293
294 #define BT_CHECK_SIGNAL_STRENGTH(rssi) \
295         if (rssi >= VCONFKEY_TELEPHONY_RSSI_4) \
296                 rssi = VCONFKEY_TELEPHONY_RSSI_5
297
298 typedef enum {
299         BT_HFP_AGENT_ERROR_NONE,
300         BT_HFP_AGENT_ERROR_INTERNAL,
301         BT_HFP_AGENT_ERROR_NOT_AVAILABLE,
302         BT_HFP_AGENT_ERROR_NOT_CONNECTED,
303         BT_HFP_AGENT_ERROR_BUSY,
304         BT_HFP_AGENT_ERROR_INVALID_PARAM,
305         BT_HFP_AGENT_ERROR_ALREADY_EXSIST,
306         BT_HFP_AGENT_ERROR_ALREADY_CONNECTED,
307         BT_HFP_AGENT_ERROR_NO_MEMORY,
308         BT_HFP_AGENT_ERROR_I_O_ERROR,
309         BT_HFP_AGENT_ERROR_OPERATION_NOT_AVAILABLE,
310         BT_HFP_AGENT_ERROR_NO_CALL_LOGS,
311         BT_HFP_AGENT_ERROR_INVALID_MEMORY_INDEX,
312         BT_HFP_AGENT_ERROR_INVALID_CHLD_INDEX,
313         BT_HFP_AGENT_ERROR_BATTERY_STATUS,
314         BT_HFP_AGENT_ERROR_SIGNAL_STATUS,
315         BT_HFP_AGENT_ERROR_NOT_SUPPORTED,
316         BT_HFP_AGENT_ERROR_INVALID_NUMBER,
317         BT_HFP_AGENT_ERROR_APPLICATION,
318         BT_HFP_AGENT_ERROR_INVALID_DTMF,
319 } bt_hfp_agent_error_t;
320
321 typedef enum {
322         BT_AGENT_NETWORK_REG_STATUS_HOME,
323         BT_AGENT_NETWORK_REG_STATUS_ROAMING,
324         BT_AGENT_NETWORK_REG_STATUS_OFFLINE,
325         BT_AGENT_NETWORK_REG_STATUS_SEARCHING,
326         BT_AGENT_NETWORK_REG_STATUS_NO_SIM,
327         BT_AGENT_NETWORK_REG_STATUS_POWEROFF,
328         BT_AGENT_NETWORK_REG_STATUS_POWERSAFE,
329         BT_AGENT_NETWORK_REG_STATUS_NO_COVERAGE,
330         BT_AGENT_NETWORK_REG_STATUS_REJECTED,
331         BT_AGENT_NETWORK_REG_STATUS_UNKOWN,
332 } bt_hfp_agent_network_registration_status_t;
333
334 typedef enum {
335         BT_AGENT_NETWORK_REG_STATUS_NOT_REGISTER,
336         BT_AGENT_NETWORK_REG_STATUS_REGISTER_HOME_NETWORK,
337         BT_AGENT_NETWORK_REG_STATUS_SEARCH,
338         BT_AGENT_NETWORK_REG_STATUS_REGISTRATION_DENIED,
339         BT_AGENT_NETWORK_REG_STATUS_UNKNOWN,
340         BT_AGENT_NETWORK_REG_STATUS_REGISTERED_ROAMING,
341         BT_AGENT_NETWORK_REG_STATUS_REGISTERED_SMS_HOME,
342         BT_AGENT_NETWORK_REG_STATUS_REGISTERED_SMS_ROAMING,
343         BT_AGENT_NETWORK_REG_STATUS_EMERGENCY,
344         BT_AGENT_NETWORK_REG_STATUS_REGISTERED_CSFB_HOME,
345         BT_AGENT_NETWORK_REG_STATUS_REGISTERED_CSFB_ROAMING,
346 } bt_hfp_agent_reg_status_t;
347
348 #ifdef TIZEN_FEATURE_BT_MEDIA_ENHANCE
349 typedef enum media_transport_state {
350         MEDIA_TRANSPORT_STATE_DISCONNECTED,
351         MEDIA_TRANSPORT_STATE_IDLE,
352         MEDIA_TRANSPORT_STATE_PLAYING
353 } bt_ag_media_transport_state_t;
354
355 /* Profile states matched to btd_service_state_t of bluez service.h */
356 typedef enum {
357         BT_PROFILE_STATE_UNAVAILABLE,
358         BT_PROFILE_STATE_DISCONNECTED,
359         BT_PROFILE_STATE_CONNECTING,
360         BT_PROFILE_STATE_CONNECTED,
361         BT_PROFILE_STATE_DISCONNECTING,
362 } bt_profile_state_t;
363 #endif
364
365 #define retv_if(expr, val) \
366         do { \
367                 if (expr) { \
368                         ERR("(%s) return", #expr); \
369                         return (val); \
370                 } \
371         } while (0)
372
373 #define ret_if(expr) \
374         do { \
375                 if (expr) { \
376                         ERR("(%s) return", #expr); \
377                         return; \
378                 } \
379         } while (0)
380
381 typedef struct {
382         unsigned char b[6];
383 } __attribute__((packed)) bdaddr_t;
384
385 /* Remote socket address */
386 struct sockaddr_remote {
387         sa_family_t     family;
388         bdaddr_t        remote_bdaddr;
389         uint8_t         channel;
390 };
391
392 typedef struct {
393         const char *indicator_desc;
394         const char *indicator_range;
395         int hfp_value;
396         gboolean ignore;
397         gboolean is_activated;
398 } bt_ag_indicators_t;
399
400 typedef struct {
401         gboolean telephony_ready;       /* plugin initialized */
402         uint32_t features;            /* AG features */
403         const bt_ag_indicators_t *indicators;     /* Supported indicators */
404         int er_mode;               /* Event reporting mode */
405         int er_ind;                 /* Event reporting for indicators */
406         int rh;                 /* Response and Hold state */
407         char *number;             /* Incoming phone number */
408         int number_type;                /* Incoming number type */
409         guint ring_timer;               /* For incoming call indication */
410         const char *chld;               /* Response to AT+CHLD=? */
411         uint32_t sdp_features; /* SDP features */
412 } bt_ag_status_t;
413
414 typedef struct {
415         char buffer[MAX_BUFFER_SIZE];
416
417         int start;
418         int length;
419
420         gboolean is_nrec;
421         gboolean is_nrec_req;
422         gboolean is_pending_ring;
423         gboolean is_inband_ring;
424         gboolean is_cme_enabled;
425         gboolean is_cwa_enabled;
426         gboolean is_client_active;
427         gboolean is_voice_recognition_running;
428
429         int speaker_gain;
430         int microphone_gain;
431
432         unsigned int hs_features;
433 } bt_ag_slconn_t;
434
435 typedef struct {
436 /*      DBusMessage *msg;
437         DBusPendingCall *call;*/
438         GIOChannel *io;
439         int err;
440         hs_state_t target_state;
441         GSList *callbacks;
442         uint16_t svclass;
443 } hs_connecting_t;
444
445 typedef struct {
446         char *object_path;
447         gboolean is_negotiating;
448         gboolean requested_by_hf;
449         guint nego_timer;
450         unsigned int remote_codecs;
451         unsigned int sending_codec;
452         unsigned int final_codec;
453 } bt_negotiation_info_t;
454
455 typedef struct {
456         const char *path;
457         guint32 fd;
458
459         gboolean auto_connect;
460         GIOChannel *io_chan;
461         char *remote_addr;
462         guint watch_id;
463         GIOChannel *sco_server;
464         guint sco_watch_id;
465
466         GIOChannel *rfcomm;
467         GIOChannel *sco;
468         guint sco_id;
469         guint sco_incoming_id;
470         guint codec;
471
472         gboolean auto_dc;
473
474         guint dc_timer;
475
476         gboolean hfp_active;
477         gboolean search_hfp;
478         gboolean rfcomm_initiator;
479         gboolean vr_blacklisted;
480
481         hs_state_t state;
482         bt_ag_slconn_t *slc;
483         hs_connecting_t *pending;
484         GSList *nrec_cbs;
485         gboolean sco_server_started;
486         gboolean nrec_status;
487         bt_negotiation_info_t codec_info;
488 #if defined(TIZEN_SUPPORT_DUAL_HF)
489         gboolean is_companion_device;
490 #endif
491 } bt_ag_info_t;
492
493 typedef void (*headset_nrec_cb) (bt_ag_info_t *hs,
494                                         gboolean nrec,
495                                         void *user_data);
496
497 struct hs_nrec_callback {
498         unsigned int id;
499         headset_nrec_cb cb;
500         void *user_data;
501 };
502
503 typedef void (*hs_state_cb) (bt_ag_info_t *hs,
504                 hs_state_t old_state,
505                 hs_state_t new_state,
506                 void *user_data);
507
508 struct hs_state_callback {
509                 hs_state_cb cb;
510                 void *user_data;
511                 unsigned int id;
512 };
513
514 int __attribute__((format(printf, 2, 3)))
515                         _bt_ag_send_at(bt_ag_info_t *hs, char *format, ...);
516 void __attribute__((format(printf, 3, 4)))
517                 _bt_ag_send_foreach_headset(GSList *devices,
518                 int (*cmp) (bt_ag_info_t *hs),
519                 char *format, ...);
520 void _bt_ag_slconn_complete(bt_ag_info_t *hs);
521 int _bt_ag_send_response(bt_ag_info_t *hs, hfp_state_manager_err_t err);
522 void _bt_hfp_call_hold_request(const char *t_cmd, void *t_device);
523 void _bt_hfp_key_press_request(const char *t_key_press, void *t_device);
524 void _bt_hfp_terminate_call_request(void *t_device);
525 void _bt_hfp_answer_call_request(void *t_device);
526 void _bt_hfp_update_event_request(int indicator, void *t_device);
527 void _bt_hfp_response_and_hold_request(void *t_device);
528 void _bt_hfp_last_dialed_number_request(void *t_device);
529 void _bt_hfp_dial_number_request(const char *dial_number, void *t_device);
530 void _bt_hfp_channel_dtmf_request(char t_tone, void *t_device);
531 void _bt_hfp_subscriber_number_request(void *t_device);
532 void _bt_hfp_get_operator_selection_request(void *t_device);
533 void _bt_hfp_noise_red_and_echo_cancel_request(gboolean t_enable,
534                         void *t_device);
535 void _bt_hfp_voice_dial_request(gboolean t_enable, void *t_device);
536 void _bt_hfp_set_indicators(const char *t_command, void *t_device);
537 void _bt_hfp_select_phonebook_memory_status(void *t_device);
538 void _bt_hfp_select_phonebook_memory_list(void *t_device);
539 void _bt_hfp_select_phonebook_memory(void *t_device, const gchar *pb_path);
540 void _bt_hfp_read_phonebook_entries_list(void *t_device);
541 void _bt_hfp_read_phonebook_entries(void *t_device, const char *cmd);
542 void _bt_hfp_find_phonebook_entries_status(void *t_device);
543 void _bt_hfp_find_phonebook_entries(void *t_device, const char *cmd);
544 void _bt_hfp_get_character_set(void *t_device);
545 void _bt_hfp_list_supported_character(void *t_device);
546 void _bt_hfp_set_character_set(void *t_device, const char *cmd);
547 void _bt_hfp_get_battery_property(void *t_device);
548 void _bt_hfp_signal_quality_reply(int32_t rssi, int32_t ber,
549         void *t_device);
550 void _bt_hfp_battery_property_reply(void *data, int32_t bcs,
551                         int32_t bcl);
552 void _bt_hfp_operator_reply(char *operator_name,  void *t_device);
553 bt_hfp_agent_error_t _bt_ag_agent_dial_num(const gchar *number, guint flags);
554 bt_hfp_agent_error_t _bt_ag_agent_dial_last_num(void *device);
555 bt_hfp_agent_error_t _bt_ag_agent_send_dtmf(const gchar *dtmf,
556                                 const gchar *path, const gchar *sender);
557 bt_hfp_agent_error_t _bt_ag_agent_dial_memory(unsigned int location);
558 gboolean _bt_ag_agent_get_signal_quality(void *device);
559 gboolean _bt_ag_agent_get_battery_status(void *device);
560 gboolean _bt_ag_agent_get_operator_name(void *device);
561 gboolean _bt_hfp_agent_nrec_status(gboolean status,
562         void *t_device);
563 gboolean _bt_ag_agent_voice_dial(gboolean activate);
564 gboolean _bt_ag_agent_answer_call(unsigned int call_id,
565                                 const gchar *path, const gchar *sender);
566 gboolean _bt_ag_agent_reject_call(unsigned int call_id,
567                                 const gchar *path, const gchar *sender);
568 gboolean _bt_ag_agent_release_call(unsigned int call_id,
569                                 const gchar *path, const gchar *sender);
570 gboolean _bt_ag_agent_threeway_call(unsigned int chld_value,
571                                 const gchar *path, const gchar *sender);
572 void _bt_list_current_calls(void *t_device);
573 void _bt_get_activity_status(void *t_device);
574 int _bt_hfp_set_property_name(const char *property, const char *operator_name);
575 void _bt_hfp_get_imei_number_reply(char *imei_number,  void *t_device);
576 void _bt_hfp_get_model_info_reply(char *model,  void *t_device);
577 void _bt_hfp_get_device_manufacturer_reply(char *manufacturer,  void *t_device);
578 void _bt_hfp_get_revision_info_reply(char *revision,  void *t_device);
579 void _bt_hfp_device_disconnected(void *t_device);
580 int _bt_hfp_get_equipment_identity(bt_ag_info_t *device, const char *buf);
581 int _bt_hfp_get_model_information(bt_ag_info_t *device, const char *buf);
582 int _bt_hfp_get_device_manufacturer(bt_ag_info_t *device, const char *buf);
583 int _bt_hfp_get_imsi(bt_ag_info_t *device, const char *buf);
584 int _bt_hfp_get_creg_status(bt_ag_info_t *device, const char *buf);
585 int _bt_hfp_get_revision_information(bt_ag_info_t *device, const char *buf);
586 void _bt_hfp_get_equipment_identity_req(void *t_device);
587 bt_hfp_agent_error_t _bt_hfp_register_telephony_agent(gboolean register_flag,
588                 const char *path_to_register,
589                 const char *sender);
590 bt_hfp_agent_error_t _bt_hfp_incoming_call(const char *call_path,
591                 const char *incoming_number,
592                 uint32_t incoming_call_id,
593                 const char *sender);
594 bt_hfp_agent_error_t _bt_hfp_outgoing_call(const char *call_path,
595                 const char *number,
596                 uint32_t call_id, const char *sender);
597 bt_hfp_agent_error_t _bt_hfp_change_call_status(const char *call_path,
598                 const char *number,
599                 uint32_t call_status,
600                 uint32_t call_id,
601                 const char *sender);
602 void _bt_hfp_initialize_telephony_manager(uint32_t ag_features);
603 void _bt_hfp_deinitialize_telephony_manager(void);
604 gboolean _bt_ag_agent_emit_property_changed(
605                                 GDBusConnection *connection,
606                                 const char *path,
607                                 const char *interface,
608                                 const char *name,
609                                 GVariant *property);
610 void _bt_hfp_get_model_info_req(void *t_device);
611 void _bt_hfp_get_device_manufacturer_req(void *t_device);
612 void _bt_hfp_get_imsi_req(void *t_device);
613 void _bt_hfp_get_creg_status_req(void *t_device);
614 void _bt_hfp_get_revision_info_req(void *t_device);
615 gboolean _bt_hfp_is_call_exist(void);
616 void _bt_hfp_release_all_calls_by_sender(const char *sender);
617 void _bt_hfp_get_imsi_reply(char *mcc, char *mnc, char *msin, void *t_device);
618 void _bt_hfp_get_creg_status_reply(int n, int status, void *t_device);
619 int _bt_hfp_set_property_value(const char *property, int value);
620 void _bt_hfp_vendor_cmd_request(const char *cmd,
621                                                 void *t_device);
622
623 gboolean _bt_ag_agent_get_imei_number(void *device);
624 void _bt_ag_agent_get_model_name(void *device);
625 void _bt_ag_agent_get_manufacturer_name(void *device);
626 void _bt_ag_agent_get_imsi(void *device);
627 void _bt_ag_agent_get_creg_status(void *device);
628 void _bt_ag_agent_get_revision_information(void *device);
629 bt_hfp_agent_error_t _bt_ag_agent_vendor_cmd(const gchar *cmd,
630                 const gchar *path, const gchar *sender);
631 #ifdef TIZEN_FEATURE_BT_MEDIA_ENHANCE
632 void _bt_ag_agent_check_transport_state(void);
633 #endif
634
635 #ifdef __cplusplus
636 }
637 #endif
638 #endif /* __DEF_BT_AG_AGENT_H_ */