34 lines
635 B
C
34 lines
635 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "nfc.h"
|
|
#include "barcode.h"
|
|
#include "tts.h"
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
if (nfc_initialize())
|
|
{
|
|
printf("NFC initialization failed\n");
|
|
tts_speak("Nie można było zainicjalizowaćczytnika mifare.\n");
|
|
return 1;
|
|
}
|
|
|
|
tts_speak("Refryżyrator gotowy do pracy.");
|
|
|
|
char UID[128];
|
|
while (1)
|
|
{
|
|
int NFCResult = nfc_read(UID);
|
|
if (NFCResult == 0)
|
|
{
|
|
// Do barcode stuff here
|
|
}
|
|
else if (NFCResult != NFC_TIMEOUT)
|
|
{
|
|
// Do error handling here
|
|
}
|
|
}
|
|
}
|
|
|