diff --git a/docs/reference/api/ModemManager-dbus-reference.xml b/docs/reference/api/ModemManager-dbus-reference.xml index d6237242..815b0628 100644 --- a/docs/reference/api/ModemManager-dbus-reference.xml +++ b/docs/reference/api/ModemManager-dbus-reference.xml @@ -92,7 +92,7 @@ This object also controls any process-wide operation, such as the log level being used by the daemon. - + @@ -129,22 +129,22 @@ or the CDMA interface. - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -155,7 +155,7 @@ may expose one or more Bearer objects, which can then be used to get the modem into connected state. - + @@ -166,7 +166,7 @@ expose up to one SIM object, which allows SIM-specific actions such as PIN unlocking. - + @@ -176,7 +176,7 @@ Messaging interface will export one SMS object for each SMS stored in the device. - + @@ -186,17 +186,17 @@ Voice interface will export one Call object for each Call managed in the device. - + - + The <literal>/org/freedesktop/ModemManager/CBM</literal> objects Modems implementing the Cell Broadcast interface will export one CBM object for each Cell Broadcast message received by the device. - + diff --git a/docs/reference/api/meson.build b/docs/reference/api/meson.build index d7c420c7..2c02648a 100644 --- a/docs/reference/api/meson.build +++ b/docs/reference/api/meson.build @@ -22,6 +22,9 @@ expand_content_files = [ 'ModemManager-overview.xml', # FIXME: workaround because only strings can be included and not custom targets (gen_docs) generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml', + generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Call.xml', + generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Cbm.xml', + generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.CellBroadcast.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml', @@ -30,9 +33,11 @@ expand_content_files = [ generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml', + generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Sar.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml', + generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Voice.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sim.xml', generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml', diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 407b6622..6eb04fe2 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -768,11 +768,14 @@ parse_caps_cgmm (MMBaseModem *self, if (!response) return MM_BASE_MODEM_AT_RESPONSE_PROCESSOR_RESULT_CONTINUE; - /* This check detects some really old Motorola GPRS dongles and phones */ + /* This check detects some really old Motorola and Mediatek GPRS dongles + * and phones. + */ if (strstr (response, "GSM900") || strstr (response, "GSM1800") || strstr (response, "GSM1900") || - strstr (response, "GSM850")) { + strstr (response, "GSM850") || + strstr (response, "MTK2")) { /* At least, it's a GSM modem */ *result = g_variant_new_uint32 (MM_MODEM_CAPABILITY_GSM_UMTS); return MM_BASE_MODEM_AT_RESPONSE_PROCESSOR_RESULT_SUCCESS; @@ -5591,6 +5594,21 @@ modem_3gpp_run_registration_checks_finish (MMIfaceModem3gpp *self, return g_task_propagate_boolean (G_TASK (res), error); } +static void +run_registration_checks_reload_current_registration_info_ready (MMIfaceModem3gpp *modem, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + mm_iface_modem_3gpp_reload_current_registration_info_finish (modem, res, &error); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + static void run_registration_checks_context_step (GTask *task); static void @@ -5832,13 +5850,17 @@ run_registration_checks_context_step (GTask *task) error = g_steal_pointer (&ctx->error_cs); else g_assert_not_reached (); + + g_task_return_error (task, error); + g_object_unref (task); + return; } - if (error) - g_task_return_error (task, error); - else - g_task_return_boolean (task, TRUE); - g_object_unref (task); + /* When everything is done, recheck operator info as it may have changed */ + mm_iface_modem_3gpp_reload_current_registration_info ( + MM_IFACE_MODEM_3GPP (self), + (GAsyncReadyCallback)run_registration_checks_reload_current_registration_info_ready, + task); } static void diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c index 63a960f1..01519bc3 100644 --- a/src/mm-iface-modem-voice.c +++ b/src/mm-iface-modem-voice.c @@ -32,6 +32,10 @@ static GQuark in_call_event_context_quark; G_DEFINE_INTERFACE (MMIfaceModemVoice, mm_iface_modem_voice, MM_TYPE_IFACE_MODEM) +static void setup_call_list_polling (MMCallList *call_list, + const gchar *call_path_added, + MMIfaceModemVoice *self); + /*****************************************************************************/ void @@ -1781,6 +1785,7 @@ typedef enum { IN_CALL_SETUP_STEP_FIRST, IN_CALL_SETUP_STEP_UNSOLICITED_EVENTS, IN_CALL_SETUP_STEP_AUDIO_CHANNEL, + IN_CALL_SETUP_STEP_CHECK_POLLING, IN_CALL_SETUP_STEP_LAST, } InCallSetupStep; @@ -1908,6 +1913,10 @@ in_call_setup_context_step (GTask *task) } ctx->step++; /* fall-through */ + case IN_CALL_SETUP_STEP_CHECK_POLLING: + setup_call_list_polling (NULL, NULL, self); + ctx->step++; + /* fall-through */ case IN_CALL_SETUP_STEP_LAST: g_task_return_boolean (task, TRUE); g_object_unref (task); diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 4f0c6248..574ec7fc 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -1218,8 +1218,9 @@ get_mm_access_tech_from_etsi_access_tech (guint val, return MM_MODEM_ACCESS_TECHNOLOGY_HSUPA; case 6: return MM_MODEM_ACCESS_TECHNOLOGY_HSPA; - case 7: /* E-UTRAN */ case 9: /* E-UTRAN (NB-S1) */ + return MM_MODEM_ACCESS_TECHNOLOGY_LTE_NB_IOT; + case 7: /* E-UTRAN */ case 10: /* E-UTRA connected to a 5GCN */ return MM_MODEM_ACCESS_TECHNOLOGY_LTE; case 11: /* NR connected to a 5G CN */ @@ -4160,11 +4161,11 @@ mm_string_to_access_tech (const gchar *string) * are included in other strings too. */ len = strlen (string); - if (strncmp (string, "EVDO", 4) && (len >= 4 && !isalnum (string[4]))) + if (!strncmp (string, "EVDO", 4) && (len >= 4 && !isalnum (string[4]))) act |= MM_MODEM_ACCESS_TECHNOLOGY_EVDO0; - if (strncmp (string, "CDMA", 4) && (len >= 4 && !isalnum (string[4]))) + if (!strncmp (string, "CDMA", 4) && (len >= 4 && !isalnum (string[4]))) act |= MM_MODEM_ACCESS_TECHNOLOGY_1XRTT; - if (strncmp (string, "CDMA-EVDO", 9) && (len >= 9 && !isalnum (string[9]))) + if (!strncmp (string, "CDMA-EVDO", 9) && (len >= 9 && !isalnum (string[9]))) act |= MM_MODEM_ACCESS_TECHNOLOGY_1XRTT | MM_MODEM_ACCESS_TECHNOLOGY_EVDO0; return act; diff --git a/src/plugins/cinterion/mm-modem-helpers-cinterion.c b/src/plugins/cinterion/mm-modem-helpers-cinterion.c index b2ef89a9..53f4cff4 100644 --- a/src/plugins/cinterion/mm-modem-helpers-cinterion.c +++ b/src/plugins/cinterion/mm-modem-helpers-cinterion.c @@ -794,7 +794,7 @@ mm_cinterion_parse_sxrat_test (const gchar *response, return FALSE; } - r = g_regex_new ("\\^SXRAT:\\s*\\(([^\\)]*)\\),\\(([^\\)]*)\\)(,\\(([^\\)]*)\\))?(?:\\r\\n)?", + r = g_regex_new ("\\^SXRAT:\\s*\\(([^\\)]*)\\),\\s*\\(([^\\)]*)\\)(,\\s*\\(([^\\)]*)\\))?(?:\\r\\n)?", G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW, 0, NULL); diff --git a/src/plugins/cinterion/tests/test-modem-helpers-cinterion.c b/src/plugins/cinterion/tests/test-modem-helpers-cinterion.c index e5857ede..2f6e3d10 100644 --- a/src/plugins/cinterion/tests/test-modem-helpers-cinterion.c +++ b/src/plugins/cinterion/tests/test-modem-helpers-cinterion.c @@ -1826,6 +1826,38 @@ test_sxrat_response_els61 (void) g_array_unref (expected_pref2); } +static void +test_sxrat_response_pls63_w (void) +{ + GArray *expected_rat; + GArray *expected_pref1; + GArray *expected_pref2; + const guint vals[] = { 0, 2, 3 }; + guint val; + const gchar *response = + "^SXRAT: (0-6), (0,2,3), (0,2,3)\r\n" + "\r\n"; + + expected_rat = g_array_sized_new (FALSE, FALSE, sizeof (guint), 7); + for (val = 0; val < 7; val++) + g_array_append_val (expected_rat, val); + + expected_pref1 = g_array_sized_new (FALSE, FALSE, sizeof (guint), 3); + g_array_append_vals (expected_pref1, &vals, 3); + + expected_pref2 = g_array_sized_new (FALSE, FALSE, sizeof (guint), 3); + g_array_append_vals (expected_pref2, &vals, 3); + + common_test_sxrat (response, + expected_rat, + expected_pref1, + expected_pref2); + + g_array_unref (expected_rat); + g_array_unref (expected_pref1); + g_array_unref (expected_pref2); +} + static void test_sxrat_response_other (void) { @@ -2177,6 +2209,7 @@ int main (int argc, char **argv) g_test_add_func ("/MM/cinterion/sgauth", test_sgauth_response); g_test_add_func ("/MM/cinterion/sxrat", test_sxrat); g_test_add_func ("/MM/cinterion/sxrat/response/els61", test_sxrat_response_els61); + g_test_add_func ("/MM/cinterion/sxrat/response/pls63w", test_sxrat_response_pls63_w); g_test_add_func ("/MM/cinterion/sxrat/response/other", test_sxrat_response_other); g_test_add_func ("/MM/cinterion/cops/only-mode-2g", test_cops_only_mode_2g); g_test_add_func ("/MM/cinterion/cops/only-mode-3g", test_cops_only_mode_3g); diff --git a/src/plugins/fibocom/mm-shared-fibocom.c b/src/plugins/fibocom/mm-shared-fibocom.c index 89be09ef..0fbc9b59 100644 --- a/src/plugins/fibocom/mm-shared-fibocom.c +++ b/src/plugins/fibocom/mm-shared-fibocom.c @@ -75,8 +75,8 @@ get_private (MMSharedFibocom *self) priv->class_parent = MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_class (self); /* Setup firmware interface of parent class */ - g_assert (MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_firmware_interface); - priv->iface_modem_firmware_parent = MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_firmware_interface (self); + if (MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_firmware_interface) + priv->iface_modem_firmware_parent = MM_SHARED_FIBOCOM_GET_IFACE (self)->peek_parent_firmware_interface (self); g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free); } diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c index 6692e56d..6836bbdd 100644 --- a/src/tests/test-modem-helpers.c +++ b/src/tests/test-modem-helpers.c @@ -4866,6 +4866,29 @@ test_mnc_length (void) /*****************************************************************************/ +typedef struct { + const gchar *str; + const MMModemAccessTechnology act; +} TestActData; + +static const TestActData test_act_data[] = { + { "EDGE", MM_MODEM_ACCESS_TECHNOLOGY_EDGE }, + /* Ensure WCDMA does not get counted as 3GPP2 CDMA */ + { "WCDMA", MM_MODEM_ACCESS_TECHNOLOGY_UMTS }, + { "CDMA-EVDO", MM_MODEM_ACCESS_TECHNOLOGY_1XRTT | MM_MODEM_ACCESS_TECHNOLOGY_EVDO0 }, +}; + +static void +test_string_to_access_tech (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (test_act_data); i++) + g_assert_cmpint (mm_string_to_access_tech (test_act_data[i].str), ==, test_act_data[i].act); +} + +/*****************************************************************************/ + #define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (GTestFixtureFunc) t, NULL) int main (int argc, char **argv) @@ -5111,6 +5134,8 @@ int main (int argc, char **argv) g_test_suite_add (suite, TESTCASE (test_spn_to_utf8, NULL)); g_test_suite_add (suite, TESTCASE (test_mnc_length, NULL)); + g_test_suite_add (suite, TESTCASE (test_string_to_access_tech, NULL)); + result = g_test_run (); reg_test_data_free (reg_data);