diff options
Diffstat (limited to 'libqcdm/tests/test-qcdm-com.c')
-rw-r--r-- | libqcdm/tests/test-qcdm-com.c | 771 |
1 files changed, 771 insertions, 0 deletions
diff --git a/libqcdm/tests/test-qcdm-com.c b/libqcdm/tests/test-qcdm-com.c new file mode 100644 index 00000000..aeec6377 --- /dev/null +++ b/libqcdm/tests/test-qcdm-com.c @@ -0,0 +1,771 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2010 Red Hat, Inc. + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <glib.h> +#include <string.h> +#include <errno.h> +#include <sys/ioctl.h> +#include <fcntl.h> +#include <termios.h> +#include <unistd.h> +#include <stdlib.h> + +#include "test-qcdm-com.h" +#include "com.h" +#include "utils.h" +#include "result.h" +#include "commands.h" +#include "error.h" + +typedef struct { + char *port; + int fd; + struct termios old_t; + gboolean debug; +} TestComData; + +gpointer +test_com_setup (const char *port) +{ + TestComData *d; + int ret; + + d = g_malloc0 (sizeof (TestComData)); + g_assert (d); + + if (getenv ("SERIAL_DEBUG")) + d->debug = TRUE; + + errno = 0; + d->fd = open (port, O_RDWR | O_EXCL | O_NONBLOCK | O_NOCTTY); + if (d->fd < 0) + g_warning ("%s: open failed: (%d) %s", port, errno, strerror (errno)); + g_assert (d->fd >= 0); + + ret = ioctl (d->fd, TIOCEXCL); + if (ret) { + g_warning ("%s: lock failed: (%d) %s", port, errno, strerror (errno)); + close (d->fd); + d->fd = -1; + } + g_assert (ret == 0); + + ret = ioctl (d->fd, TCGETA, &d->old_t); + if (ret) { + g_warning ("%s: old termios failed: (%d) %s", port, errno, strerror (errno)); + close (d->fd); + d->fd = -1; + } + g_assert (ret == 0); + + d->port = g_strdup (port); + return d; +} + +void +test_com_teardown (gpointer user_data) +{ + TestComData *d = user_data; + + g_assert (d); + + g_free (d->port); + close (d->fd); + g_free (d); +} + +static void +print_buf (const char *detail, const char *buf, gsize len) +{ + int i = 0; + gboolean newline = FALSE; + + g_print ("%s (%zu) ", detail, len); + for (i = 0; i < len; i++) { + g_print ("0x%02x ", buf[i] & 0xFF); + if (((i + 1) % 12) == 0) { + g_print ("\n"); + newline = TRUE; + } else + newline = FALSE; + } + + if (!newline) + g_print ("\n"); +} + +static gboolean +send_command (TestComData *d, char *buf, gsize len) +{ + int status; + int eagain_count = 1000; + gsize i = 0; + + if (d->debug) + print_buf (">>>", buf, len); + + while (i < len) { + errno = 0; + status = write (d->fd, &buf[i], 1); + if (status < 0) { + if (errno == EAGAIN) { + eagain_count--; + if (eagain_count <= 0) + return FALSE; + } else + g_assert (errno == 0); + } else + i++; + + usleep (1000); + } + + return TRUE; +} + +static gsize +wait_reply (TestComData *d, char *buf, gsize len) +{ + fd_set in; + int result; + struct timeval timeout = { 1, 0 }; + char readbuf[1024]; + ssize_t bytes_read; + int total = 0, retries = 0; + gsize decap_len = 0; + + FD_ZERO (&in); + FD_SET (d->fd, &in); + result = select (d->fd + 1, &in, NULL, NULL, &timeout); + if (result != 1 || !FD_ISSET (d->fd, &in)) + return 0; + + do { + errno = 0; + bytes_read = read (d->fd, &readbuf[total], 1); + if ((bytes_read == 0) || (errno == EAGAIN)) { + /* Haven't gotten the async control char yet */ + if (retries > 20) + return 0; /* 2 seconds, give up */ + + /* Otherwise wait a bit and try again */ + usleep (100000); + retries++; + continue; + } else if (bytes_read == 1) { + gboolean more = FALSE, success; + gsize used = 0; + + total++; + decap_len = 0; + success = dm_decapsulate_buffer (readbuf, total, buf, len, &decap_len, &used, &more); + + /* Discard used data */ + if (used > 0) { + total -= used; + memmove (readbuf, &readbuf[used], total); + } + + if (success && !more) { + /* Success; we have a packet */ + break; + } + } else { + /* Some error occurred */ + return 0; + } + } while (total < sizeof (readbuf)); + + if (d->debug) { + print_buf ("<<<", readbuf, total); + print_buf ("D<<", buf, decap_len); + } + + return decap_len; +} + +void +test_com_port_init (void *f, void *data) +{ + TestComData *d = data; + GError *error = NULL; + gboolean success; + + success = qcdm_port_setup (d->fd, &error); + if (!success) { + g_warning ("%s: error setting up port: (%d) %s", + d->port, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } + g_assert (success); +} + +void +test_com_version_info (void *f, void *data) +{ + TestComData *d = data; + gboolean success; + GError *error = NULL; + char buf[512]; + const char *str; + gint len; + QCDMResult *result; + gsize reply_len; + + len = qcdm_cmd_version_info_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_version_info_result (buf, reply_len, &error); + g_assert (result); + + g_print ("\n"); + + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_VERSION_INFO_ITEM_COMP_DATE, &str); + g_message ("%s: Compiled Date: %s", __func__, str); + + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_VERSION_INFO_ITEM_COMP_TIME, &str); + g_message ("%s: Compiled Time: %s", __func__, str); + + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_VERSION_INFO_ITEM_RELEASE_DATE, &str); + g_message ("%s: Release Date: %s", __func__, str); + + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_VERSION_INFO_ITEM_RELEASE_TIME, &str); + g_message ("%s: Release Time: %s", __func__, str); + + 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); +} + +void +test_com_esn (void *f, void *data) +{ + TestComData *d = data; + gboolean success; + GError *error = NULL; + char buf[512]; + const char *str; + gint len; + QCDMResult *result; + gsize reply_len; + + 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); + + g_print ("\n"); + + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_ESN_ITEM_ESN, &str); + g_message ("%s: ESN: %s", __func__, str); + + qcdm_result_unref (result); +} + +void +test_com_mdn (void *f, void *data) +{ + TestComData *d = data; + gboolean success; + GError *error = NULL; + char buf[512]; + const char *str; + gint len; + QCDMResult *result; + gsize reply_len; + + len = qcdm_cmd_nv_get_mdn_new (buf, sizeof (buf), 0, NULL); + g_assert (len > 0); + + /* 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_nv_get_mdn_result (buf, reply_len, &error); + g_assert (result); + + g_print ("\n"); + + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_NV_GET_MDN_ITEM_MDN, &str); + g_message ("%s: MDN: %s", __func__, str); + + qcdm_result_unref (result); +} + +void +test_com_status (void *f, void *data) +{ + TestComData *d = data; + gboolean success; + GError *error = NULL; + char buf[100]; + const char *str; + gint len; + QCDMResult *result; + gsize reply_len; + guint32 n32; + guint8 n8; + + len = qcdm_cmd_cdma_status_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_cdma_status_result (buf, reply_len, &error); + g_assert (result); + + g_print ("\n"); + + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_CDMA_STATUS_ITEM_ESN, &str); + g_message ("%s: ESN: %s", __func__, str); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CDMA_STATUS_ITEM_RX_STATE, &n32); + g_message ("%s: CDMA RX State: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CDMA_STATUS_ITEM_ENTRY_REASON, &n32); + g_message ("%s: Entry Reason: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CDMA_STATUS_ITEM_CURRENT_CHANNEL, &n32); + g_message ("%s: Current Channel: %u", __func__, n32); + + n8 = 0; + qcdm_result_get_uint8 (result, QCDM_CMD_CDMA_STATUS_ITEM_CODE_CHANNEL, &n8); + g_message ("%s: Code Channel: %u", __func__, n8); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CDMA_STATUS_ITEM_PILOT_BASE, &n32); + g_message ("%s: Pilot Base: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CDMA_STATUS_ITEM_SID, &n32); + g_message ("%s: CDMA System ID: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CDMA_STATUS_ITEM_NID, &n32); + g_message ("%s: CDMA Network ID: %u", __func__, n32); + + qcdm_result_unref (result); +} + +void +test_com_sw_version (void *f, void *data) +{ + TestComData *d = data; + gboolean success; + GError *error = NULL; + char buf[100]; + gint len; + QCDMResult *result; + gsize reply_len; + + len = qcdm_cmd_sw_version_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_sw_version_result (buf, reply_len, &error); + + /* Recent devices don't appear to implement this command */ + g_assert (result == NULL); + g_assert_error (error, QCDM_COMMAND_ERROR, QCDM_COMMAND_BAD_COMMAND); + +/* + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_SW_VERSION_ITEM_VERSION, &str); + g_message ("%s: SW Version: %s", __func__, str); + + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_SW_VERSION_ITEM_COMP_DATE, &str); + g_message ("%s: Compiled Date: %s", __func__, str); + + str = NULL; + qcdm_result_get_string (result, QCDM_CMD_SW_VERSION_ITEM_COMP_TIME, &str); + g_message ("%s: Compiled Time: %s", __func__, str); + + qcdm_result_unref (result); +*/ +} + +void +test_com_cm_subsys_state_info (void *f, void *data) +{ + TestComData *d = data; + gboolean success; + GError *error = NULL; + char buf[100]; + gint len; + QCDMResult *result; + gsize reply_len; + guint32 n32; + const char *detail; + + len = qcdm_cmd_cm_subsys_state_info_new (buf, sizeof (buf), NULL); + g_assert (len == 7); + + /* 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_cm_subsys_state_info_result (buf, reply_len, &error); + g_assert (result); + + g_print ("\n"); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_CALL_STATE, &n32); + g_message ("%s: Call State: %u", __func__, n32); + + n32 = 0; + detail = NULL; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_OPERATING_MODE, &n32); + switch (n32) { + case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_ONLINE: + detail = "online"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: Operating Mode: %u (%s)", __func__, n32, detail); + + n32 = 0; + detail = NULL; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_SYSTEM_MODE, &n32); + switch (n32) { + case QCDM_CMD_CM_SUBSYS_STATE_INFO_SYSTEM_MODE_NO_SERVICE: + detail = "no service"; + break; + case QCDM_CMD_CM_SUBSYS_STATE_INFO_SYSTEM_MODE_AMPS: + detail = "AMPS"; + break; + case QCDM_CMD_CM_SUBSYS_STATE_INFO_SYSTEM_MODE_CDMA: + detail = "CDMA"; + break; + case QCDM_CMD_CM_SUBSYS_STATE_INFO_SYSTEM_MODE_HDR: + detail = "HDR/EVDO"; + break; + case QCDM_CMD_CM_SUBSYS_STATE_INFO_SYSTEM_MODE_WCDMA: + detail = "WCDMA"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: System Mode: %u (%s)", __func__, n32, detail); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_MODE_PREF, &n32); + g_message ("%s: Mode Preference: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_BAND_PREF, &n32); + g_message ("%s: Band Preference: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_ROAM_PREF, &n32); + g_message ("%s: Roam Preference: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_SERVICE_DOMAIN_PREF, &n32); + g_message ("%s: Service Domain Preference: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_ACQ_ORDER_PREF, &n32); + g_message ("%s: Acquisition Order Preference: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_HYBRID_PREF, &n32); + g_message ("%s: Hybrid Preference: %u", __func__, n32); + + n32 = 0; + qcdm_result_get_uint32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_NETWORK_SELECTION_PREF, &n32); + g_message ("%s: Network Selection Preference: %u", __func__, n32); + + qcdm_result_unref (result); +} + +void +test_com_hdr_subsys_state_info (void *f, void *data) +{ + TestComData *d = data; + gboolean success; + GError *error = NULL; + char buf[100]; + gint len; + QCDMResult *result; + gsize reply_len; + guint8 num; + const char *detail; + + len = qcdm_cmd_hdr_subsys_state_info_new (buf, sizeof (buf), NULL); + g_assert (len == 7); + + /* 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_hdr_subsys_state_info_result (buf, reply_len, &error); + if (!result) { + /* 1x-only devices won't implement the HDR subsystem of course */ + g_assert_error (error, QCDM_COMMAND_ERROR, QCDM_COMMAND_BAD_COMMAND); + g_message ("%s: device does not implement the HDR subsystem", __func__); + return; + } + g_assert (result); + + g_print ("\n"); + + num = 0; + detail = NULL; + qcdm_result_get_uint8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_AT_STATE, &num); + switch (num) { + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_AT_STATE_INACTIVE: + detail = "inactive"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_AT_STATE_ACQUISITION: + detail = "acquisition"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_AT_STATE_SYNC: + detail = "sync"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_AT_STATE_IDLE: + detail = "idle"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_AT_STATE_ACCESS: + detail = "access"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_AT_STATE_CONNECTED: + detail = "connected"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: AT State: %u (%s)", __func__, num, detail); + + num = 0; + detail = NULL; + qcdm_result_get_uint8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_SESSION_STATE, &num); + switch (num) { + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_SESSION_STATE_CLOSED: + detail = "closed"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_SESSION_STATE_SETUP: + detail = "setup"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_SESSION_STATE_AT_INIT: + detail = "AT init"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_SESSION_STATE_AN_INIT: + detail = "AN init"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_SESSION_STATE_OPEN: + detail = "open"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_SESSION_STATE_CLOSING: + detail = "closing"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: Session State: %u (%s)", __func__, num, detail); + + num = 0; + detail = NULL; + qcdm_result_get_uint8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_ALMP_STATE, &num); + switch (num) { + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_ALMP_STATE_INACTIVE: + detail = "inactive"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_ALMP_STATE_INIT: + detail = "init"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_ALMP_STATE_IDLE: + detail = "idle"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_ALMP_STATE_CONNECTED: + detail = "connected"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: ALMP State: %u (%s)", __func__, num, detail); + + num = 0; + detail = NULL; + qcdm_result_get_uint8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_INIT_STATE, &num); + switch (num) { + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_INIT_STATE_INACTIVE: + detail = "inactive"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_INIT_STATE_NET_DETERMINE: + detail = "searching"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_INIT_STATE_ACQUISITION: + detail = "acquisition"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_INIT_STATE_SYNC: + detail = "sync"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: Init State: %u (%s)", __func__, num, detail); + + num = 0; + detail = NULL; + qcdm_result_get_uint8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_IDLE_STATE, &num); + switch (num) { + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_IDLE_STATE_INACTIVE: + detail = "inactive"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_IDLE_STATE_SLEEP: + detail = "sleep"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_IDLE_STATE_MONITOR: + detail = "monitor"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_IDLE_STATE_SETUP: + detail = "setup"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: Idle State: %u (%s)", __func__, num, detail); + + num = 0; + detail = NULL; + qcdm_result_get_uint8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_CONNECTED_STATE, &num); + switch (num) { + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_CONNECTED_STATE_INACTIVE: + detail = "inactive"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_CONNECTED_STATE_OPEN: + detail = "open"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_CONNECTED_STATE_CLOSING: + detail = "closing"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: Connected State: %u (%s)", __func__, num, detail); + + num = 0; + detail = NULL; + qcdm_result_get_uint8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_ROUTE_UPDATE_STATE, &num); + switch (num) { + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_ROUTE_UPDATE_STATE_INACTIVE: + detail = "inactive"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_ROUTE_UPDATE_STATE_IDLE: + detail = "idle"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_ROUTE_UPDATE_STATE_CONNECTED: + detail = "connected"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: Route Update State: %u (%s)", __func__, num, detail); + + num = 0; + detail = NULL; + qcdm_result_get_uint8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_OVERHEAD_MSG_STATE, &num); + switch (num) { + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_OVERHEAD_MSG_STATE_INIT: + detail = "initial"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_OVERHEAD_MSG_STATE_INACTIVE: + detail = "inactive"; + break; + case QCDM_CMD_HDR_SUBSYS_STATE_INFO_OVERHEAD_MSG_STATE_ACTIVE: + detail = "active"; + break; + default: + detail = "unknown"; + break; + } + g_message ("%s: Overhead Msg State: %u (%s)", __func__, num, detail); + + num = 0; + qcdm_result_get_uint8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_HDR_HYBRID_MODE, &num); + g_message ("%s: HDR Hybrid Mode: %u", __func__, num); + + qcdm_result_unref (result); +} + |