From 1b6e4c434998258c9342895593538946c11f6e05 Mon Sep 17 00:00:00 2001 From: "mank.wang" Date: Wed, 27 Sep 2023 14:10:13 +0800 Subject: quectel: avoid incorrect module version report after the upgrade After LVFS upgrade, the module needs to be restarted. ModemManager queries the module information, sometimes the module is not ready, and the information queried by "mmcli -m any --firmware-status" is incomplete, It is now modified to re query once per second when obtaining incomplete versions, up to a maximum of 16 times. Signed-off-by: mank.wang --- src/plugins/quectel/tests/test-modem-helpers-quectel.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/plugins/quectel/tests/test-modem-helpers-quectel.c') diff --git a/src/plugins/quectel/tests/test-modem-helpers-quectel.c b/src/plugins/quectel/tests/test-modem-helpers-quectel.c index 0e2c7420..dee01865 100644 --- a/src/plugins/quectel/tests/test-modem-helpers-quectel.c +++ b/src/plugins/quectel/tests/test-modem-helpers-quectel.c @@ -79,6 +79,20 @@ test_ctzu (void) test_ctzu_response[i].expect_supports_enable_update_rtc); } +/*****************************************************************************/ +/* Test ^FIRMVERSION test responses */ +static void +test_firmversion (void) +{ + gboolean valid = TRUE; + + valid = mm_quectel_check_standard_firmware_version_valid ("EM05GFAR07A07M1G_01.016.01.016"); + g_assert_cmpuint (valid, ==, TRUE); + + valid = mm_quectel_check_standard_firmware_version_valid ("EM05GFAR07A07M1G_01.016.00.000"); + g_assert_cmpuint (valid, ==, FALSE); +} + /*****************************************************************************/ int main (int argc, char **argv) @@ -89,5 +103,7 @@ int main (int argc, char **argv) g_test_add_func ("/MM/quectel/ctzu", test_ctzu); + g_test_add_func ("/MM/quectel/firmversion", test_firmversion); + return g_test_run (); } -- cgit v1.2.3-70-g09d2