summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRavi kumar Veeramally <ravikumar.veeramally@linux.intel.com>2012-01-25 15:41:48 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-01-27 19:31:58 +0100
commit2b42e25bfad80de03ade5677df14472f7021c87c (patch)
treef91bb30c4f3f1d5bb5f9c439853f2873474502e7 /plugins
parent260aaf1629a7f27e0e727cabc82f8f5dc6d52d73 (diff)
downloadneard-2b42e25bfad80de03ade5677df14472f7021c87c.tar.gz
neard-2b42e25bfad80de03ade5677df14472f7021c87c.tar.bz2
neard-2b42e25bfad80de03ade5677df14472f7021c87c.zip
tag: Add memory layout enum to tag structure
Added memory(static, dynamic, other ..) layout enum to tag structure. Helpful to check the tag layout when writing data on tag.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/nfctype1.c4
-rw-r--r--plugins/nfctype2.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/plugins/nfctype1.c b/plugins/nfctype1.c
index 83fe498..e166dba 100644
--- a/plugins/nfctype1.c
+++ b/plugins/nfctype1.c
@@ -248,6 +248,7 @@ static int meta_recv(uint8_t *resp, int length, void *data)
/* Check Static or Dynamic memory model */
if (resp[OFFSET_HEADER_ROM] == HR0_TYPE1_STATIC) {
DBG("READ Static complete");
+ near_tag_set_memory_layout(tag, NEAR_TAG_MEMORY_STATIC);
err = near_tlv_parse(t1_tag->tag, t1_tag->cb,
cc + LEN_CC_BYTES, TAG_T1_DATA_LENGTH(cc));
if (err < 0)
@@ -255,7 +256,8 @@ static int meta_recv(uint8_t *resp, int length, void *data)
g_free(t1_tag);
} else if ((resp[OFFSET_HEADER_ROM] & 0xF0) == HR0_TYPE2_HIGH) {
- err = read_dynamic_tag(cc, length, t1_tag);
+ near_tag_set_memory_layout(tag, NEAR_TAG_MEMORY_DYNAMIC);
+ err = read_dynamic_tag(cc, length, t1_tag);
} else {
err = -EOPNOTSUPP ;
}
diff --git a/plugins/nfctype2.c b/plugins/nfctype2.c
index 32ae537..4a78fa3 100644
--- a/plugins/nfctype2.c
+++ b/plugins/nfctype2.c
@@ -201,6 +201,8 @@ static int meta_recv(uint8_t *resp, int length, void *data)
else
near_tag_set_ro(tag, FALSE);
+ near_tag_set_memory_layout(tag, NEAR_TAG_MEMORY_STATIC);
+
err = data_read(t2_tag);
out: