summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@animalcreek.com>2014-02-26 13:54:43 -0700
committerSamuel Ortiz <sameo@linux.intel.com>2014-03-19 02:10:06 +0100
commite3da7831d83625afc512b69c00f04456d75691d3 (patch)
tree3d4cd6c46e07fd855483c22bbddd91b5e2a42f3f
parentd5264a29d7eb5214fd95c94eea37042369df2238 (diff)
downloadneard-e3da7831d83625afc512b69c00f04456d75691d3.tar.gz
neard-e3da7831d83625afc512b69c00f04456d75691d3.tar.bz2
neard-e3da7831d83625afc512b69c00f04456d75691d3.zip
nfctype4: Store r_apdu_max_size in tag structure
Use the recently created near_tag_get_r_apdu_max_size() and near_tag_set_r_apdu_max_size() routines to store the Type 4 tag's 'r_apdu_max_size' value.
-rw-r--r--plugins/nfctype4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/nfctype4.c b/plugins/nfctype4.c
index 9192c78..15dfafd 100644
--- a/plugins/nfctype4.c
+++ b/plugins/nfctype4.c
@@ -376,6 +376,7 @@ static int t4_readbin_NDEF_ID(uint8_t *resp, int length, void *data)
near_tag_set_max_ndef_size(tag, cookie->max_ndef_size);
near_tag_set_c_apdu_max_size(tag, cookie->c_apdu_max_size);
+ near_tag_set_r_apdu_max_size(tag, cookie->r_apdu_max_size);
near_tag_set_blank(tag, FALSE);
/* save the tag */
@@ -784,6 +785,8 @@ static int read_cc_file(uint8_t *resp, int length, void *data)
}
memcpy(read_cc, &resp[1], length - 2 - NFC_STATUS_BYTE_LEN) ;
+ cookie->r_apdu_max_size = g_ntohs(read_cc->max_R_apdu_data_size) -
+ APDU_HEADER_LEN;
cookie->c_apdu_max_size = g_ntohs(read_cc->max_C_apdu_data_size);
cookie->max_ndef_size = g_ntohs(read_cc->tlv_fc.max_ndef_size);
@@ -795,6 +798,7 @@ static int read_cc_file(uint8_t *resp, int length, void *data)
near_tag_set_max_ndef_size(tag, cookie->memory_size);
near_tag_set_c_apdu_max_size(tag, cookie->c_apdu_max_size);
+ near_tag_set_r_apdu_max_size(tag, cookie->r_apdu_max_size);
if (read_cc->tlv_fc.tag != 0x4) {
near_error("NDEF File not found") ;