static initialization of nfc

master
Tomek Dubrownik 2012-05-22 20:47:25 +02:00
parent e320d8d22e
commit 8b479f51ad
1 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,7 @@
#include "tts.h"
#include "ldap.h"
#include "base64.h"
#include "config.h"
#define E_BAD_CARD 1
#define E_NO_SUCH_USER 2
@ -49,6 +50,7 @@ int nfc_read(char *MifareOut)
int nfc_initialize(void)
{
/*
nfc_device_desc_t *Devices;
size_t NumDevices;
@ -68,7 +70,13 @@ int nfc_initialize(void)
}
g_NFCDevice = nfc_connect(&Devices[0]);
*/
char pcPort[] = NFC_PORT;
nfc_device_desc_t dev = {
.pcDriver = "PN532_UART",
};
strcpy(dev.acPort, pcPort);
g_NFCDevice = nfc_connect(&dev);
if (g_NFCDevice == NULL)
{
fprintf(stderr, "Error: Could not connect to NFC device.\n");