mirror of git://git.sysmocom.de/ofono
stkutil: Add power on card command parser
This commit is contained in:
parent
ee12e0fd50
commit
d6e1718a82
|
@ -2648,6 +2648,19 @@ static gboolean parse_power_off_card(struct stk_command *command,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean parse_power_on_card(struct stk_command *command,
|
||||
struct comprehension_tlv_iter *iter)
|
||||
{
|
||||
if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
|
||||
return FALSE;
|
||||
|
||||
if ((command->dst < STK_DEVICE_IDENTITY_TYPE_CARD_READER_0) ||
|
||||
(command->dst > STK_DEVICE_IDENTITY_TYPE_CARD_READER_7))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
|
||||
unsigned int len)
|
||||
{
|
||||
|
@ -2754,6 +2767,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
|
|||
case STK_COMMAND_TYPE_POWER_OFF_CARD:
|
||||
ok = parse_power_off_card(command, &iter);
|
||||
break;
|
||||
case STK_COMMAND_TYPE_POWER_ON_CARD:
|
||||
ok = parse_power_on_card(command, &iter);
|
||||
break;
|
||||
default:
|
||||
ok = FALSE;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue