mirror of git://git.sysmocom.de/ofono
stkutil: Add parser for broadcast network info
This commit is contained in:
parent
aa3c5807ad
commit
89d19b37d9
|
@ -1803,6 +1803,29 @@ static gboolean parse_dataobj_activate_descriptor(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Defined in TS 102.223 Section 8.90 */
|
||||||
|
static gboolean parse_dataobj_broadcast_network_info(
|
||||||
|
struct comprehension_tlv_iter *iter, void *user)
|
||||||
|
{
|
||||||
|
struct stk_broadcast_network_information *bni = user;
|
||||||
|
const unsigned char *data;
|
||||||
|
unsigned int len = comprehension_tlv_iter_get_length(iter);
|
||||||
|
|
||||||
|
if (len < 2)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
data = comprehension_tlv_iter_get_data(iter);
|
||||||
|
|
||||||
|
if (data[0] > 0x03)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
bni->tech = data[0];
|
||||||
|
bni->len = len - 1;
|
||||||
|
memcpy(bni->loc_info, data + 1, bni->len);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static dataobj_handler handler_for_type(enum stk_data_object_type type)
|
static dataobj_handler handler_for_type(enum stk_data_object_type type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -1970,6 +1993,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
|
||||||
return parse_dataobj_registry_application_data;
|
return parse_dataobj_registry_application_data;
|
||||||
case STK_DATA_OBJECT_TYPE_ACTIVATE_DESCRIPTOR:
|
case STK_DATA_OBJECT_TYPE_ACTIVATE_DESCRIPTOR:
|
||||||
return parse_dataobj_activate_descriptor;
|
return parse_dataobj_activate_descriptor;
|
||||||
|
case STK_DATA_OBJECT_TYPE_BROADCAST_NETWORK_INFO:
|
||||||
|
return parse_dataobj_broadcast_network_info;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
|
|
|
@ -370,6 +370,13 @@ enum stk_frame_layout_type {
|
||||||
STK_LAYOUT_VERTICAL = 0x02
|
STK_LAYOUT_VERTICAL = 0x02
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum stk_broadcast_network_technology {
|
||||||
|
STK_BROADCAST_NETWORK_DVB_H = 0x00,
|
||||||
|
STK_BROADCAST_NETWORK_DVB_T = 0x01,
|
||||||
|
STK_BROADCAST_NETWORK_DVB_SH = 0x02,
|
||||||
|
STK_BROADCAST_NETWORK_T_DMB = 0x03
|
||||||
|
};
|
||||||
|
|
||||||
/* For data object that only has a byte array with undetermined length */
|
/* For data object that only has a byte array with undetermined length */
|
||||||
struct stk_common_byte_array {
|
struct stk_common_byte_array {
|
||||||
unsigned char *array;
|
unsigned char *array;
|
||||||
|
@ -764,6 +771,18 @@ struct stk_registry_application_data {
|
||||||
char *name;
|
char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* According to 102.223 Section 8.90 the length of CTLV is 1 byte. This means
|
||||||
|
* that the maximum length is 127 bytes for the total length of broadcast
|
||||||
|
* network technology and location information. Thus the maximum length of
|
||||||
|
* location information is 126 bytes.
|
||||||
|
*/
|
||||||
|
struct stk_broadcast_network_information {
|
||||||
|
unsigned char tech;
|
||||||
|
unsigned char loc_info[126];
|
||||||
|
unsigned int len;
|
||||||
|
};
|
||||||
|
|
||||||
struct stk_command_display_text {
|
struct stk_command_display_text {
|
||||||
char *text;
|
char *text;
|
||||||
struct stk_icon_id icon_id;
|
struct stk_icon_id icon_id;
|
||||||
|
|
Loading…
Reference in New Issue