Topic: Problem with TLV in Type 2 tags
Hi,
Im Using a SCL3711 usb stick to emulate Forum type 2 tags, and testing with a Nexus S. I've used the emulate_forum_tag2 example for guidance.
The actual emulation is going quite well except when trying to emulate a tag with payload (an Ndef message) that exceeds 0xFF in size.
I read the Forum Tag Type 2 specification, and under the section about TLV, it says the length (L) part should be represented in a 3-byte format when size is between 0x00FF - 0xFFFE, and I have done this according to the specification. the tag I'm trying to emmulate is the following:
0x0, 0x0, 0x0, 0x0, |
0x0, 0x0, 0x0, 0x0, | This is the tag type 2 header, and should be fine.
0x0, 0x0, 0xff, 0xff, |
0xe1, 0x10, 0xff, 0xf | I set the size to 2040 so it can fit my message.
0x3, 0xff, 0x1, 0x35, | The first four bytes here are the TL part of the TLV. 0x03 is Ndef. 0xFF should indicat the next two bytes represent the size 0x135. The value is stored MSB first.
0xc1, 0x1, 0x0, 0x0, | This is the Ndef header and so on. Seems to be correct, and works for smaller sizes just fine.
0x1, 0x31, 0x54, 0x2, |
...Ndef message
So what I'm asking is : Have I mesunderstood the TLV part of the type 2 tags? are there any other small details I haven't got from the type 2 tag specification?
Any help is highly appreciated
Tor