Page 54 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 54

}
               printf("\n");
                delay(1000);
            }


            void  nfcStart(int  argc,  const  char  *argv[])
            {

                nfc_device  *pnd;
                nfc_target  nt;

                nfc_context *context;

                nfc_init(&context);
                if  (context  ==  NULL)
                {
                   printf("Unable to  init libnfc  (malloc)\n");
                   exit(EXIT_FAILURE);
                }

                const char  *acLibnfcVersion =  nfc_version();
                (void)argc;
                printf("%s  uses libnfc  %s\n",  argv[0], acLibnfcVersion);

                pnd =  nfc_open(context, NULL);

                if  (pnd ==  NULL)  {
                   printf("ERROR: %s\n",  "Unable  to open  NFC  device.");
                   exit(EXIT_FAILURE);
                }
                if  (nfc_initiator_init(pnd) < 0)  {
                      nfc_perror(pnd,  "nfc_initiator_init");
                   exit(EXIT_FAILURE);
                }

                printf("NFC reader:  %s  opened\n",  nfc_device_get_name(pnd));

                  //  Poll  for  a  ISO14443A  (MIFARE)  tag
                const nfc_modulation  nmMifare = {
                      .nmt  =  NMT_ISO14443A,




                                                         -  47  -
   49   50   51   52   53   54   55   56   57   58   59