helpers: allow optional quotes in +CREG: <stat>,"<lac>","<ci>"

GSM 07.07 CREG=2 unsolicited pattern.

Added testcase for Thuraya XT.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
This commit is contained in:
Thomas Sailer
2016-02-13 14:24:54 +01:00
committed by Aleksander Morgado
parent 9cb0b22f91
commit a33615d6cb
2 changed files with 34 additions and 3 deletions
+24 -2
View File
@@ -1135,7 +1135,7 @@ test_cereg2_novatel_lte_solicited (void *f, gpointer d)
{
RegTestData *data = (RegTestData *) d;
const char *reply = "\r\n+CEREG: 2,1, 1F00, 20 ,79D903 ,7\r\n";
const CregResult result = { 1, 0x1F00, 0x79D903, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 12, FALSE, TRUE };
const CregResult result = { 1, 0x1F00, 0x79D903, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 13, FALSE, TRUE };
test_creg_match ("Novatel LTE E362 CEREG=2", TRUE, reply, data, &result);
}
@@ -1145,11 +1145,31 @@ test_cereg2_novatel_lte_unsolicited (void *f, gpointer d)
{
RegTestData *data = (RegTestData *) d;
const char *reply = "\r\n+CEREG: 1, 1F00, 20 ,79D903 ,7\r\n";
const CregResult result = { 1, 0x1F00, 0x79D903, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 11, FALSE, TRUE };
const CregResult result = { 1, 0x1F00, 0x79D903, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 12, FALSE, TRUE };
test_creg_match ("Novatel LTE E362 CEREG=2", FALSE, reply, data, &result);
}
static void
test_cgreg2_thuraya_solicited (void *f, gpointer d)
{
RegTestData *data = (RegTestData *) d;
const char *reply = "+CGREG: 1, \"0426\", \"F0,0F\"";
const CregResult result = { 1, 0x0426, 0x00F0, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, 11, TRUE, FALSE };
test_creg_match ("Thuraya solicited CREG=2", TRUE, reply, data, &result);
}
static void
test_cgreg2_thuraya_unsolicited (void *f, gpointer d)
{
RegTestData *data = (RegTestData *) d;
const char *reply = "\r\n+CGREG: 1, \"0426\", \"F0,0F\"\r\n";
const CregResult result = { 1, 0x0426, 0x00F0, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, 11, TRUE, FALSE };
test_creg_match ("Thuraya unsolicited CREG=2", FALSE, reply, data, &result);
}
/*****************************************************************************/
/* Test CSCS responses */
@@ -2706,6 +2726,8 @@ int main (int argc, char **argv)
g_test_suite_add (suite, TESTCASE (test_cgreg2_md400_unsolicited, reg_data));
g_test_suite_add (suite, TESTCASE (test_cgreg2_x220_unsolicited, reg_data));
g_test_suite_add (suite, TESTCASE (test_cgreg2_unsolicited_with_rac, reg_data));
g_test_suite_add (suite, TESTCASE (test_cgreg2_thuraya_solicited, reg_data));
g_test_suite_add (suite, TESTCASE (test_cgreg2_thuraya_unsolicited, reg_data));
g_test_suite_add (suite, TESTCASE (test_cereg1_solicited, reg_data));
g_test_suite_add (suite, TESTCASE (test_cereg1_unsolicited, reg_data));