• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 
6 #ifndef CRAS_TELEPHONY_H_
7 #define CRAS_TELEPHONY_H_
8 
9 #include <dbus/dbus.h>
10 
11 /* Handle object to hold required info to handle telephony status which
12  * is required for responsing HFP query commands.
13  * Args:
14  *    call - standard call status indicator, where
15  *        0: no call active
16  *        1: call is active
17  *    callsetup - call set up status indicator.
18  *        0: not currently in call set up
19  *        1: an incoming call prcess ongoing
20  *        2: an outgoing call set up is ongoing
21  *    callhold - call hold status indicator.
22  *        0: no call hold
23  *        1: call is placed on hold or active/held calls swapped
24  *           (The AG has both and active AND a held call)
25  *        2: call on hold, no active call
26  *    dial_number - phone number, used on fake memory storage and last phone
27  *    number storage.
28  *    dbus_conn - dus connetion which is used in whole telephony module.
29  */
30 struct cras_telephony_handle {
31 	int call;
32 	int callsetup;
33 	int callheld;
34 	char *dial_number;
35 
36 	DBusConnection *dbus_conn;
37 };
38 
39 void cras_telephony_start(DBusConnection *conn);
40 
41 void cras_telephony_stop();
42 
43 struct cras_telephony_handle *cras_telephony_get();
44 
45 /* Stores dial number in telephony module. */
46 void cras_telephony_store_dial_number(int len, const char *num);
47 
48 /* Handles answer call event from dbus or HF */
49 int cras_telephony_event_answer_call();
50 
51 /* Handles answer call event from dbus or HF */
52 int cras_telephony_event_terminate_call();
53 
54 #endif /* CRAS_TELEPHONY_H_ */
55