mirror of git://git.sysmocom.de/ofono
stkutil: Add MMS Notification DL envelope builder
This commit is contained in:
parent
6720f90e13
commit
0baaf2ce5b
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue