diff options
author | Yang Gu <yang.gu@intel.com> | 2010-05-13 18:48:39 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-05-13 15:31:59 -0500 |
commit | ee12e0fd50b39ca86b38c06dd3bec361308b1ab6 (patch) | |
tree | 74b40e90afe4b08a0286e5173d2f1e2174a3c9b2 /src | |
parent | 84ea89926f6ea7c211d321f93ab3ab487a9e5cad (diff) | |
download | ofono-ee12e0fd50b39ca86b38c06dd3bec361308b1ab6.tar.bz2 |
stkutil: Add power off card command parser
Diffstat (limited to 'src')
-rw-r--r-- | src/stkutil.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/stkutil.c b/src/stkutil.c index 52f1ef3f..768dd38d 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -2635,6 +2635,19 @@ static gboolean parse_perform_card_apdu(struct stk_command *command, return TRUE; } +static gboolean parse_power_off_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) { @@ -2738,6 +2751,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu, case STK_COMMAND_TYPE_PERFORM_CARD_APDU: ok = parse_perform_card_apdu(command, &iter); break; + case STK_COMMAND_TYPE_POWER_OFF_CARD: + ok = parse_power_off_card(command, &iter); + break; default: ok = FALSE; break; |