Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 97 lines (77 sloc) 2.616 kb
080bb2b @holtmann Add skeleton for telephony drivers
holtmann authored
1 /*
2 *
3 * BlueZ - Bluetooth protocol stack for Linux
4 *
5 * Copyright (C) 2006-2007 Nokia Corporation
6 * Copyright (C) 2004-2008 Marcel Holtmann <marcel@holtmann.org>
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 */
24
5c607b7 Add skeleton for basic telephony functions
Johan Hedberg authored
25 #include <stdint.h>
1b971b0 Implement last number dialed (AT+BLDN) support
Johan Hedberg authored
26 #include <errno.h>
27 #include <glib.h>
5c607b7 Add skeleton for basic telephony functions
Johan Hedberg authored
28
40c0305 Remove HFP AG features from audio.conf since they should come from the t...
Johan Hedberg authored
29 #define AG_FEATURE_THREE_WAY_CALLING 0x0001
30 #define AG_FEATURE_EC_ANDOR_NR 0x0002
31 #define AG_FEATURE_VOICE_RECOGNITION 0x0004
32 #define AG_FEATURE_INBAND_RINGTONE 0x0008
33 #define AG_FEATURE_ATTACH_NUMBER_TO_VOICETAG 0x0010
34 #define AG_FEATURE_REJECT_A_CALL 0x0020
35 #define AG_FEATURE_ENHANCES_CALL_STATUS 0x0040
36 #define AG_FEATURE_ENHANCES_CALL_CONTROL 0x0080
37 #define AG_FEATURE_EXTENDED_ERROR_RESULT_CODES 0x0100
38
2bda864 Preliminary support for indicators
Johan Hedberg authored
39 struct indicator {
40 const char *desc;
41 const char *range;
42 int val;
43 };
44
842ed09 Implement basic HFP response and hold support
Johan Hedberg authored
45 int telephony_event_reporting_req(int ind);
3bb7bf6 Implement basic event reporting support
Johan Hedberg authored
46
09c1b1a Add a telephony_ready callback to notify initialization completion
Johan Hedberg authored
47 int telephony_event_ind(int index);
842ed09 Implement basic HFP response and hold support
Johan Hedberg authored
48
49 int telephony_response_and_hold_req(int rh);
50
51 int telephony_response_and_hold_ind(int rh);
3bb7bf6 Implement basic event reporting support
Johan Hedberg authored
52
1b971b0 Implement last number dialed (AT+BLDN) support
Johan Hedberg authored
53 int telephony_last_dialed_number(void);
54
624760a Implement telephony plugin support for terminate call (AT+CHUP)
Johan Hedberg authored
55 int telephony_terminate_call(void);
56
09c1b1a Add a telephony_ready callback to notify initialization completion
Johan Hedberg authored
57 int telephony_ready(uint32_t features, struct indicator *indicators, int rh);
58
1b971b0 Implement last number dialed (AT+BLDN) support
Johan Hedberg authored
59 /* Helper function for quick indicator updates */
60 static inline int telephony_update_indicator(struct indicator *indicators,
61 const char *desc,
62 int new_val)
63 {
64 int i;
65 struct indicator *ind = NULL;
66
67 for (i = 0; indicators[i].desc != NULL; i++) {
68 if (g_str_equal(indicators[i].desc, desc)) {
69 ind = &indicators[i];
70 break;
71 }
72 }
73
74 if (!ind)
75 return -ENOENT;
76
77 ind->val = new_val;
78
79 return telephony_event_ind(i);
80 }
81
624760a Implement telephony plugin support for terminate call (AT+CHUP)
Johan Hedberg authored
82 static inline int telephony_get_indicator(struct indicator *indicators,
83 const char *desc)
84 {
85 int i;
86
87 for (i = 0; indicators[i].desc != NULL; i++) {
88 if (g_str_equal(indicators[i].desc, desc))
89 return indicators[i].val;
90 }
91
92 return -ENOENT;
93 }
94
af10dc7 @holtmann Reorder some functions
holtmann authored
95 int telephony_init(void);
96 void telephony_exit(void);
Something went wrong with that request. Please try again.