nfc-emulate-ndef: document exchange & remove compil warning

This commit is contained in:
Philippe Teuwen 2010-10-04 21:01:11 +00:00
parent 98d0f2522f
commit 6eca8843f6

View file

@ -36,6 +36,8 @@
#include <nfc/nfc-messages.h>
#include "nfc-utils.h"
// FIXME doesn't use a pn53x specific function, use libnfc's API
#include "chips/pn53x.h"
#define MAX_FRAME_LEN 264
@ -112,18 +114,36 @@ main (int argc, char *argv[])
print_hex (abtRx, szRxLen);
}
//Receiving data: e0 40
//= RATS, FSD=48
//Actually PN532 already sent back the ATS so nothing to send now
transmit_bytes((const byte_t*)"\x0a\x00\x6a\x87",4);
//Receiving data: 0b 00 00 a4 04 00 06 e1 03 e1 03 e1 03
//= App Select by name "e103e103e103"
transmit_bytes((const byte_t*)"\x0b\x00\x6a\x87",4);
//Receiving data: 0a 00 00 a4 04 00 07 d2 76 00 00 85 01 00
//= App Select by name "D2760000850100"
transmit_bytes((const byte_t*)"\x0a\x00\x90\x00",4);
//Receiving data: 0b 00 00 a4 00 00 02 e1 03
//= Select CC
transmit_bytes((const byte_t*)"\x0b\x00\x90\x00",4);
//Receiving data: 0a 00 00 b0 00 00 0f
//= ReadBinary CC
//We send CC + OK
transmit_bytes((const byte_t*)"\x0a\x00\x00\x0f\x10\x00\x3b\x00\x34\x04\x06\xe1\x04\x0e\xe0\x00\x00\x90\x00",19);
//Receiving data: 0b 00 00 a4 00 00 02 e1 04
//= Select NDEF
transmit_bytes((const byte_t*)"\x0b\x00\x90\x00",4);
//Receiving data: 0a 00 00 b0 00 00 02
//= Read first 2 NDEF bytes
//Sent NDEF Length=0x21
transmit_bytes((const byte_t*)"\x0a\x00\x00\x21\x90\x00",6);
//Receiving data: 0b 00 00 b0 00 02 21
transmit_bytes((const byte_t*)"\x0b\x00\xd1\x02\x1c\x53\x70\x91\x01\x09\x54\x02\x65\x6e\x4c\x69\x62\x6e\x66\x63\x51\x01\x0b\x55\x03\x6c\x69\x62\x6e\x66\x63\x2e\x6f\x72\x67\x90\x00",37);
// At this point we should have received a S(DESELECT)
// We don't have to reply ourselves because when using
// ISO/IEC14443-4 PICC mode, S(DESELECT) response is automatic
//transmit_bytes((const byte_t*)"\xca\x00",2);
//Receiving data: ca 00
//= S(DESELECT)
// We don't have to reply ourselves because when using
// ISO/IEC14443-4 PICC mode, S(DESELECT) response is automatic
nfc_disconnect(pnd);
exit (EXIT_SUCCESS);