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