From 7e94928301a971488ea53b17dd7d5ef37f468b1d Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 3 Apr 2018 00:31:02 +0200 Subject: [PATCH] ublox: fix 'any' mode building The 'any' mode refers to the mode which includes most access technologies and where none of them is preferred. Fix the logic so that all combinations with one technology preferred over the others are ignored, instead of the other way around. Fixes assertion with the 4G-only LARA R204. ModemManager[424]: [-192499452.090358] (ttyACM0): --> 'AT+URAT=?' ModemManager[424]: [-192499452.092150] (ttyACM0): <-- '+URAT: (3)OK' ** ERROR:ublox/mm-modem-helpers-ublox.c:817:mm_ublox_get_modem_mode_any: assertion failed: (any != MM_MODEM_MODE_NONE) Reported-by: Matthew Starr --- plugins/ublox/mm-modem-helpers-ublox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ublox/mm-modem-helpers-ublox.c b/plugins/ublox/mm-modem-helpers-ublox.c index b0b4bf3e..ff1a8488 100644 --- a/plugins/ublox/mm-modem-helpers-ublox.c +++ b/plugins/ublox/mm-modem-helpers-ublox.c @@ -802,7 +802,7 @@ mm_ublox_get_modem_mode_any (const GArray *combinations) guint bits_set; combination = &g_array_index (combinations, MMModemModeCombination, i); - if (combination->preferred == MM_MODEM_MODE_NONE) + if (combination->preferred != MM_MODEM_MODE_NONE) continue; bits_set = mm_count_bits_set (combination->allowed); if (bits_set > any_bits_set) {