summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2014-03-19 10:24:57 -0500
committerDenis Kenzior <denkenz@gmail.com>2014-03-19 10:24:57 -0500
commit29fefe6450473b135998a3c05449ee2b64ea3739 (patch)
treea178547e4d20b39b555aa7c2ef4db3be5d6a10ef
parent65e6df8e50d26c0efd8621f494eb56a7d6788fe3 (diff)
downloadofono-29fefe6450473b135998a3c05449ee2b64ea3739.tar.bz2
hfp: Use enum from hfp.h
-rw-r--r--drivers/hfpmodem/slc.c14
-rw-r--r--drivers/hfpmodem/slc.h8
-rw-r--r--drivers/hfpmodem/voicecall.c17
3 files changed, 16 insertions, 23 deletions
diff --git a/drivers/hfpmodem/slc.c b/drivers/hfpmodem/slc.c
index 12659227..34f2d5c0 100644
--- a/drivers/hfpmodem/slc.c
+++ b/drivers/hfpmodem/slc.c
@@ -128,19 +128,19 @@ static void chld_cb(gboolean ok, GAtResult *result, gpointer user_data)
while (g_at_result_iter_next_unquoted_string(&iter, &str)) {
if (!strcmp(str, "0"))
- ag_mpty_feature |= AG_CHLD_0;
+ ag_mpty_feature |= HFP_AG_CHLD_0;
else if (!strcmp(str, "1"))
- ag_mpty_feature |= AG_CHLD_1;
+ ag_mpty_feature |= HFP_AG_CHLD_1;
else if (!strcmp(str, "1x"))
- ag_mpty_feature |= AG_CHLD_1x;
+ ag_mpty_feature |= HFP_AG_CHLD_1x;
else if (!strcmp(str, "2"))
- ag_mpty_feature |= AG_CHLD_2;
+ ag_mpty_feature |= HFP_AG_CHLD_2;
else if (!strcmp(str, "2x"))
- ag_mpty_feature |= AG_CHLD_2x;
+ ag_mpty_feature |= HFP_AG_CHLD_2x;
else if (!strcmp(str, "3"))
- ag_mpty_feature |= AG_CHLD_3;
+ ag_mpty_feature |= HFP_AG_CHLD_3;
else if (!strcmp(str, "4"))
- ag_mpty_feature |= AG_CHLD_4;
+ ag_mpty_feature |= HFP_AG_CHLD_4;
}
if (!g_at_result_iter_close_list(&iter))
diff --git a/drivers/hfpmodem/slc.h b/drivers/hfpmodem/slc.h
index dd6f9268..fe98d999 100644
--- a/drivers/hfpmodem/slc.h
+++ b/drivers/hfpmodem/slc.h
@@ -19,14 +19,6 @@
*
*/
-#define AG_CHLD_0 0x01
-#define AG_CHLD_1 0x02
-#define AG_CHLD_1x 0x04
-#define AG_CHLD_2 0x08
-#define AG_CHLD_2x 0x10
-#define AG_CHLD_3 0x20
-#define AG_CHLD_4 0x40
-
enum hfp_indicator {
HFP_INDICATOR_SERVICE = 0,
HFP_INDICATOR_CALL,
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index 5836b8b1..212684a3 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -37,6 +37,7 @@
#include <ofono/voicecall.h>
#include "common.h"
+#include "hfp.h"
#include "hfpmodem.h"
#include "slc.h"
@@ -447,7 +448,7 @@ static void hfp_hold_all_active(struct ofono_voicecall *vc,
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
- if (vd->ag_mpty_features & AG_CHLD_2) {
+ if (vd->ag_mpty_features & HFP_AG_CHLD_2) {
hfp_template("AT+CHLD=2", vc, generic_cb, 0, cb, data);
return;
}
@@ -461,7 +462,7 @@ static void hfp_release_all_held(struct ofono_voicecall *vc,
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
unsigned int held_status = 1 << CALL_STATUS_HELD;
- if (vd->ag_mpty_features & AG_CHLD_0) {
+ if (vd->ag_mpty_features & HFP_AG_CHLD_0) {
hfp_template("AT+CHLD=0", vc, generic_cb, held_status,
cb, data);
return;
@@ -476,7 +477,7 @@ static void hfp_set_udub(struct ofono_voicecall *vc,
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
unsigned int incoming_or_waiting = 1 << CALL_STATUS_WAITING;
- if (vd->ag_mpty_features & AG_CHLD_0) {
+ if (vd->ag_mpty_features & HFP_AG_CHLD_0) {
hfp_template("AT+CHLD=0", vc, generic_cb, incoming_or_waiting,
cb, data);
return;
@@ -528,7 +529,7 @@ static void hfp_release_all_active(struct ofono_voicecall *vc,
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
- if (vd->ag_mpty_features & AG_CHLD_1) {
+ if (vd->ag_mpty_features & HFP_AG_CHLD_1) {
hfp_template("AT+CHLD=1", vc, release_all_active_cb, 0x1, cb,
data);
return;
@@ -559,7 +560,7 @@ static void hfp_release_specific(struct ofono_voicecall *vc, int id,
struct release_id_req *req = NULL;
char buf[32];
- if (!(vd->ag_mpty_features & AG_CHLD_1x))
+ if (!(vd->ag_mpty_features & HFP_AG_CHLD_1x))
goto error;
req = g_try_new0(struct release_id_req, 1);
@@ -590,7 +591,7 @@ static void hfp_private_chat(struct ofono_voicecall *vc, int id,
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
char buf[32];
- if (vd->ag_mpty_features & AG_CHLD_2x) {
+ if (vd->ag_mpty_features & HFP_AG_CHLD_2x) {
snprintf(buf, sizeof(buf), "AT+CHLD=2%d", id);
hfp_template(buf, vc, generic_cb, 0, cb, data);
@@ -606,7 +607,7 @@ static void hfp_create_multiparty(struct ofono_voicecall *vc,
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
- if (vd->ag_mpty_features & AG_CHLD_3) {
+ if (vd->ag_mpty_features & HFP_AG_CHLD_3) {
hfp_template("AT+CHLD=3", vc, generic_cb, 0, cb, data);
return;
@@ -625,7 +626,7 @@ static void hfp_transfer(struct ofono_voicecall *vc,
*/
unsigned int transfer = 0x1 | 0x2 | 0x4 | 0x8;
- if (vd->ag_mpty_features & AG_CHLD_4) {
+ if (vd->ag_mpty_features & HFP_AG_CHLD_4) {
hfp_template("AT+CHLD=4", vc, generic_cb, transfer, cb, data);
return;