Add support for Mifare Mini 0.3k
This commit is contained in:
parent
48c9383ce1
commit
b819315caa
3 changed files with 22 additions and 1 deletions
|
@ -38,6 +38,8 @@ freefare_tag_new (nfc_device *device, nfc_target target)
|
||||||
|
|
||||||
if (felica_taste (device, target)) {
|
if (felica_taste (device, target)) {
|
||||||
tag = felica_tag_new (device, target);
|
tag = felica_tag_new (device, target);
|
||||||
|
} else if (mifare_mini_taste (device, target)) {
|
||||||
|
tag = mifare_mini_tag_new (device, target);
|
||||||
} else if (mifare_classic1k_taste (device, target)) {
|
} else if (mifare_classic1k_taste (device, target)) {
|
||||||
tag = mifare_classic1k_tag_new (device, target);
|
tag = mifare_classic1k_tag_new (device, target);
|
||||||
} else if (mifare_classic4k_taste (device, target)) {
|
} else if (mifare_classic4k_taste (device, target)) {
|
||||||
|
@ -155,6 +157,8 @@ freefare_get_tag_friendly_name (FreefareTag tag)
|
||||||
switch (tag->type) {
|
switch (tag->type) {
|
||||||
case FELICA:
|
case FELICA:
|
||||||
return "FeliCA";
|
return "FeliCA";
|
||||||
|
case MIFARE_MINI:
|
||||||
|
return "Mifare Mini 0.3k";
|
||||||
case MIFARE_CLASSIC_1K:
|
case MIFARE_CLASSIC_1K:
|
||||||
return "Mifare Classic 1k";
|
return "Mifare Classic 1k";
|
||||||
case MIFARE_CLASSIC_4K:
|
case MIFARE_CLASSIC_4K:
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
enum freefare_tag_type {
|
enum freefare_tag_type {
|
||||||
FELICA,
|
FELICA,
|
||||||
// MIFARE_MINI,
|
MIFARE_MINI,
|
||||||
MIFARE_CLASSIC_1K,
|
MIFARE_CLASSIC_1K,
|
||||||
MIFARE_CLASSIC_4K,
|
MIFARE_CLASSIC_4K,
|
||||||
MIFARE_DESFIRE,
|
MIFARE_DESFIRE,
|
||||||
|
|
|
@ -193,6 +193,16 @@ int get_block_access_bits (FreefareTag tag, const MifareClassicBlockNumber blo
|
||||||
* Memory management functions.
|
* Memory management functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
bool
|
||||||
|
mifare_mini_taste (nfc_device *device, nfc_target target)
|
||||||
|
{
|
||||||
|
(void) device;
|
||||||
|
return target.nm.nmt == NMT_ISO14443A &&
|
||||||
|
(
|
||||||
|
target.nti.nai.btSak == 0x09
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
mifare_classic1k_taste (nfc_device *device, nfc_target target)
|
mifare_classic1k_taste (nfc_device *device, nfc_target target)
|
||||||
{
|
{
|
||||||
|
@ -237,6 +247,13 @@ _mifare_classic_tag_new (nfc_device *device, nfc_target target, int tag_type)
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FreefareTag
|
||||||
|
mifare_mini_tag_new (nfc_device *device, nfc_target target)
|
||||||
|
{
|
||||||
|
return _mifare_classic_tag_new (device, target, MIFARE_MINI);
|
||||||
|
}
|
||||||
|
|
||||||
FreefareTag
|
FreefareTag
|
||||||
mifare_classic1k_tag_new (nfc_device *device, nfc_target target)
|
mifare_classic1k_tag_new (nfc_device *device, nfc_target target)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue