stkutil: Use standard types

This commit is contained in:
Denis Kenzior 2018-12-29 15:26:37 -06:00
parent 270d19495c
commit 9601ff5331
3 changed files with 374 additions and 375 deletions

View File

@ -417,8 +417,8 @@ static struct stk_menu *stk_menu_create(const char *title,
static struct stk_menu *stk_menu_create_from_set_up_menu( static struct stk_menu *stk_menu_create_from_set_up_menu(
const struct stk_command *cmd) const struct stk_command *cmd)
{ {
gboolean soft_key = (cmd->qualifier & (1 << 0)) != 0; bool soft_key = (cmd->qualifier & (1 << 0)) != 0;
gboolean has_help = (cmd->qualifier & (1 << 7)) != 0; bool has_help = (cmd->qualifier & (1 << 7)) != 0;
return stk_menu_create(cmd->setup_menu.alpha_id, return stk_menu_create(cmd->setup_menu.alpha_id,
&cmd->setup_menu.text_attr, &cmd->setup_menu.text_attr,
@ -432,8 +432,8 @@ static struct stk_menu *stk_menu_create_from_set_up_menu(
static struct stk_menu *stk_menu_create_from_select_item( static struct stk_menu *stk_menu_create_from_select_item(
const struct stk_command *cmd) const struct stk_command *cmd)
{ {
gboolean soft_key = (cmd->qualifier & (1 << 2)) != 0; bool soft_key = (cmd->qualifier & (1 << 2)) != 0;
gboolean has_help = (cmd->qualifier & (1 << 7)) != 0; bool has_help = (cmd->qualifier & (1 << 7)) != 0;
return stk_menu_create(cmd->select_item.alpha_id, return stk_menu_create(cmd->select_item.alpha_id,
&cmd->select_item.text_attr, &cmd->select_item.text_attr,
@ -462,7 +462,7 @@ static void emit_menu_changed(struct ofono_stk *stk)
static struct stk_menu no_menu = { static struct stk_menu no_menu = {
.title = "", .title = "",
.items = &end_item, .items = &end_item,
.has_help = FALSE, .has_help = false,
.default_item = -1, .default_item = -1,
}; };
static char *name = "MainMenu"; static char *name = "MainMenu";
@ -1041,7 +1041,7 @@ static gboolean timers_cb(gpointer user_data)
static void timer_value_from_seconds(struct stk_timer_value *val, int seconds) static void timer_value_from_seconds(struct stk_timer_value *val, int seconds)
{ {
val->has_value = TRUE; val->has_value = true;
val->hour = seconds / 3600; val->hour = seconds / 3600;
seconds -= val->hour * 3600; seconds -= val->hour * 3600;
val->minute = seconds / 60; val->minute = seconds / 60;
@ -1468,7 +1468,7 @@ static void request_confirmation_cb(enum stk_agent_result result,
rsp.result.type = STK_RESULT_TYPE_SUCCESS; rsp.result.type = STK_RESULT_TYPE_SUCCESS;
rsp.get_inkey.text.text = confirm ? "" : NULL; rsp.get_inkey.text.text = confirm ? "" : NULL;
rsp.get_inkey.text.yesno = TRUE; rsp.get_inkey.text.yesno = true;
if (cmd->duration.interval) { if (cmd->duration.interval) {
rsp.get_inkey.duration.unit = cmd->duration.unit; rsp.get_inkey.duration.unit = cmd->duration.unit;
@ -2020,7 +2020,7 @@ static void send_ussd_callback(int error, int dcs, const unsigned char *msg,
rsp.result.type = STK_RESULT_TYPE_SUCCESS; rsp.result.type = STK_RESULT_TYPE_SUCCESS;
rsp.send_ussd.text.text = msg; rsp.send_ussd.text.text = msg;
rsp.send_ussd.text.len = msg_len; rsp.send_ussd.text.len = msg_len;
rsp.send_ussd.text.has_text = TRUE; rsp.send_ussd.text.has_text = true;
} else } else
rsp.result.type = STK_RESULT_TYPE_USSD_RETURN_ERROR; rsp.result.type = STK_RESULT_TYPE_USSD_RETURN_ERROR;
@ -2348,7 +2348,7 @@ static void get_time(struct stk_response *rsp)
rsp->provide_local_info.datetime.minute = t->tm_min; rsp->provide_local_info.datetime.minute = t->tm_min;
rsp->provide_local_info.datetime.second = t->tm_sec; rsp->provide_local_info.datetime.second = t->tm_sec;
rsp->provide_local_info.datetime.timezone = t->tm_gmtoff / 900; rsp->provide_local_info.datetime.timezone = t->tm_gmtoff / 900;
rsp->provide_local_info.datetime.has_timezone = TRUE; rsp->provide_local_info.datetime.has_timezone = true;
return; return;
} }

File diff suppressed because it is too large Load Diff

View File

@ -646,13 +646,13 @@ enum stk_transport_protocol_type {
/* 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; uint8_t *array;
unsigned int len; unsigned int len;
}; };
/* Defined in TS 102.223 Section 8.1 */ /* Defined in TS 102.223 Section 8.1 */
struct stk_address { struct stk_address {
unsigned char ton_npi; uint8_t ton_npi;
char *number; char *number;
}; };
@ -671,9 +671,9 @@ struct stk_address {
* bytes." * bytes."
*/ */
struct stk_subaddress { struct stk_subaddress {
ofono_bool_t has_subaddr; bool has_subaddr;
unsigned char len; uint8_t len;
unsigned char subaddr[23]; uint8_t subaddr[23];
}; };
/* /*
@ -688,14 +688,14 @@ struct stk_subaddress {
* The CCP structure is not decoded, but stored as is from the CTLV * The CCP structure is not decoded, but stored as is from the CTLV
*/ */
struct stk_ccp { struct stk_ccp {
unsigned char len; uint8_t len;
unsigned char ccp[16]; uint8_t ccp[16];
}; };
/* Defined in TS 31.111 Section 8.5 */ /* Defined in TS 31.111 Section 8.5 */
struct stk_cbs_page { struct stk_cbs_page {
unsigned char len; uint8_t len;
unsigned char page[88]; uint8_t page[88];
}; };
/* /*
@ -704,12 +704,12 @@ struct stk_cbs_page {
*/ */
struct stk_duration { struct stk_duration {
enum stk_duration_type unit; enum stk_duration_type unit;
unsigned char interval; uint8_t interval;
}; };
/* Defined in TS 102.223 Section 8.9 */ /* Defined in TS 102.223 Section 8.9 */
struct stk_item { struct stk_item {
unsigned char id; uint8_t id;
char *text; char *text;
}; };
@ -718,27 +718,27 @@ struct stk_item {
* to 0. * to 0.
*/ */
struct stk_response_length { struct stk_response_length {
unsigned char min; uint8_t min;
unsigned char max; uint8_t max;
}; };
/* Defined in TS 102.223 Section 8.12 */ /* Defined in TS 102.223 Section 8.12 */
struct stk_result { struct stk_result {
enum stk_result_type type; enum stk_result_type type;
unsigned int additional_len; unsigned int additional_len;
unsigned char *additional; uint8_t *additional;
}; };
/* Defined in TS 102.223 Section 8.14 */ /* Defined in TS 102.223 Section 8.14 */
struct stk_ss { struct stk_ss {
unsigned char ton_npi; uint8_t ton_npi;
char *ss; char *ss;
}; };
/* Defined in TS 131.111 Section 8.17. Length limit of 160 chars in 23.028 */ /* Defined in TS 131.111 Section 8.17. Length limit of 160 chars in 23.028 */
struct stk_ussd_string { struct stk_ussd_string {
unsigned char dcs; uint8_t dcs;
unsigned char string[160]; uint8_t string[160];
int len; int len;
}; };
@ -750,7 +750,7 @@ struct stk_ussd_string {
* 2 bytes of 2nd level Dedicated File and 2 bytes of Elementary File. * 2 bytes of 2nd level Dedicated File and 2 bytes of Elementary File.
*/ */
struct stk_file { struct stk_file {
unsigned char file[8]; uint8_t file[8];
unsigned int len; unsigned int len;
}; };
@ -758,13 +758,13 @@ struct stk_file {
struct stk_location_info { struct stk_location_info {
char mnc[OFONO_MAX_MNC_LENGTH + 1]; char mnc[OFONO_MAX_MNC_LENGTH + 1];
char mcc[OFONO_MAX_MCC_LENGTH + 1]; char mcc[OFONO_MAX_MCC_LENGTH + 1];
unsigned short lac_tac; uint16_t lac_tac;
ofono_bool_t has_ci; bool has_ci;
unsigned short ci; uint16_t ci;
ofono_bool_t has_ext_ci; bool has_ext_ci;
unsigned short ext_ci; uint16_t ext_ci;
ofono_bool_t has_eutran_ci; bool has_eutran_ci;
guint32 eutran_ci; uint32_t eutran_ci;
}; };
/* /*
@ -772,7 +772,7 @@ struct stk_location_info {
* that the maximum size is 127 according to the rules of CTLVs. * that the maximum size is 127 according to the rules of CTLVs.
*/ */
struct stk_items_next_action_indicator { struct stk_items_next_action_indicator {
unsigned char list[127]; uint8_t list[127];
unsigned int len; unsigned int len;
}; };
@ -781,7 +781,7 @@ struct stk_items_next_action_indicator {
* one should appear more than once. * one should appear more than once.
*/ */
struct stk_event_list { struct stk_event_list {
unsigned char list[21]; uint8_t list[21];
unsigned int len; unsigned int len;
}; };
@ -789,9 +789,9 @@ struct stk_event_list {
* According to 102.223 Section 8.26, the maximum length of cause is 30. * According to 102.223 Section 8.26, the maximum length of cause is 30.
*/ */
struct stk_cause { struct stk_cause {
unsigned char cause[30]; uint8_t cause[30];
unsigned int len; unsigned int len;
ofono_bool_t has_cause; bool has_cause;
}; };
/* /*
@ -799,7 +799,7 @@ struct stk_cause {
* that the maximum size is 127 according to the rules of CTLVs. * that the maximum size is 127 according to the rules of CTLVs.
*/ */
struct stk_transaction_id { struct stk_transaction_id {
unsigned char list[127]; uint8_t list[127];
unsigned int len; unsigned int len;
}; };
@ -809,9 +809,9 @@ struct stk_transaction_id {
* is represented as 10 bits, so the maximum number of channel is 127*8/10=101. * is represented as 10 bits, so the maximum number of channel is 127*8/10=101.
*/ */
struct stk_bcch_channel_list { struct stk_bcch_channel_list {
unsigned short channels[101]; uint16_t channels[101];
unsigned int num; unsigned int num;
ofono_bool_t has_list; bool has_list;
}; };
/* /*
@ -820,8 +820,8 @@ struct stk_bcch_channel_list {
* ids of 0, we use icon_id with 0 to denote empty icon_identifier objects * ids of 0, we use icon_id with 0 to denote empty icon_identifier objects
*/ */
struct stk_icon_id { struct stk_icon_id {
unsigned char qualifier; uint8_t qualifier;
unsigned char id; uint8_t id;
}; };
/* /*
@ -831,19 +831,19 @@ struct stk_icon_id {
* identifier list is 126. * identifier list is 126.
*/ */
struct stk_item_icon_id_list { struct stk_item_icon_id_list {
unsigned char qualifier; uint8_t qualifier;
unsigned char list[126]; uint8_t list[126];
unsigned int len; unsigned int len;
}; };
/* Defined in TS 102.223 Section 8.33 */ /* Defined in TS 102.223 Section 8.33 */
struct stk_reader_status { struct stk_reader_status {
int id; int id;
ofono_bool_t removable; bool removable;
ofono_bool_t present; bool present;
ofono_bool_t id1_size; bool id1_size;
ofono_bool_t card_present; bool card_present;
ofono_bool_t card_powered; bool card_powered;
}; };
/* /*
@ -851,7 +851,7 @@ struct stk_reader_status {
* that the maximum size is 127 according to the rules of CTLVs. * that the maximum size is 127 according to the rules of CTLVs.
*/ */
struct stk_card_atr { struct stk_card_atr {
unsigned char atr[127]; uint8_t atr[127];
unsigned int len; unsigned int len;
}; };
@ -860,60 +860,60 @@ struct stk_card_atr {
* of data is 236. * of data is 236.
*/ */
struct stk_c_apdu { struct stk_c_apdu {
unsigned char cla; uint8_t cla;
unsigned char ins; uint8_t ins;
unsigned char p1; uint8_t p1;
unsigned char p2; uint8_t p2;
unsigned char lc; uint8_t lc;
unsigned char data[236]; uint8_t data[236];
ofono_bool_t has_le; bool has_le;
unsigned char le; uint8_t le;
}; };
/* Defined in TS 102.223 Section 8.36. According to it, the maximum size /* Defined in TS 102.223 Section 8.36. According to it, the maximum size
* of data is 237. * of data is 237.
*/ */
struct stk_r_apdu { struct stk_r_apdu {
unsigned char sw1; uint8_t sw1;
unsigned char sw2; uint8_t sw2;
unsigned char data[237]; uint8_t data[237];
unsigned int len; unsigned int len;
}; };
/* Defined in TS 102.223 Section 8.38 */ /* Defined in TS 102.223 Section 8.38 */
struct stk_timer_value { struct stk_timer_value {
ofono_bool_t has_value; bool has_value;
unsigned char hour; uint8_t hour;
unsigned char minute; uint8_t minute;
unsigned char second; uint8_t second;
}; };
/* Defined in TS 102.223 Section 8.42 */ /* Defined in TS 102.223 Section 8.42 */
struct stk_bc_repeat { struct stk_bc_repeat {
ofono_bool_t has_bc_repeat; bool has_bc_repeat;
unsigned char value; uint8_t value;
}; };
/* Defined in TS 31.111 Section 8.46 */ /* Defined in TS 31.111 Section 8.46 */
struct stk_timing_advance { struct stk_timing_advance {
ofono_bool_t has_value; bool has_value;
enum stk_me_status status; enum stk_me_status status;
/* /*
* Contains bit periods number according to 3GPP TS * Contains bit periods number according to 3GPP TS
* 44.118 Section 9.3.106 / 3GPP TS 44.018 Section * 44.118 Section 9.3.106 / 3GPP TS 44.018 Section
* 10.5.2.40.1, not microseconds * 10.5.2.40.1, not microseconds
*/ */
unsigned char advance; uint8_t advance;
}; };
/* Bearer parameters for GPRS/UTRAN Packet Service/E-UTRAN */ /* Bearer parameters for GPRS/UTRAN Packet Service/E-UTRAN */
struct stk_gprs_bearer_parameters { struct stk_gprs_bearer_parameters {
unsigned char precedence; uint8_t precedence;
unsigned char delay; uint8_t delay;
unsigned char reliability; uint8_t reliability;
unsigned char peak; uint8_t peak;
unsigned char mean; uint8_t mean;
unsigned char pdp_type; uint8_t pdp_type;
}; };
/* Defined in TS 31.111 Section 8.52 */ /* Defined in TS 31.111 Section 8.52 */
@ -927,8 +927,8 @@ struct stk_bearer_description {
* that the maximum size is 127 according to the rules of CTLVs. * that the maximum size is 127 according to the rules of CTLVs.
*/ */
struct stk_card_reader_id { struct stk_card_reader_id {
unsigned char id[127]; uint8_t id[127];
unsigned char len; uint8_t len;
}; };
/* /*
@ -939,7 +939,7 @@ struct stk_other_address {
union { union {
/* Network Byte Order */ /* Network Byte Order */
guint32 ipv4; guint32 ipv4;
unsigned char ipv6[16]; uint8_t ipv6[16];
} addr; } addr;
enum stk_address_type type; enum stk_address_type type;
}; };
@ -947,7 +947,7 @@ struct stk_other_address {
/* Defined in TS 102.223 Section 8.59 */ /* Defined in TS 102.223 Section 8.59 */
struct stk_uicc_te_interface { struct stk_uicc_te_interface {
enum stk_transport_protocol_type protocol; enum stk_transport_protocol_type protocol;
unsigned short port; uint16_t port;
}; };
/* /*
@ -957,43 +957,43 @@ struct stk_uicc_te_interface {
* So the maximum size of aid is 16 bytes. * So the maximum size of aid is 16 bytes.
*/ */
struct stk_aid { struct stk_aid {
unsigned char aid[16]; uint8_t aid[16];
unsigned int len; unsigned int len;
}; };
/* Defined in TS 102.223 Section 8.62 */ /* Defined in TS 102.223 Section 8.62 */
struct stk_display_parameters { struct stk_display_parameters {
unsigned char height; uint8_t height;
unsigned char width; uint8_t width;
unsigned char effects; uint8_t effects;
}; };
/* Defined in TS 102.223 Section 8.63 */ /* Defined in TS 102.223 Section 8.63 */
struct stk_service_record { struct stk_service_record {
unsigned char tech_id; uint8_t tech_id;
unsigned char serv_id; uint8_t serv_id;
unsigned char *serv_rec; uint8_t *serv_rec;
unsigned int len; unsigned int len;
}; };
/* Defined in TS 102.223 Section 8.64 */ /* Defined in TS 102.223 Section 8.64 */
struct stk_device_filter { struct stk_device_filter {
unsigned char tech_id; uint8_t tech_id;
unsigned char *dev_filter; uint8_t *dev_filter;
unsigned int len; unsigned int len;
}; };
/* Defined in TS 102.223 Section 8.65 */ /* Defined in TS 102.223 Section 8.65 */
struct stk_service_search { struct stk_service_search {
unsigned char tech_id; uint8_t tech_id;
unsigned char *ser_search; uint8_t *ser_search;
unsigned int len; unsigned int len;
}; };
/* Defined in TS 102.223 Section 8.66 */ /* Defined in TS 102.223 Section 8.66 */
struct stk_attribute_info { struct stk_attribute_info {
unsigned char tech_id; uint8_t tech_id;
unsigned char *attr_info; uint8_t *attr_info;
unsigned int len; unsigned int len;
}; };
@ -1002,11 +1002,11 @@ struct stk_attribute_info {
* 6-bytes IEEE-802 address, or 4-bytes IrDA device address. * 6-bytes IEEE-802 address, or 4-bytes IrDA device address.
*/ */
struct stk_remote_entity_address { struct stk_remote_entity_address {
unsigned char coding_type; uint8_t coding_type;
ofono_bool_t has_address; bool has_address;
union { union {
unsigned char ieee802[6]; uint8_t ieee802[6];
unsigned char irda[4]; uint8_t irda[4];
} addr; } addr;
}; };
@ -1016,14 +1016,14 @@ struct stk_remote_entity_address {
* of CTLVs. Empty attribute options will have len of 0. * of CTLVs. Empty attribute options will have len of 0.
*/ */
struct stk_text_attribute { struct stk_text_attribute {
unsigned char attributes[127]; uint8_t attributes[127];
unsigned char len; uint8_t len;
}; };
/* Defined in TS 31.111 Section 8.72 */ /* Defined in TS 31.111 Section 8.72 */
struct stk_pdp_act_par { struct stk_pdp_act_par {
unsigned char par[127]; uint8_t par[127];
unsigned char len; uint8_t len;
}; };
/* /*
@ -1033,8 +1033,8 @@ struct stk_pdp_act_par {
* is 124. * is 124.
*/ */
struct stk_item_text_attribute_list { struct stk_item_text_attribute_list {
unsigned char list[124]; uint8_t list[124];
unsigned char len; uint8_t len;
}; };
/* /*
@ -1043,8 +1043,8 @@ struct stk_item_text_attribute_list {
* relative-sized frame. Thus the maximum length of relative size is 126 bytes. * relative-sized frame. Thus the maximum length of relative size is 126 bytes.
*/ */
struct stk_frame_layout { struct stk_frame_layout {
unsigned char layout; uint8_t layout;
unsigned char size[126]; uint8_t size[126];
unsigned int len; unsigned int len;
}; };
@ -1055,17 +1055,17 @@ struct stk_frame_layout {
* list is 126 bytes. * list is 126 bytes.
*/ */
struct stk_frames_info { struct stk_frames_info {
unsigned char id; uint8_t id;
struct { struct {
unsigned char width, height; uint8_t width, height;
} list[63]; } list[63];
unsigned int len; unsigned int len;
}; };
/* Defined in TS 102.223 Section 8.80 */ /* Defined in TS 102.223 Section 8.80 */
struct stk_frame_id { struct stk_frame_id {
ofono_bool_t has_id; bool has_id;
unsigned char id; uint8_t id;
}; };
/* /*
@ -1073,8 +1073,8 @@ struct stk_frame_id {
* that the maximum size is 127 according to the rules of CTLVs. * that the maximum size is 127 according to the rules of CTLVs.
*/ */
struct stk_mms_reference { struct stk_mms_reference {
unsigned char ref[127]; uint8_t ref[127];
unsigned char len; uint8_t len;
}; };
/* /*
@ -1082,8 +1082,8 @@ struct stk_mms_reference {
* that the maximum size is 127 according to the rules of CTLVs. * that the maximum size is 127 according to the rules of CTLVs.
*/ */
struct stk_mms_id { struct stk_mms_id {
unsigned char id[127]; uint8_t id[127];
unsigned char len; uint8_t len;
}; };
/* /*
@ -1091,8 +1091,8 @@ struct stk_mms_id {
* that the maximum size is 127 according to the rules of CTLVs. * that the maximum size is 127 according to the rules of CTLVs.
*/ */
struct stk_mms_transfer_status { struct stk_mms_transfer_status {
unsigned char status[127]; uint8_t status[127];
unsigned char len; uint8_t len;
}; };
/* /*
@ -1100,14 +1100,14 @@ struct stk_mms_transfer_status {
* that the maximum size is 127 according to the rules of CTLVs. * that the maximum size is 127 according to the rules of CTLVs.
*/ */
struct stk_mms_content_id { struct stk_mms_content_id {
unsigned char id[127]; uint8_t id[127];
unsigned char len; uint8_t len;
}; };
/* Defined in TS 102.223 Section 8.88 */ /* Defined in TS 102.223 Section 8.88 */
struct stk_registry_application_data { struct stk_registry_application_data {
unsigned short port; uint16_t port;
unsigned char type; uint8_t type;
char *name; char *name;
}; };
@ -1118,8 +1118,8 @@ struct stk_registry_application_data {
* location information is 126 bytes. * location information is 126 bytes.
*/ */
struct stk_broadcast_network_information { struct stk_broadcast_network_information {
unsigned char tech; uint8_t tech;
unsigned char loc_info[126]; uint8_t loc_info[126];
unsigned int len; unsigned int len;
}; };
@ -1127,21 +1127,21 @@ struct stk_broadcast_network_information {
struct stk_routing_area_info { struct stk_routing_area_info {
char mnc[OFONO_MAX_MNC_LENGTH + 1]; char mnc[OFONO_MAX_MNC_LENGTH + 1];
char mcc[OFONO_MAX_MCC_LENGTH + 1]; char mcc[OFONO_MAX_MCC_LENGTH + 1];
unsigned short lac; uint16_t lac;
unsigned char rac; uint8_t rac;
}; };
/* Defined in TS 131.111 Section 8.99 */ /* Defined in TS 131.111 Section 8.99 */
struct stk_tracking_area_id { struct stk_tracking_area_id {
char mnc[OFONO_MAX_MNC_LENGTH + 1]; char mnc[OFONO_MAX_MNC_LENGTH + 1];
char mcc[OFONO_MAX_MCC_LENGTH + 1]; char mcc[OFONO_MAX_MCC_LENGTH + 1];
unsigned short tac; uint16_t tac;
}; };
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;
ofono_bool_t immediate_response; bool immediate_response;
struct stk_duration duration; struct stk_duration duration;
struct stk_text_attribute text_attr; struct stk_text_attribute text_attr;
struct stk_frame_id frame_id; struct stk_frame_id frame_id;
@ -1166,7 +1166,7 @@ struct stk_command_get_input {
struct stk_command_play_tone { struct stk_command_play_tone {
char *alpha_id; char *alpha_id;
unsigned char tone; uint8_t tone;
struct stk_duration duration; struct stk_duration duration;
struct stk_icon_id icon_id; struct stk_icon_id icon_id;
struct stk_text_attribute text_attr; struct stk_text_attribute text_attr;
@ -1191,7 +1191,7 @@ struct stk_command_select_item {
char *alpha_id; char *alpha_id;
struct l_queue *items; struct l_queue *items;
struct stk_items_next_action_indicator next_act; struct stk_items_next_action_indicator next_act;
unsigned char item_id; uint8_t item_id;
struct stk_icon_id icon_id; struct stk_icon_id icon_id;
struct stk_item_icon_id_list item_icon_id_list; struct stk_item_icon_id_list item_icon_id_list;
struct stk_text_attribute text_attr; struct stk_text_attribute text_attr;
@ -1256,7 +1256,7 @@ struct stk_command_perform_card_apdu {
}; };
struct stk_command_timer_mgmt { struct stk_command_timer_mgmt {
unsigned char timer_id; uint8_t timer_id;
struct stk_timer_value timer_value; struct stk_timer_value timer_value;
}; };
@ -1288,7 +1288,7 @@ struct stk_command_language_notification {
}; };
struct stk_command_launch_browser { struct stk_command_launch_browser {
unsigned char browser_id; uint8_t browser_id;
char *url; char *url;
struct stk_common_byte_array bearer; struct stk_common_byte_array bearer;
struct l_queue *prov_file_refs; struct l_queue *prov_file_refs;
@ -1306,7 +1306,7 @@ struct stk_command_open_channel {
char *alpha_id; char *alpha_id;
struct stk_icon_id icon_id; struct stk_icon_id icon_id;
struct stk_bearer_description bearer_desc; struct stk_bearer_description bearer_desc;
unsigned short buf_size; uint16_t buf_size;
char *apn; char *apn;
struct stk_other_address local_addr; struct stk_other_address local_addr;
char *text_usr; char *text_usr;
@ -1327,7 +1327,7 @@ struct stk_command_close_channel {
struct stk_command_receive_data { struct stk_command_receive_data {
char *alpha_id; char *alpha_id;
struct stk_icon_id icon_id; struct stk_icon_id icon_id;
unsigned char data_len; uint8_t data_len;
struct stk_text_attribute text_attr; struct stk_text_attribute text_attr;
struct stk_frame_id frame_id; struct stk_frame_id frame_id;
}; };
@ -1391,12 +1391,12 @@ struct stk_command_submit_mms {
struct stk_command_display_mms { struct stk_command_display_mms {
struct l_queue *mms_subm_files; struct l_queue *mms_subm_files;
struct stk_mms_id mms_id; struct stk_mms_id mms_id;
ofono_bool_t imd_resp; bool imd_resp;
struct stk_frame_id frame_id; struct stk_frame_id frame_id;
}; };
struct stk_command_activate { struct stk_command_activate {
unsigned char actv_desc; uint8_t actv_desc;
}; };
enum stk_command_parse_result { enum stk_command_parse_result {
@ -1407,9 +1407,9 @@ enum stk_command_parse_result {
}; };
struct stk_command { struct stk_command {
unsigned char number; uint8_t number;
unsigned char type; uint8_t type;
unsigned char qualifier; uint8_t qualifier;
enum stk_device_identity_type src; enum stk_device_identity_type src;
enum stk_device_identity_type dst; enum stk_device_identity_type dst;
enum stk_command_parse_result status; enum stk_command_parse_result status;
@ -1458,8 +1458,8 @@ struct stk_response_generic {
struct stk_answer_text { struct stk_answer_text {
char *text; char *text;
ofono_bool_t packed; bool packed;
ofono_bool_t yesno; bool yesno;
/* /*
* If a "Yes/No" answer was requested in a GET INKEY command, * If a "Yes/No" answer was requested in a GET INKEY command,
* .yesno must be TRUE and text should be non-NULL to indicate * .yesno must be TRUE and text should be non-NULL to indicate
@ -1468,14 +1468,14 @@ struct stk_answer_text {
}; };
struct stk_ussd_text { struct stk_ussd_text {
ofono_bool_t has_text; bool has_text;
const unsigned char *text; const uint8_t *text;
int dcs; int dcs;
int len; int len;
}; };
struct stk_channel { struct stk_channel {
unsigned char id; uint8_t id;
enum stk_channel_status status; enum stk_channel_status status;
}; };
@ -1493,13 +1493,13 @@ struct stk_response_poll_interval {
}; };
struct stk_response_select_item { struct stk_response_select_item {
unsigned char item_id; uint8_t item_id;
}; };
struct stk_response_set_up_call { struct stk_response_set_up_call {
struct stk_common_byte_array cc_requested_action; struct stk_common_byte_array cc_requested_action;
struct { struct {
ofono_bool_t cc_modified; bool cc_modified;
struct stk_result result; struct stk_result result;
} modified_result; } modified_result;
}; };
@ -1542,7 +1542,7 @@ struct stk_response_local_info {
}; };
struct stk_response_timer_mgmt { struct stk_response_timer_mgmt {
unsigned char id; uint8_t id;
struct stk_timer_value value; struct stk_timer_value value;
}; };
@ -1557,16 +1557,16 @@ struct stk_response_send_ussd {
struct stk_response_open_channel { struct stk_response_open_channel {
struct stk_channel channel; struct stk_channel channel;
struct stk_bearer_description bearer_desc; struct stk_bearer_description bearer_desc;
unsigned short buf_size; uint16_t buf_size;
}; };
struct stk_response_receive_data { struct stk_response_receive_data {
struct stk_common_byte_array rx_data; struct stk_common_byte_array rx_data;
unsigned short rx_remaining; uint16_t rx_remaining;
}; };
struct stk_response_send_data { struct stk_response_send_data {
unsigned short tx_avail; uint16_t tx_avail;
}; };
struct stk_response_channel_status { struct stk_response_channel_status {
@ -1574,9 +1574,9 @@ struct stk_response_channel_status {
}; };
struct stk_response { struct stk_response {
unsigned char number; uint8_t number;
unsigned char type; uint8_t type;
unsigned char qualifier; uint8_t qualifier;
enum stk_device_identity_type src; enum stk_device_identity_type src;
enum stk_device_identity_type dst; enum stk_device_identity_type dst;
struct stk_result result; struct stk_result result;
@ -1623,8 +1623,8 @@ struct stk_envelope_cbs_pp_download {
}; };
struct stk_envelope_menu_selection { struct stk_envelope_menu_selection {
unsigned char item_id; uint8_t item_id;
ofono_bool_t help_request; bool help_request;
}; };
struct stk_envelope_sms_mo_control { struct stk_envelope_sms_mo_control {
@ -1670,12 +1670,12 @@ struct stk_envelope_event_download {
enum stk_event_type type; enum stk_event_type type;
union { union {
struct { struct {
unsigned char transaction_id; uint8_t transaction_id;
struct stk_address caller_address; struct stk_address caller_address;
struct stk_subaddress caller_subaddress; struct stk_subaddress caller_subaddress;
} mt_call; } mt_call;
struct { struct {
unsigned char transaction_id; uint8_t transaction_id;
} call_connected; } call_connected;
struct { struct {
struct stk_transaction_id transaction_ids; struct stk_transaction_id transaction_ids;
@ -1693,7 +1693,7 @@ struct stk_envelope_event_download {
} browser_termination; } browser_termination;
struct { struct {
struct stk_channel channel; struct stk_channel channel;
unsigned short channel_data_len; uint16_t channel_data_len;
} data_available; } data_available;
struct { struct {
struct stk_channel channel; struct stk_channel channel;
@ -1729,7 +1729,7 @@ struct stk_envelope_event_download {
}; };
struct stk_envelope_timer_expiration { struct stk_envelope_timer_expiration {
unsigned char id; uint8_t id;
struct stk_timer_value value; struct stk_timer_value value;
}; };
@ -1745,13 +1745,13 @@ struct stk_envelope_mms_transfer_status {
struct stk_envelope_mms_notification_download { struct stk_envelope_mms_notification_download {
struct stk_common_byte_array msg; struct stk_common_byte_array msg;
ofono_bool_t last; bool last;
}; };
struct stk_envelope_terminal_apps { struct stk_envelope_terminal_apps {
struct stk_registry_application_data *list; struct stk_registry_application_data *list;
int count; int count;
ofono_bool_t last; bool last;
}; };
struct stk_envelope { struct stk_envelope {
@ -1773,16 +1773,15 @@ struct stk_envelope {
}; };
}; };
struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu, struct stk_command *stk_command_new_from_pdu(const uint8_t *pdu,
unsigned int len); unsigned int len);
void stk_command_free(struct stk_command *command); void stk_command_free(struct stk_command *command);
const unsigned char *stk_pdu_from_response(const struct stk_response *response, const uint8_t *stk_pdu_from_response(const struct stk_response *response,
unsigned int *out_length); unsigned int *out_length);
const unsigned char *stk_pdu_from_envelope(const struct stk_envelope *envelope, const uint8_t *stk_pdu_from_envelope(const struct stk_envelope *envelope,
unsigned int *out_length); unsigned int *out_length);
char *stk_text_to_html(const char *text, char *stk_text_to_html(const char *text, const uint16_t *attrs, int num_attrs);
const unsigned short *attrs, int num_attrs); char *stk_image_to_xpm(const uint8_t *img, unsigned int len,
char *stk_image_to_xpm(const unsigned char *img, unsigned int len, enum stk_img_scheme scheme, const uint8_t *clut,
enum stk_img_scheme scheme, const unsigned char *clut, uint16_t clut_len);
unsigned short clut_len);