Remove nfc-defines.h public header.

Use NULL instead of INVALID_DEVICE_INFO to know if device is valid.
Make distcheck OK
This commit is contained in:
Romuald Conty 2009-11-10 09:47:59 +00:00
parent 9fccd11fc7
commit aa8bb42d9f
27 changed files with 106 additions and 111 deletions

View file

@ -24,8 +24,6 @@
#ifndef _LIBNFC_MIFARE_TAG_H_
#define _LIBNFC_MIFARE_TAG_H_
#include "nfc-defines.h"
typedef struct {
byte_t abtUID[4];
byte_t btBCC;

View file

@ -24,8 +24,6 @@
#ifndef _LIBNFC_MIFARE_UL_TAG_H_
#define _LIBNFC_MIFARE_UL_TAG_H_
#include "nfc-defines.h"
typedef struct {
byte_t sn0[3];
byte_t btBCC0;

View file

@ -35,6 +35,8 @@
#define SAK_FLAG_ATS_SUPPORTED 0x20
#define MAX_FRAME_LEN 264
static byte_t abtRx[MAX_FRAME_LEN];
static size_t szRxBits;
static size_t szRxLen;

View file

@ -32,6 +32,8 @@
#include "nfc-messages.h"
#include "bitutils.h"
#define MAX_FRAME_LEN 264
static byte_t abtRecv[MAX_FRAME_LEN];
static size_t szRecvBits;
static nfc_device_t* pnd;
@ -87,7 +89,7 @@ int main(int argc, char *argv[])
// Try to open the NFC reader
pnd = nfc_connect(NULL);
if (pnd == INVALID_DEVICE_INFO)
if (pnd == NULL)
{
printf("Error connecting NFC reader\n");
return 1;

View file

@ -52,7 +52,7 @@ int main(int argc, const char* argv[])
pnd = nfc_connect(&ndd);
*/
if (pnd == INVALID_DEVICE_INFO)
if (pnd == NULL)
{
ERR("Unable to connect to NFC device.");
return 1;

View file

@ -405,7 +405,7 @@ int main(int argc, const char* argv[])
// Try to open the NFC reader
pnd = nfc_connect(NULL);
if (pnd == INVALID_DEVICE_INFO)
if (pnd == NULL)
{
printf("Error connecting NFC reader\n");
return 1;

View file

@ -149,7 +149,7 @@ int main(int argc, const char* argv[])
// Try to open the NFC reader
pnd = nfc_connect(NULL);
if (pnd == INVALID_DEVICE_INFO)
if (pnd == NULL)
{
printf("Error connecting NFC reader\n");
return 1;

View file

@ -31,6 +31,8 @@
#include "nfc-messages.h"
#include "bitutils.h"
#define MAX_FRAME_LEN 264
static byte_t abtReaderRx[MAX_FRAME_LEN];
static byte_t abtReaderRxPar[MAX_FRAME_LEN];
static size_t szReaderRxBits;
@ -70,7 +72,7 @@ int main(int argc,char* argv[])
// Try to open the NFC emulator device
pndTag = nfc_connect(NULL);
if (pndTag == INVALID_DEVICE_INFO)
if (pndTag == NULL)
{
printf("Error connecting NFC emulator device\n");
return 1;
@ -89,8 +91,8 @@ int main(int argc,char* argv[])
printf("[+] Thank you, the emulated tag is initialized\n");
// Try to open the NFC reader
pndReader = INVALID_DEVICE_INFO;
while (pndReader == INVALID_DEVICE_INFO) pndReader = nfc_connect(NULL);
pndReader = NULL;
while (pndReader == NULL) pndReader = nfc_connect(NULL);
printf("[+] Configuring NFC reader settings\n");
nfc_configure(pndReader,DCO_HANDLE_CRC,false);
nfc_configure(pndReader,DCO_HANDLE_PARITY,false);

View file

@ -25,6 +25,8 @@
#include <string.h>
#include <nfc.h>
#define MAX_FRAME_LEN 264
int main(int argc, const char *argv[])
{
nfc_device_t *pnd;

View file

@ -24,6 +24,8 @@
#include <stdio.h>
#include <nfc.h>
#define MAX_FRAME_LEN 264
int main(int argc, const char *argv[])
{
byte_t abtRecv[MAX_FRAME_LEN];