qcdm: add generic status snapshot command support
This commit is contained in:
@@ -437,6 +437,44 @@ qcdm_cmd_sw_version_result (const char *buf, gsize len, GError **error)
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
gsize
|
||||
qcdm_cmd_status_snapshot_new (char *buf, gsize len, GError **error)
|
||||
{
|
||||
char cmdbuf[3];
|
||||
DMCmdHeader *cmd = (DMCmdHeader *) &cmdbuf[0];
|
||||
|
||||
g_return_val_if_fail (buf != NULL, 0);
|
||||
g_return_val_if_fail (len >= sizeof (*cmd) + DIAG_TRAILER_LEN, 0);
|
||||
|
||||
memset (cmd, 0, sizeof (*cmd));
|
||||
cmd->code = DIAG_CMD_STATUS_SNAPSHOT;
|
||||
|
||||
return dm_encapsulate_buffer (cmdbuf, sizeof (*cmd), sizeof (cmdbuf), buf, len);
|
||||
}
|
||||
|
||||
QCDMResult *
|
||||
qcdm_cmd_status_snapshot_result (const char *buf, gsize len, GError **error)
|
||||
{
|
||||
QCDMResult *result = NULL;
|
||||
DMCmdStatusSnapshotRsp *rsp = (DMCmdStatusSnapshotRsp *) buf;
|
||||
|
||||
g_return_val_if_fail (buf != NULL, NULL);
|
||||
|
||||
if (!check_command (buf, len, DIAG_CMD_STATUS_SNAPSHOT, sizeof (*rsp), error))
|
||||
return NULL;
|
||||
|
||||
result = qcdm_result_new ();
|
||||
|
||||
qcdm_result_add_uint8 (result, QCDM_CMD_STATUS_SNAPSHOT_ITEM_BAND_CLASS, cdma_band_class_to_qcdm (rsp->band_class));
|
||||
qcdm_result_add_uint8 (result, QCDM_CMD_STATUS_SNAPSHOT_ITEM_BASE_STATION_PREV, cdma_prev_to_qcdm (rsp->prev));
|
||||
qcdm_result_add_uint8 (result, QCDM_CMD_STATUS_SNAPSHOT_ITEM_MOBILE_PREV, cdma_prev_to_qcdm (rsp->mob_prev));
|
||||
qcdm_result_add_uint8 (result, QCDM_CMD_STATUS_SNAPSHOT_ITEM_PREV_IN_USE, cdma_prev_to_qcdm (rsp->prev_in_use));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
gsize
|
||||
qcdm_cmd_pilot_sets_new (char *buf, gsize len, GError **error)
|
||||
{
|
||||
|
||||
@@ -148,6 +148,28 @@ QCDMResult *qcdm_cmd_sw_version_result (const char *buf,
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
/* One of QCDM_CDMA_BAND_CLASS_* */
|
||||
#define QCDM_CMD_STATUS_SNAPSHOT_ITEM_BAND_CLASS "band-class"
|
||||
|
||||
/* The protocol revision of the base station. One of QCDM_CDMA_PREV_* */
|
||||
#define QCDM_CMD_STATUS_SNAPSHOT_ITEM_BASE_STATION_PREV "prev"
|
||||
|
||||
/* The protocol revision of the mobile terminal. One of QCDM_CDMA_PREV_* */
|
||||
#define QCDM_CMD_STATUS_SNAPSHOT_ITEM_MOBILE_PREV "mob-prev"
|
||||
|
||||
/* The protocol revision currently in-use. One of QCDM_CDMA_PREV_* */
|
||||
#define QCDM_CMD_STATUS_SNAPSHOT_ITEM_PREV_IN_USE "prev-in-use"
|
||||
|
||||
gsize qcdm_cmd_status_snapshot_new (char *buf,
|
||||
gsize len,
|
||||
GError **error);
|
||||
|
||||
QCDMResult *qcdm_cmd_status_snapshot_result (const char *buf,
|
||||
gsize len,
|
||||
GError **error);
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
enum {
|
||||
QCDM_CMD_PILOT_SETS_TYPE_UNKNOWN = 0,
|
||||
QCDM_CMD_PILOT_SETS_TYPE_ACTIVE = 1,
|
||||
|
||||
@@ -265,6 +265,29 @@ struct DMCmdSwVersionRsp {
|
||||
} __attribute__ ((packed));
|
||||
typedef struct DMCmdSwVersionRsp DMCmdSwVersionRsp;
|
||||
|
||||
/* DIAG_CMD_STATUS_SNAPSHOT */
|
||||
struct DMCmdStatusSnapshotRsp {
|
||||
guint8 code;
|
||||
guint8 esn[4];
|
||||
guint8 imsi_s1[4];
|
||||
guint8 imsi_s2[2];
|
||||
guint8 imsi_s[8];
|
||||
guint8 imsi_11_12;
|
||||
guint16 mcc;
|
||||
guint8 imsi_addr_num;
|
||||
guint16 sid;
|
||||
guint16 nid;
|
||||
guint8 prev;
|
||||
guint8 prev_in_use;
|
||||
guint8 mob_prev;
|
||||
guint8 band_class;
|
||||
guint16 frequency;
|
||||
guint8 oper_mode;
|
||||
guint8 state;
|
||||
guint8 sub_state;
|
||||
} __attribute__ ((packed));
|
||||
typedef struct DMCmdStatusSnapshotRsp DMCmdStatusSnapshotRsp;
|
||||
|
||||
/* DIAG_SUBSYS_CM_STATE_INFO subsys command */
|
||||
struct DMCmdSubsysCMStateInfoRsp {
|
||||
DMCmdSubsysHeader header;
|
||||
|
||||
Reference in New Issue
Block a user