-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Change default tag from NTAG_213 to NTAG_UNKNOWN so unknown tags can be detected. ntag_get_info() MUST be called after connect; - Fix reuse function which used to reset all tag info; - Introduce ntag21x error reporting through freefare_error(3);
- Loading branch information
1 parent
75f08d3
commit c18f702
Showing
10 changed files
with
119 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include <sys/types.h> | ||
|
||
#include <stdlib.h> | ||
|
||
#include <freefare.h> | ||
|
||
#include "freefare_internal.h" | ||
|
||
#define EM(e) { e, #e } | ||
|
||
static struct ntag21x_error_message { | ||
uint8_t code; | ||
const char *message; | ||
} ntag21x_error_messages[] = { | ||
EM(OPERATION_OK), | ||
EM(TAG_INFO_MISSING_ERROR), | ||
EM(UNKNOWN_TAG_TYPE_ERROR), | ||
{ 0, NULL } | ||
}; | ||
|
||
const char * | ||
ntag21x_error_lookup(uint8_t code) | ||
{ | ||
struct ntag21x_error_message *e = ntag21x_error_messages; | ||
while (e->message) { | ||
if (e->code == code) | ||
return (e->message); | ||
e++; | ||
} | ||
|
||
return "Invalid error code"; | ||
} | ||
|
||
uint8_t | ||
ntag21x_last_error(FreefareTag tag) | ||
{ | ||
if (tag->type != NTAG_21x) | ||
return 0; | ||
|
||
return NTAG_21x(tag)->last_error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef _FIXTURE_H | ||
#define _FIXTURE_H | ||
#define _FIXTURE_H | ||
|
||
extern FreefareTag tag; | ||
extern FreefareTag tag; | ||
|
||
#endif /* _FIXTURE_H */ |