googlearchive / chrome-nfc

Chrome App NFC Library
Other
214 stars 69 forks source link

Support other tags, including NTAG203 #10

Closed Zertz closed 3 years ago

Zertz commented 10 years ago

I'm unsure how this could be implemented cleanly as I am not that familiar with the library, but adding support for different tags should be relatively straightforward.

I had to make a few simple changes to properly read and write to NTAG203 tags, all in tt2.js 1) Line 111: var max_len = 168 - 24; a) That variable currently is never used, it should probably be in some sort of tag configuration object so it can be referenced at lines 116 and 149 rather than the current hardcoded values.

2) Line 116: var blen = 144 / 8; a) This should use max_len instead of a hardcoded value.

3) Line 149: if (card_blknum > (144 / 4)) { a) This should also use max_len instead of a hardcoded value. b) As far as I know, a page always consists of 4 bytes, but perhaps that should also be configurable.