aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2016-10-05 13:32:41 +0200
committerAleksander Morgado <aleksander@aleksander.es>2016-10-12 13:24:08 +0200
commitfe460b2f54b6a035a207815252fe87ee3a06351c (patch)
treed58b5312284d7fe4f0d5af29bd15e53595165cce /src/mm-modem-helpers.c
parenta561f6edf0317ee4eb86e6811cd8cd5a7fbf5e60 (diff)
3gpp: update registration state enumeration with CSFB related states
Introduce "sms only" and "CSFB not preferred" home/roaming states to be reported for the CS context, while already registered on LTE. Based on 3GPP TS 27.007 v13.5.0.
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r--src/mm-modem-helpers.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index 8f208000..1d17c05d 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -1428,7 +1428,7 @@ mm_3gpp_parse_creg_response (GMatchInfo *info,
/* Status */
str = g_match_info_fetch (info, istat);
- stat = parse_uint (str, 10, 0, 5, &success);
+ stat = parse_uint (str, 10, 0, G_MAXUINT, &success);
g_free (str);
if (!success) {
g_set_error_literal (error,
@@ -1437,6 +1437,12 @@ mm_3gpp_parse_creg_response (GMatchInfo *info,
return FALSE;
}
+ /* 'roaming (csfb not preferred)' is the last valid state */
+ if (stat > MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED) {
+ mm_warn ("Registration State '%lu' is unknown", stat);
+ stat = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
+ }
+
/* Location Area Code */
if (ilac) {
/* FIXME: some phones apparently swap the LAC bytes (LG, SonyEricsson,
@@ -1463,12 +1469,6 @@ mm_3gpp_parse_creg_response (GMatchInfo *info,
act = -1;
}
- /* 'roaming' is the last valid state */
- if (stat > MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
- mm_warn ("Registration State '%lu' is unknown", stat);
- stat = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
- }
-
*out_reg_state = (MMModem3gppRegistrationState) stat;
if (stat != MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN) {
/* Don't fill in lac/ci/act if the device's state is unknown */