mirror of git://git.sysmocom.de/ofono
atmodem: correctly report lte bearer for huawei modems
This commit is contained in:
parent
2640e0a882
commit
b3e4837641
|
@ -327,6 +327,26 @@ static void huawei_mode_notify(GAtResult *result, gpointer user_data)
|
||||||
ofono_gprs_bearer_notify(gprs, bearer);
|
ofono_gprs_bearer_notify(gprs, bearer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void huawei_hcsq_notify(GAtResult *result, gpointer user_data)
|
||||||
|
{
|
||||||
|
struct ofono_gprs *gprs = user_data;
|
||||||
|
GAtResultIter iter;
|
||||||
|
const char *mode;
|
||||||
|
|
||||||
|
g_at_result_iter_init(&iter, result);
|
||||||
|
|
||||||
|
if (!g_at_result_iter_next(&iter, "^HCSQ:"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!g_at_result_iter_next_string(&iter, &mode))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!strcmp("LTE", mode))
|
||||||
|
ofono_gprs_bearer_notify(gprs, 7); /* LTE */
|
||||||
|
|
||||||
|
/* in other modes, notification ^MODE is used */
|
||||||
|
}
|
||||||
|
|
||||||
static void telit_mode_notify(GAtResult *result, gpointer user_data)
|
static void telit_mode_notify(GAtResult *result, gpointer user_data)
|
||||||
{
|
{
|
||||||
struct ofono_gprs *gprs = user_data;
|
struct ofono_gprs *gprs = user_data;
|
||||||
|
@ -432,6 +452,8 @@ static void gprs_initialized(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
case OFONO_VENDOR_HUAWEI:
|
case OFONO_VENDOR_HUAWEI:
|
||||||
g_at_chat_register(gd->chat, "^MODE:", huawei_mode_notify,
|
g_at_chat_register(gd->chat, "^MODE:", huawei_mode_notify,
|
||||||
FALSE, gprs, NULL);
|
FALSE, gprs, NULL);
|
||||||
|
g_at_chat_register(gd->chat, "^HCSQ:", huawei_hcsq_notify,
|
||||||
|
FALSE, gprs, NULL);
|
||||||
break;
|
break;
|
||||||
case OFONO_VENDOR_UBLOX:
|
case OFONO_VENDOR_UBLOX:
|
||||||
case OFONO_VENDOR_UBLOX_TOBY_L2:
|
case OFONO_VENDOR_UBLOX_TOBY_L2:
|
||||||
|
|
|
@ -1088,6 +1088,27 @@ static void huawei_mode_notify(GAtResult *result, gpointer user_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void huawei_hcsq_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 *mode;
|
||||||
|
|
||||||
|
g_at_result_iter_init(&iter, result);
|
||||||
|
|
||||||
|
if (!g_at_result_iter_next(&iter, "^HCSQ:"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!g_at_result_iter_next_string(&iter, &mode))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!strcmp("LTE", mode))
|
||||||
|
nd->tech = ACCESS_TECHNOLOGY_EUTRAN;
|
||||||
|
|
||||||
|
/* for other technologies, notification ^MODE is used */
|
||||||
|
}
|
||||||
|
|
||||||
static void huawei_nwtime_notify(GAtResult *result, gpointer user_data)
|
static void huawei_nwtime_notify(GAtResult *result, gpointer user_data)
|
||||||
{
|
{
|
||||||
struct ofono_netreg *netreg = user_data;
|
struct ofono_netreg *netreg = user_data;
|
||||||
|
@ -1896,6 +1917,10 @@ static void at_creg_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
g_at_chat_register(nd->chat, "^MODE:", huawei_mode_notify,
|
g_at_chat_register(nd->chat, "^MODE:", huawei_mode_notify,
|
||||||
FALSE, netreg, NULL);
|
FALSE, netreg, NULL);
|
||||||
|
|
||||||
|
/* Register for 4G system mode reports */
|
||||||
|
g_at_chat_register(nd->chat, "^HCSQ:", huawei_hcsq_notify,
|
||||||
|
FALSE, netreg, NULL);
|
||||||
|
|
||||||
/* Register for network time reports */
|
/* Register for network time reports */
|
||||||
g_at_chat_register(nd->chat, "^NWTIME:", huawei_nwtime_notify,
|
g_at_chat_register(nd->chat, "^NWTIME:", huawei_nwtime_notify,
|
||||||
FALSE, netreg, NULL);
|
FALSE, netreg, NULL);
|
||||||
|
|
Loading…
Reference in New Issue