cli,sms: print properties just when they are available
The logic to decide whether a property is valid in a given PDU type is kind of fuzzy for 3GPP2 as it is currently implemented; so just print whatever we have in the interface.
This commit is contained in:
@@ -191,49 +191,45 @@ print_sms_info (MMSms *sms)
|
|||||||
g_print (" | storage: '%s'\n",
|
g_print (" | storage: '%s'\n",
|
||||||
mm_sms_storage_get_string (mm_sms_get_storage (sms)));
|
mm_sms_storage_get_string (mm_sms_get_storage (sms)));
|
||||||
|
|
||||||
/* Class and SMSC will be 3GPP-specific */
|
/* Print properties which are set, regardless of the pdu type */
|
||||||
if (pdu_type == MM_SMS_PDU_TYPE_DELIVER ||
|
|
||||||
pdu_type == MM_SMS_PDU_TYPE_SUBMIT ||
|
|
||||||
pdu_type == MM_SMS_PDU_TYPE_STATUS_REPORT) {
|
|
||||||
g_print (" | smsc: '%s'\n"
|
|
||||||
" | class: '%d'\n",
|
|
||||||
VALIDATE (mm_sms_get_smsc (sms)),
|
|
||||||
mm_sms_get_class (sms));
|
|
||||||
}
|
|
||||||
/* Teleservice ID and service category are 3GPP2 specific */
|
|
||||||
else if (pdu_type == MM_SMS_PDU_TYPE_CDMA_DELIVER ||
|
|
||||||
pdu_type == MM_SMS_PDU_TYPE_CDMA_SUBMIT ||
|
|
||||||
pdu_type == MM_SMS_PDU_TYPE_CDMA_CANCELLATION ||
|
|
||||||
pdu_type == MM_SMS_PDU_TYPE_CDMA_DELIVERY_ACKNOWLEDGEMENT ||
|
|
||||||
pdu_type == MM_SMS_PDU_TYPE_CDMA_USER_ACKNOWLEDGEMENT ||
|
|
||||||
pdu_type == MM_SMS_PDU_TYPE_CDMA_READ_ACKNOWLEDGEMENT) {
|
|
||||||
g_print (" | teleservice id: '%s'\n"
|
|
||||||
" | service category: '%s'\n",
|
|
||||||
mm_sms_cdma_teleservice_id_get_string (mm_sms_get_teleservice_id (sms)),
|
|
||||||
mm_sms_cdma_service_category_get_string (mm_sms_get_service_category (sms)));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (mm_sms_get_smsc (sms))
|
||||||
|
g_print (" | smsc: '%s'\n",
|
||||||
|
mm_sms_get_smsc (sms));
|
||||||
|
|
||||||
|
if (mm_sms_get_class (sms) >= 0)
|
||||||
|
g_print (" | class: '%d'\n",
|
||||||
|
mm_sms_get_class (sms));
|
||||||
|
|
||||||
|
if (mm_sms_get_teleservice_id (sms) != MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN)
|
||||||
|
g_print (" | teleservice id: '%s'\n",
|
||||||
|
mm_sms_cdma_teleservice_id_get_string (mm_sms_get_teleservice_id (sms)));
|
||||||
|
|
||||||
|
if (mm_sms_get_service_category (sms) != MM_SMS_CDMA_SERVICE_CATEGORY_UNKNOWN)
|
||||||
|
g_print (" | service category: '%s'\n",
|
||||||
|
mm_sms_cdma_service_category_get_string (mm_sms_get_service_category (sms)));
|
||||||
|
|
||||||
|
/* Delivery report request just in 3GPP submit PDUs */
|
||||||
if (pdu_type == MM_SMS_PDU_TYPE_SUBMIT)
|
if (pdu_type == MM_SMS_PDU_TYPE_SUBMIT)
|
||||||
g_print (" | delivery report: '%s'\n",
|
g_print (" | delivery report: '%s'\n",
|
||||||
mm_sms_get_delivery_report_request (sms) ? "requested" : "not requested");
|
mm_sms_get_delivery_report_request (sms) ? "requested" : "not requested");
|
||||||
|
|
||||||
if (pdu_type == MM_SMS_PDU_TYPE_STATUS_REPORT ||
|
if (mm_sms_get_message_reference (sms) != 0)
|
||||||
pdu_type == MM_SMS_PDU_TYPE_SUBMIT)
|
|
||||||
g_print (" | message reference: '%u'\n",
|
g_print (" | message reference: '%u'\n",
|
||||||
mm_sms_get_message_reference (sms));
|
mm_sms_get_message_reference (sms));
|
||||||
|
|
||||||
if (pdu_type == MM_SMS_PDU_TYPE_STATUS_REPORT ||
|
if (mm_sms_get_timestamp (sms))
|
||||||
pdu_type == MM_SMS_PDU_TYPE_DELIVER)
|
|
||||||
g_print (" | timestamp: '%s'\n",
|
g_print (" | timestamp: '%s'\n",
|
||||||
VALIDATE (mm_sms_get_timestamp (sms)));
|
mm_sms_get_timestamp (sms));
|
||||||
|
|
||||||
if (pdu_type == MM_SMS_PDU_TYPE_STATUS_REPORT) {
|
if (mm_sms_get_delivery_state (sms) != MM_SMS_DELIVERY_STATE_UNKNOWN)
|
||||||
g_print (" | delivery state: '%s' (0x%X)\n",
|
g_print (" | delivery state: '%s' (0x%X)\n",
|
||||||
VALIDATE (mm_sms_delivery_state_get_string_extended (mm_sms_get_delivery_state (sms))),
|
VALIDATE (mm_sms_delivery_state_get_string_extended (mm_sms_get_delivery_state (sms))),
|
||||||
mm_sms_get_delivery_state (sms));
|
mm_sms_get_delivery_state (sms));
|
||||||
|
|
||||||
|
if (mm_sms_get_discharge_timestamp (sms))
|
||||||
g_print (" | discharge timestamp: '%s'\n",
|
g_print (" | discharge timestamp: '%s'\n",
|
||||||
VALIDATE (mm_sms_get_discharge_timestamp (sms)));
|
mm_sms_get_discharge_timestamp (sms));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user