mirror of git://git.sysmocom.de/ofono
stkutil: Add the Menu Selection envelope builder
This commit is contained in:
parent
758005a7c4
commit
b2dfa2321f
|
@ -3561,6 +3561,20 @@ static gboolean build_dataobj_imei(struct stk_tlv_builder *tlv,
|
|||
stk_tlv_builder_close_container(tlv);
|
||||
}
|
||||
|
||||
/* Described in TS 102.223 Section 8.21 */
|
||||
static gboolean build_dataobj_help_request(struct stk_tlv_builder *tlv,
|
||||
const void *data, gboolean cr)
|
||||
{
|
||||
const ofono_bool_t *help = data;
|
||||
unsigned char tag = STK_DATA_OBJECT_TYPE_HELP_REQUEST;
|
||||
|
||||
if (*help != TRUE)
|
||||
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.22 */
|
||||
static gboolean build_dataobj_network_measurement_results(
|
||||
struct stk_tlv_builder *tlv,
|
||||
|
@ -4242,6 +4256,17 @@ const unsigned char *stk_pdu_from_envelope(const struct stk_envelope *envelope,
|
|||
&envelope->cbs_pp_download.page,
|
||||
NULL);
|
||||
break;
|
||||
case STK_ENVELOPE_TYPE_MENU_SELECTION:
|
||||
ok = build_dataobj(&builder,
|
||||
build_envelope_dataobj_device_ids,
|
||||
DATAOBJ_FLAG_CR,
|
||||
envelope,
|
||||
build_dataobj_item_id, DATAOBJ_FLAG_CR,
|
||||
&envelope->menu_selection.item_id,
|
||||
build_dataobj_help_request, 0,
|
||||
&envelope->menu_selection.help_request,
|
||||
NULL);
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
};
|
||||
|
|
|
@ -1182,6 +1182,11 @@ struct stk_envelope_cbs_pp_download {
|
|||
struct cbs page;
|
||||
};
|
||||
|
||||
struct stk_envelope_menu_selection {
|
||||
unsigned char item_id;
|
||||
ofono_bool_t help_request;
|
||||
};
|
||||
|
||||
struct stk_envelope {
|
||||
enum stk_envelope_type type;
|
||||
enum stk_device_identity_type src;
|
||||
|
@ -1189,6 +1194,7 @@ struct stk_envelope {
|
|||
union {
|
||||
struct stk_envelope_sms_pp_download sms_pp_download;
|
||||
struct stk_envelope_cbs_pp_download cbs_pp_download;
|
||||
struct stk_envelope_menu_selection menu_selection;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue