mirror of git://git.sysmocom.de/ofono
stk: Add parser for language notification commands
This commit is contained in:
parent
b4e081f0e1
commit
5129bb2998
|
@ -2835,6 +2835,29 @@ static gboolean parse_send_dtmf(struct stk_command *command,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean parse_language_notification(struct stk_command *command,
|
||||
struct comprehension_tlv_iter *iter)
|
||||
{
|
||||
struct stk_command_language_notification *obj =
|
||||
&command->language_notification;
|
||||
gboolean ret;
|
||||
|
||||
if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
|
||||
return FALSE;
|
||||
|
||||
if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
|
||||
return FALSE;
|
||||
|
||||
ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_LANGUAGE, 0,
|
||||
&obj->language,
|
||||
STK_DATA_OBJECT_TYPE_INVALID);
|
||||
|
||||
if (ret == FALSE)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
|
||||
unsigned int len)
|
||||
{
|
||||
|
@ -2959,6 +2982,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
|
|||
case STK_COMMAND_TYPE_SEND_DTMF:
|
||||
ok = parse_send_dtmf(command, &iter);
|
||||
break;
|
||||
case STK_COMMAND_TYPE_LANGUAGE_NOTIFICATION:
|
||||
ok = parse_language_notification(command, &iter);
|
||||
break;
|
||||
default:
|
||||
ok = FALSE;
|
||||
break;
|
||||
|
|
|
@ -988,6 +988,10 @@ struct stk_command_send_dtmf {
|
|||
struct stk_frame_id frame_id;
|
||||
};
|
||||
|
||||
struct stk_command_language_notification {
|
||||
char language[3];
|
||||
};
|
||||
|
||||
struct stk_command {
|
||||
unsigned char number;
|
||||
unsigned char type;
|
||||
|
@ -1012,6 +1016,7 @@ struct stk_command {
|
|||
struct stk_command_setup_idle_mode_text setup_idle_mode_text;
|
||||
struct stk_command_run_at_command run_at_command;
|
||||
struct stk_command_send_dtmf send_dtmf;
|
||||
struct stk_command_language_notification language_notification;
|
||||
};
|
||||
|
||||
void (*destructor)(struct stk_command *command);
|
||||
|
|
Loading…
Reference in New Issue