diff options
author | Denis Kenzior <denkenz@gmail.com> | 2012-07-12 14:12:55 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2012-07-12 14:12:55 -0500 |
commit | 2e51814f324e2812ec358dd8d0600b88210b06e5 (patch) | |
tree | a1dfdcb8e062d8883e4d034a64bca8dd0c176c86 /drivers/ifxmodem | |
parent | 86b6991091b2d9952011ae2fea759c6390c64718 (diff) | |
download | ofono-2e51814f324e2812ec358dd8d0600b88210b06e5.tar.bz2 |
ifx: Add CSSI and CSSU support
Diffstat (limited to 'drivers/ifxmodem')
-rw-r--r-- | drivers/ifxmodem/voicecall.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c index 13ed90b4..5d4d207f 100644 --- a/drivers/ifxmodem/voicecall.c +++ b/drivers/ifxmodem/voicecall.c @@ -894,6 +894,61 @@ static void xlema_read(gboolean ok, GAtResult *result, gpointer user_data) vd->en_list = NULL; } +static void cssi_notify(GAtResult *result, gpointer user_data) +{ + struct ofono_voicecall *vc = user_data; + GAtResultIter iter; + int code, index; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+CSSI:")) + return; + + if (!g_at_result_iter_next_number(&iter, &code)) + return; + + if (!g_at_result_iter_next_number(&iter, &index)) + index = 0; + + ofono_voicecall_ssn_mo_notify(vc, 0, code, index); +} + +static void cssu_notify(GAtResult *result, gpointer user_data) +{ + struct ofono_voicecall *vc = user_data; + GAtResultIter iter; + int code; + int index; + const char *num; + struct ofono_phone_number ph; + + ph.number[0] = '\0'; + ph.type = 129; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+CSSU:")) + return; + + if (!g_at_result_iter_next_number(&iter, &code)) + return; + + if (!g_at_result_iter_next_number_default(&iter, -1, &index)) + goto out; + + if (!g_at_result_iter_next_string(&iter, &num)) + goto out; + + strncpy(ph.number, num, OFONO_MAX_PHONE_NUMBER_LENGTH); + + if (!g_at_result_iter_next_number(&iter, &ph.type)) + return; + +out: + ofono_voicecall_ssn_mt_notify(vc, 0, code, index, &ph); +} + static void ifx_voicecall_initialized(gboolean ok, GAtResult *result, gpointer user_data) { @@ -911,6 +966,8 @@ static void ifx_voicecall_initialized(gboolean ok, GAtResult *result, FALSE, vc, NULL); g_at_chat_register(vd->chat, "+XCOLP:", xcolp_notify, FALSE, vc, NULL); g_at_chat_register(vd->chat, "+XLEMA:", xlema_notify, FALSE, vc, NULL); + g_at_chat_register(vd->chat, "+CSSI:", cssi_notify, FALSE, vc, NULL); + g_at_chat_register(vd->chat, "+CSSU:", cssu_notify, FALSE, vc, NULL); /* Enable emergency number list notification */ g_at_chat_send(vd->chat, "AT+XLEMA=1", xlema_prefix, xlema_read, vc, NULL); @@ -940,6 +997,7 @@ static int ifx_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor, g_at_chat_send(vd->chat, "AT+CRC=1", none_prefix, NULL, NULL, NULL); g_at_chat_send(vd->chat, "AT+CLIP=1", none_prefix, NULL, NULL, NULL); g_at_chat_send(vd->chat, "AT+CNAP=1", none_prefix, NULL, NULL, NULL); + g_at_chat_send(vd->chat, "AT+CSSN=1,1", none_prefix, NULL, NULL, NULL); g_at_chat_send(vd->chat, "AT+CCWA=1", none_prefix, ifx_voicecall_initialized, vc, NULL); |