Fix minor warnings
This commit is contained in:
parent
814ccad1e3
commit
840ff89450
2 changed files with 15 additions and 15 deletions
|
@ -153,7 +153,6 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
printf ("Connected to NFC device: %s\n", pnd->acName);
|
printf ("Connected to NFC device: %s\n", pnd->acName);
|
||||||
|
|
||||||
/*
|
|
||||||
// Example of a Mifare Classic Mini
|
// Example of a Mifare Classic Mini
|
||||||
// Note that crypto1 is not implemented in this example
|
// Note that crypto1 is not implemented in this example
|
||||||
nfc_target_t nt = {
|
nfc_target_t nt = {
|
||||||
|
@ -164,7 +163,7 @@ main (int argc, char *argv[])
|
||||||
.nti.nai.szUidLen = 4,
|
.nti.nai.szUidLen = 4,
|
||||||
.nti.nai.szAtsLen = 0,
|
.nti.nai.szAtsLen = 0,
|
||||||
};
|
};
|
||||||
*/
|
/*
|
||||||
// Example of a ISO14443-4 (DESfire)
|
// Example of a ISO14443-4 (DESfire)
|
||||||
nfc_target_t nt = {
|
nfc_target_t nt = {
|
||||||
.ntt = NTT_MIFARE,
|
.ntt = NTT_MIFARE,
|
||||||
|
@ -175,6 +174,7 @@ main (int argc, char *argv[])
|
||||||
.nti.nai.abtAts = { 0x75, 0x77, 0x81, 0x02, 0x80 },
|
.nti.nai.abtAts = { 0x75, 0x77, 0x81, 0x02, 0x80 },
|
||||||
.nti.nai.szAtsLen = 5,
|
.nti.nai.szAtsLen = 5,
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
printf ("%s will emulate this ISO14443-A tag:\n", argv[0]);
|
printf ("%s will emulate this ISO14443-A tag:\n", argv[0]);
|
||||||
print_nfc_iso14443a_info( nt.nti.nai );
|
print_nfc_iso14443a_info( nt.nti.nai );
|
||||||
|
|
|
@ -21,19 +21,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif // HAVE_CONFIG_H
|
#endif // HAVE_CONFIG_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#if defined(HAVE_READLINE)
|
||||||
|
# include <stdio.h>
|
||||||
|
# include <readline/readline.h>
|
||||||
|
# include <readline/history.h>
|
||||||
|
#else
|
||||||
|
# define _GNU_SOURCE // for getline on system with glibc < 2.10
|
||||||
|
# define _POSIX_C_SOURCE 200809L // for getline on system with glibc >= 2.10
|
||||||
|
# include <stdio.h>
|
||||||
|
extern FILE* stdin;
|
||||||
|
#endif //HAVE_READLINE
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#if defined(HAVE_READLINE)
|
|
||||||
# include <readline/readline.h>
|
|
||||||
# include <readline/history.h>
|
|
||||||
#else
|
|
||||||
extern FILE* stdin;
|
|
||||||
#endif //HAVE_READLINE
|
|
||||||
|
|
||||||
#include <nfc/nfc.h>
|
#include <nfc/nfc.h>
|
||||||
#include <nfc/nfc-messages.h>
|
#include <nfc/nfc-messages.h>
|
||||||
|
|
||||||
|
@ -51,7 +54,6 @@ int main(int argc, const char* argv[])
|
||||||
size_t szRxLen;
|
size_t szRxLen;
|
||||||
size_t szTxLen;
|
size_t szTxLen;
|
||||||
|
|
||||||
nfc_device_desc_t device_desc;
|
|
||||||
// Try to open the NFC reader
|
// Try to open the NFC reader
|
||||||
pnd = nfc_connect(NULL);
|
pnd = nfc_connect(NULL);
|
||||||
|
|
||||||
|
@ -67,7 +69,6 @@ int main(int argc, const char* argv[])
|
||||||
char * cmd;
|
char * cmd;
|
||||||
char * prompt="> ";
|
char * prompt="> ";
|
||||||
while(1) {
|
while(1) {
|
||||||
bool result;
|
|
||||||
int offset=0;
|
int offset=0;
|
||||||
#if defined(HAVE_READLINE)
|
#if defined(HAVE_READLINE)
|
||||||
cmd=readline(prompt);
|
cmd=readline(prompt);
|
||||||
|
@ -83,14 +84,13 @@ int main(int argc, const char* argv[])
|
||||||
fflush(0);
|
fflush(0);
|
||||||
size_t n;
|
size_t n;
|
||||||
extern FILE* stdin;
|
extern FILE* stdin;
|
||||||
//FIXME: getline not in stdio.h ???
|
|
||||||
int s = getline(&cmd, &n, stdin);
|
int s = getline(&cmd, &n, stdin);
|
||||||
if (s <= 0) {
|
if (s <= 0) {
|
||||||
printf("Bye!\n");
|
printf("Bye!\n");
|
||||||
free(cmd);
|
free(cmd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//FIXME: print only if read from redirected stdin (i.e. script)
|
// FIXME print only if read from redirected stdin (i.e. script)
|
||||||
printf("%s", cmd);
|
printf("%s", cmd);
|
||||||
#endif //HAVE_READLINE
|
#endif //HAVE_READLINE
|
||||||
if (cmd[0]=='q') {
|
if (cmd[0]=='q') {
|
||||||
|
@ -105,7 +105,7 @@ int main(int argc, const char* argv[])
|
||||||
while (isspace(cmd[offset])) {
|
while (isspace(cmd[offset])) {
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
size = sscanf(cmd+offset, "%2x", &byte);
|
size = sscanf(cmd+offset, "%2x", (unsigned int*)&byte);
|
||||||
if (size<1) {
|
if (size<1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue