diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-12-07 17:14:57 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-12-07 17:14:57 -0600 |
commit | 7c7f265ebcc3cb851cdf99376340b7f4dbecd34c (patch) | |
tree | 1679b7e019dfbac940a4854d199495316799935b | |
parent | 749930dd187bb0a46a5a4c5d479886a47f5f5958 (diff) | |
download | ofono-7c7f265ebcc3cb851cdf99376340b7f4dbecd34c.tar.bz2 |
Add experimental Option tech parsing
Option seems to implement their own commands for network technology
reporting. This is a first attempt to implement this for data gathering
purposes.
-rw-r--r-- | drivers/atmodem/network-registration.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c index a49254bb..038bda29 100644 --- a/drivers/atmodem/network-registration.c +++ b/drivers/atmodem/network-registration.c @@ -543,6 +543,54 @@ static void option_osigq_notify(GAtResult *result, gpointer user_data) report_signal_strength(netreg, strength); } +static void option_owcti_notify(GAtResult *result, gpointer user_data) +{ + int mode; + GAtResultIter iter; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "_OWCTI:")) + return; + + if (!g_at_result_iter_next_number(&iter, &mode)) + return; + + ofono_info("OWCTI mode: %d", mode); +} + +static void option_octi_notify(GAtResult *result, gpointer user_data) +{ + int mode; + GAtResultIter iter; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "_OCTI:")) + return; + + if (!g_at_result_iter_next_number(&iter, &mode)) + return; + + ofono_info("OCTI mode: %d", mode); +} + +static void option_ossysi_notify(GAtResult *result, gpointer user_data) +{ + int mode; + GAtResultIter iter; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "_OSSYSI:")) + return; + + if (!g_at_result_iter_next_number(&iter, &mode)) + return; + + ofono_info("OSSYSI mode: %d", mode); +} + static void csq_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct cb_data *cbd = user_data; @@ -659,10 +707,20 @@ static void at_network_registration_initialized(gboolean ok, GAtResult *result, break; case OFONO_VENDOR_OPTION_HSO: + g_at_chat_send(nd->chat, "AT_OSSYS=1", none_prefix, + NULL, NULL, NULL); + g_at_chat_send(nd->chat, "AT_OCTI=1", none_prefix, + NULL, NULL, NULL); g_at_chat_send(nd->chat, "AT_OSQI=1", none_prefix, NULL, NULL, NULL); g_at_chat_register(nd->chat, "_OSIGQ:", option_osigq_notify, FALSE, netreg, NULL); + g_at_chat_register(nd->chat, "_OWCTI:", option_owcti_notify, + FALSE, netreg, NULL); + g_at_chat_register(nd->chat, "_OCTI:", option_octi_notify, + FALSE, netreg, NULL); + g_at_chat_register(nd->chat, "_OSSYSI:", option_ossysi_notify, + FALSE, netreg, NULL); break; default: |