diff options
author | Zhenhua Zhang <zhenhua.zhang@intel.com> | 2009-12-09 10:16:53 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-12-09 02:36:43 -0600 |
commit | 7f9e4038a2a76310c53396003e45107c8c476ec5 (patch) | |
tree | e182401c5ae105a720deefdc92c556dfe8c6d7b4 /drivers/hfpmodem/voicecall.c | |
parent | 5dbb2f424a33d387e4602c790fd8fd4e9f18ae87 (diff) | |
download | ofono-7f9e4038a2a76310c53396003e45107c8c476ec5.tar.bz2 |
Add multiparty call support for hfpmodem
Add CHLD=3, 2x and 4 to create multiparty call, private chat and
call transfer.
Diffstat (limited to 'drivers/hfpmodem/voicecall.c')
-rw-r--r-- | drivers/hfpmodem/voicecall.c | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c index 88c332d8..b619dc0d 100644 --- a/drivers/hfpmodem/voicecall.c +++ b/drivers/hfpmodem/voicecall.c @@ -501,6 +501,56 @@ error: CALLBACK_WITH_FAILURE(cb, data); } +static void hfp_private_chat(struct ofono_voicecall *vc, int id, + ofono_voicecall_cb_t cb, void *data) +{ + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + char buf[32]; + + if (vd->ag_mpty_features & AG_CHLD_2x) { + sprintf(buf, "AT+CHLD=2%d", id); + + hfp_template(buf, vc, generic_cb, 0, cb, data); + + return; + } + + CALLBACK_WITH_FAILURE(cb, data); +} + +static void hfp_create_multiparty(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + + if (vd->ag_mpty_features & AG_CHLD_3) { + hfp_template("AT+CHLD=3", vc, generic_cb, 0, cb, data); + + return; + } + + CALLBACK_WITH_FAILURE(cb, data); +} + +static void hfp_transfer(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + /* Transfer can puts held & active calls together and disconnects + * from both. However, some networks support transfering of + * dialing/ringing calls as well. + */ + unsigned int transfer = 0x1 | 0x2 | 0x4 | 0x8; + + if (vd->ag_mpty_features & AG_CHLD_4) { + hfp_template("AT+CHLD=4", vc, generic_cb, transfer, cb, data); + + return; + } + + CALLBACK_WITH_FAILURE(cb, data); +} + static void hfp_send_dtmf(struct ofono_voicecall *vc, const char *dtmf, ofono_voicecall_cb_t cb, void *data) { @@ -1059,9 +1109,9 @@ static struct ofono_voicecall_driver driver = { .set_udub = hfp_set_udub, .release_all_active = hfp_release_all_active, .release_specific = hfp_release_specific, - .private_chat = NULL, - .create_multiparty = NULL, - .transfer = NULL, + .private_chat = hfp_private_chat, + .create_multiparty = hfp_create_multiparty, + .transfer = hfp_transfer, .deflect = NULL, .swap_without_accept = NULL, .send_tones = hfp_send_dtmf |