diff options
author | Andrzej Zaborowski <andrew.zaborowski@intel.com> | 2010-06-11 12:39:56 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-06-15 12:37:53 -0500 |
commit | 0baaf2ce5b8eecc1584bbcce13b1f66e7d053ebb (patch) | |
tree | 3049a75a5d4bb2b6d2db50d71cee13bd955605ea | |
parent | 6720f90e13756a98314a243ad25614c22dcc4d2a (diff) | |
download | ofono-0baaf2ce5b8eecc1584bbcce13b1f66e7d053ebb.tar.bz2 |
stkutil: Add MMS Notification DL envelope builder
-rw-r--r-- | src/stkutil.c | 38 | ||||
-rw-r--r-- | src/stkutil.h | 6 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/stkutil.c b/src/stkutil.c index ada63daf..f3610d89 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -4402,6 +4402,32 @@ static gboolean build_dataobj_i_wlan_access_status(struct stk_tlv_builder *tlv, stk_tlv_builder_close_container(tlv); } +/* Described in TS 102.223 Section 8.86 */ +static gboolean build_dataobj_mms_notification(struct stk_tlv_builder *tlv, + const void *data, gboolean cr) +{ + const struct stk_common_byte_array *msg = data; + unsigned char tag = STK_DATA_OBJECT_TYPE_MMS_NOTIFICATION; + + return stk_tlv_builder_open_container(tlv, cr, tag, TRUE) && + stk_tlv_builder_append_bytes(tlv, msg->array, msg->len) && + stk_tlv_builder_close_container(tlv); +} + +/* Described in TS 102.223 Section 8.87 */ +static gboolean build_dataobj_last_envelope(struct stk_tlv_builder *tlv, + const void *data, gboolean cr) +{ + const ofono_bool_t *last = data; + unsigned char tag = STK_DATA_OBJECT_TYPE_LAST_ENVELOPE; + + if (!*last) + return TRUE; + + return stk_tlv_builder_open_container(tlv, cr, tag, FALSE) && + stk_tlv_builder_close_container(tlv); +} + /* Described in TS 102.223 Section 8.90 */ static gboolean build_dataobj_broadcast_network_information( struct stk_tlv_builder *tlv, @@ -5149,6 +5175,18 @@ const unsigned char *stk_pdu_from_envelope(const struct stk_envelope *envelope, &envelope->mms_status.transfer_status, NULL); break; + case STK_ENVELOPE_TYPE_MMS_NOTIFICATION: + ok = build_dataobj(&builder, + build_envelope_dataobj_device_ids, + DATAOBJ_FLAG_CR, + envelope, + build_dataobj_mms_notification, + DATAOBJ_FLAG_CR, + &envelope->mms_notification.msg, + build_dataobj_last_envelope, 0, + &envelope->mms_notification.last, + NULL); + break; default: return NULL; }; diff --git a/src/stkutil.h b/src/stkutil.h index fdc79ed0..dac8dcc1 100644 --- a/src/stkutil.h +++ b/src/stkutil.h @@ -1447,6 +1447,11 @@ struct stk_envelope_mms_transfer_status { struct stk_mms_transfer_status transfer_status; }; +struct stk_envelope_mms_notification_download { + struct stk_common_byte_array msg; + ofono_bool_t last; +}; + struct stk_envelope { enum stk_envelope_type type; enum stk_device_identity_type src; @@ -1461,6 +1466,7 @@ struct stk_envelope { struct stk_envelope_timer_expiration timer_expiration; struct stk_envelope_ussd_data_download ussd_data_download; struct stk_envelope_mms_transfer_status mms_status; + struct stk_envelope_mms_notification_download mms_notification; }; }; |