Compare commits
4 Commits
mfoc-0.10.
...
mfoc-0.10.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
290a075956 | ||
|
|
2fa70fb3d3 | ||
|
|
e1a2b0225f | ||
|
|
222ba1838c |
@@ -1,4 +1,4 @@
|
||||
AC_INIT([mfoc],[0.10.6],[mifare@nethemba.com])
|
||||
AC_INIT([mfoc],[0.10.7],[mifare@nethemba.com])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
@@ -8,7 +8,7 @@ AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
AC_CONFIG_SRCDIR([src/mfoc.c])
|
||||
|
||||
AM_INIT_AUTOMAKE
|
||||
AM_INIT_AUTOMAKE(dist-bzip2 no-dist-gzip)
|
||||
|
||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||
|
||||
|
||||
11
src/mfoc.c
11
src/mfoc.c
@@ -204,10 +204,13 @@ int main(int argc, char *const argv[])
|
||||
for (i=0;!nfc_initiator_select_passive_target(r.pdi, nm, NULL, 0, &t.nt) && i < 10; i++) zsleep (100);
|
||||
*/
|
||||
|
||||
// mf_select_tag(r.pdi, &(t.nt));
|
||||
if (nfc_initiator_select_passive_target(r.pdi, nm, NULL, 0, &t.nt) < 0) {
|
||||
int tag_count;
|
||||
if ((tag_count = nfc_initiator_select_passive_target(r.pdi, nm, NULL, 0, &t.nt)) < 0) {
|
||||
nfc_perror(r.pdi, "nfc_initiator_select_passive_target");
|
||||
goto error;
|
||||
} else if (tag_count == 0) {
|
||||
ERR("No tag found.");
|
||||
goto error;
|
||||
}
|
||||
|
||||
// Test if a compatible MIFARE tag is used
|
||||
@@ -579,6 +582,10 @@ void mf_init(mfreader *r)
|
||||
{
|
||||
// Connect to the first NFC device
|
||||
nfc_init(&context);
|
||||
if (context == NULL) {
|
||||
ERR("Unable to init libnfc (malloc)");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
r->pdi = nfc_open(context, NULL);
|
||||
if (!r->pdi) {
|
||||
printf("No NFC device found.\n");
|
||||
|
||||
Reference in New Issue
Block a user