api: add 'TeleserviceId' property to the SMS interface

Will be used in 3GPP2 SMS messages.
This commit is contained in:
Aleksander Morgado
2013-07-18 13:27:18 +02:00
parent 2864e777ae
commit d0fb94c49f
8 changed files with 76 additions and 0 deletions

View File

@@ -200,6 +200,16 @@ print_sms_info (MMSms *sms)
VALIDATE (mm_sms_get_smsc (sms)),
mm_sms_get_class (sms));
}
/* Teleservice ID is 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",
mm_sms_cdma_teleservice_id_get_string (mm_sms_get_teleservice_id (sms)));
}
if (pdu_type == MM_SMS_PDU_TYPE_SUBMIT)
g_print (" | delivery report: '%s'\n",

View File

@@ -43,6 +43,7 @@ MMSmsState
MMSmsDeliveryState
MMSmsStorage
MMSmsValidityType
MMSmsCdmaTeleserviceId
</SECTION>
<SECTION>

View File

@@ -1050,6 +1050,7 @@ mm_sms_get_smsc
mm_sms_dup_smsc
mm_sms_get_message_reference
mm_sms_get_class
mm_sms_get_teleservice_id
mm_sms_get_validity_type
mm_sms_get_validity_relative
mm_sms_get_timestamp
@@ -1149,6 +1150,7 @@ mm_sms_state_get_string
mm_sms_delivery_state_get_string
mm_sms_storage_get_string
mm_sms_validity_type_get_string
mm_sms_cdma_teleservice_id_get_string
mm_firmware_image_type_get_string
mm_oma_feature_build_string_from_mask
mm_oma_session_type_get_string
@@ -1169,6 +1171,7 @@ mm_sms_state_build_string_from_mask
mm_sms_delivery_state_build_string_from_mask
mm_sms_storage_build_string_from_mask
mm_sms_validity_type_build_string_from_mask
mm_sms_cdma_teleservice_id_build_string_from_mask
mm_modem_location_source_get_string
mm_modem_contacts_storage_build_string_from_mask
mm_bearer_ip_family_build_string_from_mask
@@ -1218,6 +1221,7 @@ MM_TYPE_SMS_PDU_TYPE
MM_TYPE_SMS_STATE
MM_TYPE_SMS_STORAGE
MM_TYPE_SMS_VALIDITY_TYPE
MM_TYPE_SMS_CDMA_TELESERVICE_ID
MM_TYPE_OMA_FEATURE
MM_TYPE_OMA_SESSION_STATE
MM_TYPE_OMA_SESSION_STATE_FAILED_REASON
@@ -1251,6 +1255,7 @@ mm_sms_pdu_type_get_type
mm_sms_state_get_type
mm_sms_storage_get_type
mm_sms_validity_type_get_type
mm_sms_cdma_teleservice_id_get_type
mm_oma_feature_get_type
mm_oma_session_state_failed_reason_get_type
mm_oma_session_state_get_type
@@ -2608,6 +2613,7 @@ mm_gdbus_sms_dup_smsc
mm_gdbus_sms_get_validity
mm_gdbus_sms_dup_validity
mm_gdbus_sms_get_class
mm_gdbus_sms_get_teleservice_id
mm_gdbus_sms_get_timestamp
mm_gdbus_sms_dup_timestamp
mm_gdbus_sms_get_discharge_timestamp
@@ -2623,6 +2629,7 @@ mm_gdbus_sms_call_store_finish
mm_gdbus_sms_call_store_sync
<SUBSECTION Private>
mm_gdbus_sms_set_class
mm_gdbus_sms_set_teleservice_id
mm_gdbus_sms_set_data
mm_gdbus_sms_set_delivery_report_request
mm_gdbus_sms_set_delivery_state

View File

@@ -573,6 +573,33 @@ typedef enum { /*< underscore_name=mm_sms_validity_type >*/
MM_SMS_VALIDITY_TYPE_ENHANCED = 3,
} MMSmsValidityType;
/**
* MMSmsCdmaTeleserviceId:
* @MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN: Unknown.
* @MM_SMS_CDMA_TELESERVICE_ID_CMT91: IS-91 Extended Protocol Enhanced Services.
* @MM_SMS_CDMA_TELESERVICE_ID_WPT: Wireless Paging Teleservice.
* @MM_SMS_CDMA_TELESERVICE_ID_WMT: Wireless Messaging Teleservice.
* @MM_SMS_CDMA_TELESERVICE_ID_VMN: Voice Mail Notification.
* @MM_SMS_CDMA_TELESERVICE_ID_WAP: Wireless Application Protocol.
* @MM_SMS_CDMA_TELESERVICE_ID_WEMT: Wireless Enhanced Messaging Teleservice.
* @MM_SMS_CDMA_TELESERVICE_ID_SCPT: Service Category Programming Teleservice.
* @MM_SMS_CDMA_TELESERVICE_ID_CATPT: Card Application Toolkit Protocol Teleservice.
*
* Teleservice IDs supported for CDMA SMS, as defined in 3GPP2 X.S0004-550-E
* (section 2.256) and 3GPP2 C.S0015-B (section 3.4.3.1).
*/
typedef enum { /*< underscore_name=mm_sms_cdma_teleservice_id >*/
MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN = 0x0000,
MM_SMS_CDMA_TELESERVICE_ID_CMT91 = 0x1000,
MM_SMS_CDMA_TELESERVICE_ID_WPT = 0x1001,
MM_SMS_CDMA_TELESERVICE_ID_WMT = 0x1002,
MM_SMS_CDMA_TELESERVICE_ID_VMN = 0x1003,
MM_SMS_CDMA_TELESERVICE_ID_WAP = 0x1004,
MM_SMS_CDMA_TELESERVICE_ID_WEMT = 0x1005,
MM_SMS_CDMA_TELESERVICE_ID_SCPT = 0x1006,
MM_SMS_CDMA_TELESERVICE_ID_CATPT = 0x1007,
} MMSmsCdmaTeleserviceId;
/**
* MMModemLocationSource:
* @MM_MODEM_LOCATION_SOURCE_NONE: None.

View File

@@ -128,6 +128,15 @@
-->
<property name="Class" type="i" access="read" />
<!--
TeleserviceId:
A <link linkend="MMSmsCdmaTeleserviceId">MMSmsCdmaTeleserviceId</link> value.
Always <link linkend="MM-SMS-CDMA-TELESERVICE-ID-UNKNOWN:CAPS">MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN</link> for 3GPP.
-->
<property name="TeleserviceId" type="u" access="read" />
<!--
DeliveryReportRequest:

View File

@@ -570,6 +570,24 @@ mm_sms_get_pdu_type (MMSms *self)
/*****************************************************************************/
/**
* mm_sms_get_teleservice_id:
* @self: A #MMSms.
*
* Gets the 3GPP2 Teleservice ID.
*
* Returns: a #MMSmsCdmaTeleserviceId.
*/
MMSmsCdmaTeleserviceId
mm_sms_get_teleservice_id (MMSms *self)
{
g_return_val_if_fail (MM_IS_SMS (self), MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN);
return (MMSmsCdmaTeleserviceId) mm_gdbus_sms_get_teleservice_id (MM_GDBUS_SMS (self));
}
/*****************************************************************************/
/**
* mm_sms_send_finish:
* @self: A #MMSms.

View File

@@ -103,6 +103,8 @@ MMSmsStorage mm_sms_get_storage (MMSms *self);
MMSmsPduType mm_sms_get_pdu_type (MMSms *self);
MMSmsCdmaTeleserviceId mm_sms_get_teleservice_id (MMSms *self);
void mm_sms_send (MMSms *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,

View File

@@ -1499,6 +1499,7 @@ assemble_sms (MMSms *self,
g_byte_array_ref (fulldata)),
"smsc", mm_sms_part_get_smsc (sorted_parts[0]),
"class", mm_sms_part_get_class (sorted_parts[0]),
"teleservice-id", MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN,
"number", mm_sms_part_get_number (sorted_parts[0]),
"validity", (validity_relative ?
g_variant_new ("(uv)", MM_SMS_VALIDITY_TYPE_RELATIVE, g_variant_new_uint32 (validity_relative)) :
@@ -1737,6 +1738,7 @@ mm_sms_new_from_properties (MMBaseModem *modem,
NULL),
"smsc", mm_sms_properties_get_smsc (properties),
"class", mm_sms_properties_get_class (properties),
"teleservice-id", MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN,
"delivery-report-request", mm_sms_properties_get_delivery_report_request (properties),
"validity", (mm_sms_properties_get_validity_type (properties) == MM_SMS_VALIDITY_TYPE_RELATIVE ?
g_variant_new ("(uv)", MM_SMS_VALIDITY_TYPE_RELATIVE, g_variant_new_uint32 (mm_sms_properties_get_validity_relative (properties))) :