mirror of git://git.sysmocom.de/ofono
stk: Add poll interval proactive command parser
This commit is contained in:
parent
bf7afc6130
commit
5b030c4a19
|
@ -2230,6 +2230,31 @@ static gboolean parse_play_tone(struct stk_command *command,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean parse_poll_interval(struct stk_command *command,
|
||||||
|
struct comprehension_tlv_iter *iter)
|
||||||
|
{
|
||||||
|
struct stk_command_poll_interval *obj = &command->poll_interval;
|
||||||
|
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_DURATION,
|
||||||
|
DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
|
||||||
|
&obj->duration,
|
||||||
|
STK_DATA_OBJECT_TYPE_INVALID);
|
||||||
|
|
||||||
|
if (ret == FALSE)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
command->destructor = NULL;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void destroy_send_sms(struct stk_command *command)
|
static void destroy_send_sms(struct stk_command *command)
|
||||||
{
|
{
|
||||||
g_free(command->send_sms.alpha_id);
|
g_free(command->send_sms.alpha_id);
|
||||||
|
@ -2358,6 +2383,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
|
||||||
case STK_COMMAND_TYPE_PLAY_TONE:
|
case STK_COMMAND_TYPE_PLAY_TONE:
|
||||||
ok = parse_play_tone(command, &iter);
|
ok = parse_play_tone(command, &iter);
|
||||||
break;
|
break;
|
||||||
|
case STK_COMMAND_TYPE_POLL_INTERVAL:
|
||||||
|
ok = parse_poll_interval(command, &iter);
|
||||||
|
break;
|
||||||
case STK_COMMAND_TYPE_SEND_SMS:
|
case STK_COMMAND_TYPE_SEND_SMS:
|
||||||
ok = parse_send_sms(command, &iter);
|
ok = parse_send_sms(command, &iter);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -824,6 +824,10 @@ struct stk_command_play_tone {
|
||||||
struct stk_frame_id frame_id;
|
struct stk_frame_id frame_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct stk_command_poll_interval {
|
||||||
|
struct stk_duration duration;
|
||||||
|
};
|
||||||
|
|
||||||
struct stk_command_send_sms {
|
struct stk_command_send_sms {
|
||||||
char *alpha_id;
|
char *alpha_id;
|
||||||
struct stk_address address;
|
struct stk_address address;
|
||||||
|
@ -847,6 +851,7 @@ struct stk_command {
|
||||||
struct stk_command_get_input get_input;
|
struct stk_command_get_input get_input;
|
||||||
struct stk_command_play_tone play_tone;
|
struct stk_command_play_tone play_tone;
|
||||||
struct stk_command_send_sms send_sms;
|
struct stk_command_send_sms send_sms;
|
||||||
|
struct stk_command_poll_interval poll_interval;
|
||||||
};
|
};
|
||||||
|
|
||||||
void (*destructor)(struct stk_command *command);
|
void (*destructor)(struct stk_command *command);
|
||||||
|
|
Loading…
Reference in New Issue