- /* try to write some data */
- printf("write some data to the sector 04:\n");
- for(i=0;i<16;i++) buf[i]=i;
- i=4;
- ret=gemtag_auth_mifare_key(gh,key6,i);
- printf("return = %d\n",ret);
- if(ret) printf("auth failed!\n");
- ret=gemtag_write16(gh,i,buf);
- if(ret) printf("write failed!\n");
- printf("return = %d\n",ret);
- ret=gemtag_read16(gh,i,buf);
- if(ret) printf("read failed!\n");
- printf("return = %d\n",ret);
- printf("%02x: ",i);
- hexdump(buf,16);
- printf("\n");
-