emsec / ChameleonMini

The ChameleonMini is a versatile contactless smartcard emulator compliant to NFC. The ChameleonMini was developed by https://kasper-oswald.de. The device is available at https://shop.kasper.it. For further information see the Getting Started Page https://rawgit.com/emsec/ChameleonMini/master/Doc/Doxygen/html/_page__getting_started.html or the Wiki tab above.
Other
1.73k stars 392 forks source link

Support Ultralight NTAG215 #264

Open FrankWu100 opened 4 years ago

FrankWu100 commented 4 years ago

Thanks for #253 too. I compare NTAG215 with lots of codes. And read the Ultralight & NTAG spec from NXP, to make sure those can just be implemented together with the same structure.

//NTAG213 & NTAG216 can also be supported by little add-on codes.

note: Ultralight NTAG: https://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf Ultralight EV1: https://www.nxp.com/docs/en/data-sheet/MF0ULX1.pdf

fptrs commented 4 years ago

Hi @FrankWu100, I just merged #253, what is the difference to your pull request?

FrankWu100 commented 4 years ago

Hi @FrankWu100, I just merged #253, what is the difference to your pull request?

Just use the same code from MifareUltralight.c and else. If we need to do other methods's improve or implements, no need to maintained two files. Because of almost the same core functions between Ultralight EV1 and NTAG213/215/216.

fptrs commented 4 years ago

Hi @FrankWu100, I just merged #253, what is the difference to your pull request?

Just use the same code from MifareUltralight.c and else. If we need to do other methods's improve or implements, no need to maintained two files. Because of almost the same core functions between Ultralight EV1 and NTAG213/215/216.

So you suggest to remove the other pull request and use your code?

FrankWu100 commented 4 years ago

Hi @FrankWu100, I just merged #253, what is the difference to your pull request?

Just use the same code from MifareUltralight.c and else. If we need to do other methods's improve or implements, no need to maintained two files. Because of almost the same core functions between Ultralight EV1 and NTAG213/215/216.

So you suggest to remove the other pull request and use your code?

No, not at all. Because #253 still is good begining. Maybe we can discuss together. Which the is better way for future. Then if need combine into the ultralight, rebase it and pull the new request would more better.

gcammisa commented 4 years ago

I can confirm that #253 is based on the Mifare Ultralight code. Mifare Ultralight and NTAG21x tags are similar in the basic command and state machine implementation, but are a bit different regarding the lockbits / security mechanism used.

Since I think that having clean and easy to read and understand code should have priority over having "less" code, my idea when I started working on NTAG215 was to have a separate Application, with its respective .c and .h file, that could be extended to then support NTAG213 and NTAG216 with minimal modifications.

Merging the applications for the Mifare Ultralight tag family and the NTAG21x tag family would make the code harder to read and to "compare" to the datasheet for whoever is trying to make any modification to such code, and modification to the Mifare Ultralight code would end up affecting the NTAG21x code and vice-versa, which makes the code harder to maintain.

Of course, the decision of which approach to take depends on what the maintainer prefer and what whoever ends up adding the missing stuff to the NTAG code prefers, I'm just explaining the rationale behind my choice to make the NTAG21x code as a separate application.

fptrs commented 4 years ago

We really appreciate both of your contributions. I think for the time being we keep @gcammisa approach since it is easier for beginners to get into the code. If we run out of program memory we can still merge these applications.