summaryrefslogtreecommitdiff
path: root/libqcdm/tests
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-03-30 00:32:05 -0700
committerDan Williams <dcbw@redhat.com>2010-03-30 00:32:27 -0700
commit0ae176c63c8686cd3a86b7933be5ae3546782475 (patch)
tree33486efe86bf3469fbff80283621423c0b37dd6e /libqcdm/tests
parentcff40ac4724780e73f47af4f17cba952ab1ed680 (diff)
qcdm: add Pilot Set retrieval for signal strength calculations
Determined from various sources including RTManager and "Technical Introduction to CDMA" (Course RF100 Chapter 7).
Diffstat (limited to 'libqcdm/tests')
-rw-r--r--libqcdm/tests/test-qcdm-com.c54
-rw-r--r--libqcdm/tests/test-qcdm-com.h2
-rw-r--r--libqcdm/tests/test-qcdm.c1
3 files changed, 57 insertions, 0 deletions
diff --git a/libqcdm/tests/test-qcdm-com.c b/libqcdm/tests/test-qcdm-com.c
index c9fe7296..1327f33e 100644
--- a/libqcdm/tests/test-qcdm-com.c
+++ b/libqcdm/tests/test-qcdm-com.c
@@ -599,6 +599,60 @@ test_com_sw_version (void *f, void *data)
}
void
+test_com_pilot_sets (void *f, void *data)
+{
+ TestComData *d = data;
+ gboolean success;
+ GError *error = NULL;
+ char buf[256];
+ gint len;
+ QCDMResult *result;
+ gsize reply_len;
+ guint32 num, i;
+
+ len = qcdm_cmd_pilot_sets_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_pilot_sets_result (buf, reply_len, &error);
+ g_assert (result);
+
+ num = 0;
+ qcdm_cmd_pilot_sets_result_get_num (result, QCDM_CMD_PILOT_SETS_TYPE_ACTIVE, &num);
+ g_message ("%s: Active Pilots: %d", __func__, num);
+ for (i = 0; i < num; i++) {
+ guint32 pn_offset = 0, ecio = 0;
+ float db = 0;
+
+ qcdm_cmd_pilot_sets_result_get_pilot (result,
+ QCDM_CMD_PILOT_SETS_TYPE_ACTIVE,
+ i,
+ &pn_offset,
+ &ecio,
+ &db);
+ g_message (" %d: PN offset %d", i, pn_offset);
+ g_message (" EC/IO %d (%.1f dB)", ecio, db);
+ }
+
+ num = 0;
+ qcdm_cmd_pilot_sets_result_get_num (result, QCDM_CMD_PILOT_SETS_TYPE_CANDIDATE, &num);
+ g_message ("%s: Candidate Pilots: %d", __func__, num);
+
+ num = 0;
+ qcdm_cmd_pilot_sets_result_get_num (result, QCDM_CMD_PILOT_SETS_TYPE_NEIGHBOR, &num);
+ g_message ("%s: Neighbor Pilots: %d", __func__, num);
+
+ qcdm_result_unref (result);
+}
+
+void
test_com_cm_subsys_state_info (void *f, void *data)
{
TestComData *d = data;
diff --git a/libqcdm/tests/test-qcdm-com.h b/libqcdm/tests/test-qcdm-com.h
index d9f4ee75..8ea8e605 100644
--- a/libqcdm/tests/test-qcdm-com.h
+++ b/libqcdm/tests/test-qcdm-com.h
@@ -37,6 +37,8 @@ void test_com_status (void *f, void *data);
void test_com_sw_version (void *f, void *data);
+void test_com_pilot_sets (void *f, void *data);
+
void test_com_cm_subsys_state_info (void *f, void *data);
void test_com_hdr_subsys_state_info (void *f, void *data);
diff --git a/libqcdm/tests/test-qcdm.c b/libqcdm/tests/test-qcdm.c
index d87a2e31..0a6801fb 100644
--- a/libqcdm/tests/test-qcdm.c
+++ b/libqcdm/tests/test-qcdm.c
@@ -98,6 +98,7 @@ int main (int argc, char **argv)
g_test_suite_add (suite, TESTCASE (test_com_read_mode_pref, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_status, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_sw_version, data->com_data));
+ g_test_suite_add (suite, TESTCASE (test_com_pilot_sets, data->com_data));
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_zte_subsys_status, data->com_data));