From 969e242d72b8dc9b6d4fd75dc8ab0dcb2e3a964d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 28 Oct 2010 19:01:55 +0200 Subject: [PATCH] atmodem: Enable home zone reporting for IFX modems For the Infineon modem the AT+XHOMEZR option can be set to get informed about home zone labels. If this information is available, it it still not properly used, but it shows up in the traces for reference. --- drivers/atmodem/network-registration.c | 29 +++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c index 6472a922..a7e245f1 100644 --- a/drivers/atmodem/network-registration.c +++ b/drivers/atmodem/network-registration.c @@ -631,6 +631,23 @@ static void option_osigq_notify(GAtResult *result, gpointer user_data) at_util_convert_signal_strength(strength)); } +static void ifx_xhomezr_notify(GAtResult *result, gpointer user_data) +{ + //struct ofono_netreg *netreg = user_data; + const char *label; + GAtResultIter iter; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+XHOMEZR:")) + return; + + if (!g_at_result_iter_next_string(&iter, &label)) + return; + + ofono_info("Home zone: %s", label); +} + static void ifx_xciev_notify(GAtResult *result, gpointer user_data) { struct ofono_netreg *netreg = user_data; @@ -1176,15 +1193,21 @@ static void at_creg_set_cb(gboolean ok, GAtResult *result, gpointer user_data) case OFONO_VENDOR_IFX: /* Register for specific signal strength reports */ g_at_chat_register(nd->chat, "+XCIEV:", ifx_xciev_notify, - FALSE, netreg, NULL); + FALSE, netreg, NULL); g_at_chat_send(nd->chat, "AT+XMER=1", none_prefix, NULL, NULL, NULL); + /* Register for home zone reports */ + g_at_chat_register(nd->chat, "+XHOMEZR:", ifx_xhomezr_notify, + FALSE, netreg, NULL); + g_at_chat_send(nd->chat, "AT+XHOMEZR=1", none_prefix, + NULL, NULL, NULL); + /* Register for network time update reports */ g_at_chat_register(nd->chat, "+CTZV:", ctzv_notify, - FALSE, netreg, NULL); + FALSE, netreg, NULL); g_at_chat_register(nd->chat, "+CTZDST:", ctzdst_notify, - FALSE, netreg, NULL); + FALSE, netreg, NULL); g_at_chat_send(nd->chat, "AT+CTZR=1", none_prefix, NULL, NULL, NULL); break;