Advertisement
vinifr

cherry 1

Feb 25th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1. int write_fprint (char *file)
  2. {
  3.     char status;
  4.     char *buffer;
  5.     long lengthfp;
  6.     uchar buffer_fplength[16];
  7.  
  8.     lengthfp = getbuffl(file, &buffer);
  9.     buffer_fplength[0] = (lengthfp>>8) & 0x00FF;
  10.     buffer_fplength[1] = (lengthfp) & 0x00FF;
  11.     //numblocks = ceil((float)lengthfp/16);
  12.  
  13.     status = MFRC522_Auth(AUTHENTICATION_TYPE, BLOCK_CFG, pkey, serNum);
  14.     //buffer_fplength[0] = numblocks;
  15.     status=MFRC522_Write(BLOCK_CFG, buffer_fplength);
  16.     if (status == MI_OK)
  17.     {
  18.     status = writefield(lengthfp, BLOCK_FPRINT, (uchar*)buffer);
  19.     }
  20.     free (buffer);
  21.     if (status != MI_OK)
  22.     {
  23.     //status = MI_ERR;
  24.     //exchange_keys();
  25.     DPRINTF("Error - write fprint: %d\n", status);
  26.     return status;
  27.     }
  28.     printf("Minutiae written with success\n");
  29.     return status;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement