diff options
author | Marit Henriksen <marit.henriksen@stericsson.com> | 2011-02-03 14:15:45 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-02-03 10:19:31 -0600 |
commit | aad3b22924a80961a6fe4b5f1f8fa7cae19663b5 (patch) | |
tree | 4eb2095c6826109b38c98af9527884af0349d67e /drivers/stemodem/voicecall.c | |
parent | c1603c77ccc4c5c99f1c10401acff9ad6cfb6296 (diff) | |
download | ofono-aad3b22924a80961a6fe4b5f1f8fa7cae19663b5.tar.bz2 |
stemodem: Fix handling of local_release
- Reset local_release when call is disconnected.
- Change bitmap for affected types, ste_hangup is only called when
call state is Incoming, Dialing, Alerting or Active.
- Used macros instead of numbers when creating bitmaps.
Diffstat (limited to 'drivers/stemodem/voicecall.c')
-rw-r--r-- | drivers/stemodem/voicecall.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c index 7b2ede27..dde13872 100644 --- a/drivers/stemodem/voicecall.c +++ b/drivers/stemodem/voicecall.c @@ -254,7 +254,12 @@ static void ste_answer(struct ofono_voicecall *vc, static void ste_hangup(struct ofono_voicecall *vc, ofono_voicecall_cb_t cb, void *data) { - ste_template("AT+CHUP", vc, ste_generic_cb, 0x3f, cb, data); + unsigned int active_dial_alert_or_incoming = + (0x1 << CALL_STATUS_ACTIVE) | (0x1 << CALL_STATUS_DIALING) | + (0x1 << CALL_STATUS_ALERTING) | (0x1 << CALL_STATUS_INCOMING); + + ste_template("AT+CHUP", vc, ste_generic_cb, + active_dial_alert_or_incoming, cb, data); } static void ste_hold_all_active(struct ofono_voicecall *vc, @@ -266,14 +271,17 @@ static void ste_hold_all_active(struct ofono_voicecall *vc, static void ste_release_all_held(struct ofono_voicecall *vc, ofono_voicecall_cb_t cb, void *data) { - unsigned int held_status = 0x1 << 1; - ste_template("AT+CHLD=0", vc, ste_generic_cb, held_status, cb, data); + unsigned int held = 0x1 << CALL_STATUS_HELD; + + ste_template("AT+CHLD=0", vc, ste_generic_cb, held, cb, data); } static void ste_set_udub(struct ofono_voicecall *vc, ofono_voicecall_cb_t cb, void *data) { - unsigned int incoming_or_waiting = (0x1 << 4) | (0x1 << 5); + unsigned int incoming_or_waiting = + (0x1 << CALL_STATUS_INCOMING) | (0x1 << CALL_STATUS_WAITING); + ste_template("AT+CHLD=0", vc, ste_generic_cb, incoming_or_waiting, cb, data); } @@ -281,7 +289,9 @@ static void ste_set_udub(struct ofono_voicecall *vc, static void ste_release_all_active(struct ofono_voicecall *vc, ofono_voicecall_cb_t cb, void *data) { - ste_template("AT+CHLD=1", vc, ste_generic_cb, 0x1, cb, data); + unsigned int active = 0x1 << CALL_STATUS_ACTIVE; + + ste_template("AT+CHLD=1", vc, ste_generic_cb, active, cb, data); } static void ste_release_specific(struct ofono_voicecall *vc, int id, @@ -476,6 +486,7 @@ static void ecav_notify(GAtResult *result, gpointer user_data) ofono_voicecall_disconnected(vc, existing_call->id, reason, NULL); + vd->local_release &= ~(1 << existing_call->id); vd->calls = g_slist_remove(vd->calls, l->data); break; } |