diff options
author | Mark A. Greer <mgreer@animalcreek.com> | 2014-03-20 17:32:05 -0700 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-04-07 01:21:28 +0200 |
commit | 687a086001c36b6368fdf906794f702c24383bb8 (patch) | |
tree | 6002640bea678c42e2f479010b056976aecc35a2 | |
parent | be642f15f7d9d48393d020c09ad0b9cddab2225a (diff) | |
download | neard-687a086001c36b6368fdf906794f702c24383bb8.tar.gz neard-687a086001c36b6368fdf906794f702c24383bb8.tar.bz2 neard-687a086001c36b6368fdf906794f702c24383bb8.zip |
tag: Type 4: Extend tag structure to store Type 4 file ID
Extend the Type 4 tag-specific section of the tag structure to hold
the File ID from the 'NDEF File Control TLV' portion of the Capability
Container file. Also provide accessor functions to get & set the its
value.
-rw-r--r-- | include/tag.h | 2 | ||||
-rw-r--r-- | src/tag.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/tag.h b/include/tag.h index c734d7a..5332027 100644 --- a/include/tag.h +++ b/include/tag.h @@ -110,6 +110,8 @@ void near_tag_set_c_apdu_max_size(struct near_tag *tag, uint16_t size); uint16_t near_tag_get_c_apdu_max_size(struct near_tag *tag); void near_tag_set_r_apdu_max_size(struct near_tag *tag, uint16_t size); uint16_t near_tag_get_r_apdu_max_size(struct near_tag *tag); +void near_tag_set_file_id(struct near_tag *tag, uint16_t file_id); +uint16_t near_tag_get_file_id(struct near_tag *tag); void near_tag_set_idm(struct near_tag *tag, uint8_t *idm, uint8_t len); uint8_t *near_tag_get_idm(struct near_tag *tag, uint8_t *len); void near_tag_set_attr_block(struct near_tag *tag, uint8_t *attr, uint8_t len); @@ -73,6 +73,7 @@ struct near_tag { uint16_t max_ndef_size; uint16_t c_apdu_max_size; uint16_t r_apdu_max_size; + uint16_t file_id; } t4; struct { @@ -978,6 +979,22 @@ uint16_t near_tag_get_r_apdu_max_size(struct near_tag *tag) return tag->t4.r_apdu_max_size; } +void near_tag_set_file_id(struct near_tag *tag, uint16_t file_id) +{ + if (!tag) + return; + + tag->t4.file_id = file_id; +} + +uint16_t near_tag_get_file_id(struct near_tag *tag) +{ + if (!tag) + return 0; + + return tag->t4.file_id; +} + void near_tag_set_idm(struct near_tag *tag, uint8_t *idm, uint8_t len) { if (!tag || len > TYPE3_IDM_LEN) |