mirror of git://git.sysmocom.de/ofono
Add support for handling CNTI=0 request with Novatel devices
This commit is contained in:
parent
197d2c08bd
commit
45bf4cf396
|
@ -120,6 +120,17 @@ static void at_gprs_registration_status(struct ofono_gprs *gprs,
|
||||||
|
|
||||||
cbd->user = gd;
|
cbd->user = gd;
|
||||||
|
|
||||||
|
switch (gd->vendor) {
|
||||||
|
case OFONO_VENDOR_NOVATEL:
|
||||||
|
/*
|
||||||
|
* Send $CNTI=0 to find out the current tech, it will be
|
||||||
|
* intercepted in nw_cnti_notify in network registration
|
||||||
|
*/
|
||||||
|
g_at_chat_send(gd->chat, "AT$CNTI=0", none_prefix,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_at_chat_send(gd->chat, "AT+CGREG?", cgreg_prefix,
|
if (g_at_chat_send(gd->chat, "AT+CGREG?", cgreg_prefix,
|
||||||
at_cgreg_cb, cbd, g_free) > 0)
|
at_cgreg_cb, cbd, g_free) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -108,13 +108,24 @@ static void at_registration_status(struct ofono_netreg *netreg,
|
||||||
|
|
||||||
cbd->user = nd;
|
cbd->user = nd;
|
||||||
|
|
||||||
/*
|
switch (nd->vendor) {
|
||||||
* Send *ERINFO to find out the current tech, it will be intercepted
|
case OFONO_VENDOR_MBM:
|
||||||
* in mbm_erinfo_notify
|
/*
|
||||||
*/
|
* Send *ERINFO to find out the current tech, it will be
|
||||||
if (nd->vendor == OFONO_VENDOR_MBM)
|
* intercepted in mbm_erinfo_notify
|
||||||
|
*/
|
||||||
g_at_chat_send(nd->chat, "AT*ERINFO?", none_prefix,
|
g_at_chat_send(nd->chat, "AT*ERINFO?", none_prefix,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
break;
|
||||||
|
case OFONO_VENDOR_NOVATEL:
|
||||||
|
/*
|
||||||
|
* Send $CNTI=0 to find out the current tech, it will be
|
||||||
|
* intercepted in nw_cnti_notify
|
||||||
|
*/
|
||||||
|
g_at_chat_send(nd->chat, "AT$CNTI=0", none_prefix,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_at_chat_send(nd->chat, "AT+CREG?", creg_prefix,
|
if (g_at_chat_send(nd->chat, "AT+CREG?", creg_prefix,
|
||||||
at_creg_cb, cbd, g_free) > 0)
|
at_creg_cb, cbd, g_free) > 0)
|
||||||
|
@ -744,6 +755,31 @@ static void mbm_erinfo_notify(GAtResult *result, gpointer user_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void nw_cnti_notify(GAtResult *result, gpointer user_data)
|
||||||
|
{
|
||||||
|
//struct ofono_netreg *netreg = user_data;
|
||||||
|
//struct netreg_data *nd = ofono_netreg_get_data(netreg);
|
||||||
|
GAtResultIter iter;
|
||||||
|
const char *tech;
|
||||||
|
int option;
|
||||||
|
|
||||||
|
g_at_result_iter_init(&iter, result);
|
||||||
|
|
||||||
|
if (g_at_result_iter_next(&iter, "$CNTI:") == FALSE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (g_at_result_iter_next_number(&iter, &option) == FALSE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (option != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (g_at_result_iter_next_unquoted_string(&iter, &tech) == FALSE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ofono_info("CNTI: %s", tech);
|
||||||
|
}
|
||||||
|
|
||||||
static void creg_notify(GAtResult *result, gpointer user_data)
|
static void creg_notify(GAtResult *result, gpointer user_data)
|
||||||
{
|
{
|
||||||
struct ofono_netreg *netreg = user_data;
|
struct ofono_netreg *netreg = user_data;
|
||||||
|
@ -847,12 +883,6 @@ static void at_creg_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
g_at_chat_register(nd->chat, "%CSQ:", calypso_csq_notify,
|
g_at_chat_register(nd->chat, "%CSQ:", calypso_csq_notify,
|
||||||
FALSE, netreg, NULL);
|
FALSE, netreg, NULL);
|
||||||
break;
|
break;
|
||||||
case OFONO_VENDOR_NOVATEL:
|
|
||||||
g_at_chat_send(nd->chat, "AT$NWCSQ", none_prefix,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
g_at_chat_send(nd->chat, "AT$CNTI=0", none_prefix,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
break;
|
|
||||||
case OFONO_VENDOR_OPTION_HSO:
|
case OFONO_VENDOR_OPTION_HSO:
|
||||||
g_at_chat_send(nd->chat, "AT_OSSYS=1", none_prefix,
|
g_at_chat_send(nd->chat, "AT_OSSYS=1", none_prefix,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
@ -905,6 +935,15 @@ static void at_creg_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
g_at_chat_send(nd->chat, "AT+CIND=?", cind_prefix,
|
g_at_chat_send(nd->chat, "AT+CIND=?", cind_prefix,
|
||||||
cind_support_cb, netreg, NULL);
|
cind_support_cb, netreg, NULL);
|
||||||
return;
|
return;
|
||||||
|
case OFONO_VENDOR_NOVATEL:
|
||||||
|
/*
|
||||||
|
* Novatel doesn't support unsolicited notifications
|
||||||
|
* of technology changes, but register a handle for
|
||||||
|
* CNTI so we get notified by any query.
|
||||||
|
*/
|
||||||
|
g_at_chat_register(nd->chat, "$CNTI:", nw_cnti_notify,
|
||||||
|
FALSE, netreg, NULL);
|
||||||
|
break;
|
||||||
case OFONO_VENDOR_HUAWEI:
|
case OFONO_VENDOR_HUAWEI:
|
||||||
/*
|
/*
|
||||||
* Huawei doesn't support CIND, signal strength reported
|
* Huawei doesn't support CIND, signal strength reported
|
||||||
|
|
Loading…
Reference in New Issue