telit: use CIND "rssi" indicator instead of "signal"

"signal" indicator permanently reports 99 (not measurable).
This commit is contained in:
Christopher Vogl 2011-12-15 14:34:41 +01:00 committed by Denis Kenzior
parent fb009fafd6
commit 750658f23f
1 changed files with 5 additions and 2 deletions

View File

@ -1288,6 +1288,7 @@ static void cind_support_cb(gboolean ok, GAtResult *result, gpointer user_data)
struct netreg_data *nd = ofono_netreg_get_data(netreg); struct netreg_data *nd = ofono_netreg_get_data(netreg);
GAtResultIter iter; GAtResultIter iter;
const char *str; const char *str;
char *signal_identifier = "signal";
int index; int index;
int min = 0; int min = 0;
int max = 0; int max = 0;
@ -1306,8 +1307,10 @@ static void cind_support_cb(gboolean ok, GAtResult *result, gpointer user_data)
* Telit encapsulates the CIND=? tokens with braces * Telit encapsulates the CIND=? tokens with braces
* so we need to skip them * so we need to skip them
*/ */
if (nd->vendor == OFONO_VENDOR_TELIT) if (nd->vendor == OFONO_VENDOR_TELIT) {
g_at_result_iter_open_list(&iter); g_at_result_iter_open_list(&iter);
signal_identifier = "rssi";
}
while (g_at_result_iter_open_list(&iter)) { while (g_at_result_iter_open_list(&iter)) {
/* Reset invalid default value for every token */ /* Reset invalid default value for every token */
@ -1333,7 +1336,7 @@ static void cind_support_cb(gboolean ok, GAtResult *result, gpointer user_data)
if (!g_at_result_iter_close_list(&iter)) if (!g_at_result_iter_close_list(&iter))
goto error; goto error;
if (g_str_equal("signal", str) == TRUE) { if (g_str_equal(signal_identifier, str) == TRUE) {
nd->signal_index = index; nd->signal_index = index;
nd->signal_min = min; nd->signal_min = min;
nd->signal_max = max; nd->signal_max = max;