qcdm: add event reporting on/off command

Doesn't parse any events yet since we don't know what any events
are.  We also need to fix up ModemManager to handle unsolicited
responses in the QcdmSerialPort class.
This commit is contained in:
Dan Williams
2010-09-01 10:51:22 -05:00
parent 48aabcb60b
commit f3024b46b4
6 changed files with 100 additions and 0 deletions
+43
View File
@@ -1253,6 +1253,49 @@ test_com_ext_logmask (void *f, void *data)
reply_len = wait_reply (d, buf, sizeof (buf));
}
void
test_com_event_report (void *f, void *data)
{
TestComData *d = data;
gboolean success;
GError *error = NULL;
char buf[520];
gint len;
QCDMResult *result;
gsize reply_len;
/* Turn event reporting on */
len = qcdm_cmd_event_report_new (buf, sizeof (buf), TRUE, NULL);
/* Send the command */
success = send_command (d, buf, len);
g_assert (success);
/* Get a response */
reply_len = wait_reply (d, buf, sizeof (buf));
g_print ("\n");
/* Parse the response into a result structure */
result = qcdm_cmd_event_report_result (buf, reply_len, &error);
g_assert (result);
qcdm_result_unref (result);
/* Wait for an event */
reply_len = wait_reply (d, buf, sizeof (buf));
/* Turn event reporting off */
len = qcdm_cmd_event_report_new (buf, sizeof (buf), FALSE, NULL);
/* Send the command */
success = send_command (d, buf, len);
g_assert (success);
/* Get a response */
reply_len = wait_reply (d, buf, sizeof (buf));
}
void
test_com_zte_subsys_status (void *f, void *data)
{
+2
View File
@@ -47,6 +47,8 @@ void test_com_hdr_subsys_state_info (void *f, void *data);
void test_com_ext_logmask (void *f, void *data);
void test_com_event_report (void *f, void *data);
void test_com_zte_subsys_status (void *f, void *data);
void test_com_nw_subsys_modem_snapshot_cdma (void *f, void *data);
+1
View File
@@ -108,6 +108,7 @@ int main (int argc, char **argv)
g_test_suite_add (suite, TESTCASE (test_com_cm_subsys_state_info, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_hdr_subsys_state_info, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_ext_logmask, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_event_report, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_zte_subsys_status, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_nw_subsys_modem_snapshot_cdma, data->com_data));
}