aboutsummaryrefslogtreecommitdiff
path: root/libqcdm/tests
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-02-22 11:33:44 -0800
committerDan Williams <dcbw@redhat.com>2010-02-22 11:33:44 -0800
commit7d151e6ae005cdac451b3e24697c7dc1e2c1e462 (patch)
tree71a8c4178a45c3a47f8834fd42f1b55d84b75320 /libqcdm/tests
parent4c297935efcceb2d764077144757da57a48bd725 (diff)
qcdm: add DIAG_CMD_ESN
Diffstat (limited to 'libqcdm/tests')
-rw-r--r--libqcdm/tests/test-qcdm-com.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libqcdm/tests/test-qcdm-com.c b/libqcdm/tests/test-qcdm-com.c
index d8380fd7..676aea85 100644
--- a/libqcdm/tests/test-qcdm-com.c
+++ b/libqcdm/tests/test-qcdm-com.c
@@ -252,5 +252,29 @@ test_com (void *f, void *data)
str = NULL;
qcdm_result_get_string (result, QCDM_CMD_VERSION_INFO_ITEM_MODEL, &str);
g_message ("%s: Model: %s", __func__, str);
+
+ qcdm_result_unref (result);
+
+ /* Get the device's ESN */
+
+ len = qcdm_cmd_esn_new (buf, sizeof (buf), NULL);
+ g_assert (len == 4);
+
+ /* Send the command */
+ success = send_command (d, buf, len);
+ g_assert (success);
+
+ /* Get a response */
+ reply_len = wait_reply (d, buf, sizeof (buf));
+
+ /* Parse the response into a result structure */
+ result = qcdm_cmd_esn_result (buf, reply_len, &error);
+ g_assert (result);
+
+ str = NULL;
+ qcdm_result_get_string (result, QCDM_CMD_ESN_ITEM_ESN, &str);
+ g_message ("%s: ESN: %s", __func__, str);
+
+ qcdm_result_unref (result);
}