From 03963ef535d5cac1bf9f0af24d382ba7dd28e70c Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 7 Jan 2011 13:22:39 +0000 Subject: [PATCH] nfc-emulate-tag: handle HALT & READ --- examples/nfc-emulate-tag.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/nfc-emulate-tag.c b/examples/nfc-emulate-tag.c index 6627ee5..30b2304 100644 --- a/examples/nfc-emulate-tag.c +++ b/examples/nfc-emulate-tag.c @@ -84,6 +84,18 @@ target_io( nfc_target_t * pnt, const byte_t * pbtInput, const size_t szInput, by } if(szInput) { switch(pbtInput[0]) { + case 0x30: // Mifare read + // block address is in pbtInput[1] + *pszOutput = 15; + strcpy(pbtOutput, "You read block "); + pbtOutput[15] = pbtInput[1]; + break; + case 0x50: // Deselect / HALT + if (!quiet_output) { + printf("Target halted me. Bye!\n"); + } + loop = false; + break; case 0x60: // Mifare authA case 0x61: // Mifare authB // Let's give back a very random nonce...