summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/tag.h2
-rw-r--r--src/tag.c17
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);
diff --git a/src/tag.c b/src/tag.c
index e1594dc..cb71e56 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -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)