From 2b42e25bfad80de03ade5677df14472f7021c87c Mon Sep 17 00:00:00 2001 From: Ravi kumar Veeramally Date: Wed, 25 Jan 2012 15:41:48 +0200 Subject: 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. --- plugins/nfctype1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/nfctype1.c') 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 ; } -- cgit v1.2.3