broadband-modem: query +CMER format before enabling/disabling

Don't blindly try '+CMER=3,0,0,1' to enable and '+CMER=0' to disable
Mobile Equipment Event Reporting. We now query the device for the
supported formats and use that info to build commands that will work.
This commit is contained in:
Aleksander Morgado
2017-05-29 14:58:25 +02:00
parent e753911a4e
commit 024c7a1a8f
2 changed files with 122 additions and 23 deletions
+12
View File
@@ -1930,6 +1930,16 @@ test_cmer_response_cinterion_ehs5 (void)
test_cmer_response (str, expected_modes, expected_inds);
}
static void
test_cmer_request_cinterion_ehs5 (void)
{
gchar *str;
str = mm_3gpp_build_cmer_set_request (MM_3GPP_CMER_MODE_BUFFER_URCS_IF_LINK_RESERVED, MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND);
g_assert_cmpstr (str, ==, "+CMER=2,0,0,1");
g_free (str);
}
/*****************************************************************************/
/* Test CIND responses */
@@ -3794,6 +3804,8 @@ int main (int argc, char **argv)
g_test_suite_add (suite, TESTCASE (test_cmer_response_sierra_em7345, NULL));
g_test_suite_add (suite, TESTCASE (test_cmer_response_cinterion_ehs5, NULL));
g_test_suite_add (suite, TESTCASE (test_cmer_request_cinterion_ehs5, NULL));
g_test_suite_add (suite, TESTCASE (test_cind_response_linktop_lw273, NULL));
g_test_suite_add (suite, TESTCASE (test_cind_response_moto_v3m, NULL));