nfc-emulate-ndef: remove minor compilation warnings, add a FIXME to remove pn53x specific code in this example.

New issue
Summary: Remove pn53x specific from nfc* examples
Labels: Priority-Low Milestone-1.4.x
Examples provided by libnfc should show the "right" way to use libnfc and to use pn53x specific (and non public) functions is not a good pratice.
There can be some exceptions only if its really dedicated to one kind of chip and the example name have to follow the format "chip-function" instead of usual "nfc-function". (e.g. pn53x-diagnose)
This commit is contained in:
Romuald Conty 2010-09-30 08:36:49 +00:00
parent 68879ba255
commit 3c5e815ddd

View file

@ -56,6 +56,7 @@ transmit_bytes (const byte_t * pbtTx, const size_t szTxLen)
}
// Transmit the command bytes
// FIXME doesn't use a pn53x specific function, use libnfc's API
pn53x_set_parameters(pnd,0);
if (!nfc_target_send_bytes(pnd, pbtTx, szTxLen)) {
nfc_perror (pnd, "nfc_target_send_bytes");
@ -96,15 +97,15 @@ main (int argc, char *argv[])
return EXIT_FAILURE;
}
transmit_bytes("\x0a\x00\x6a\x87",4);
transmit_bytes("\x0b\x00\x6a\x87",4);
transmit_bytes("\x0a\x00\x90\x00",4);
transmit_bytes("\x0b\x00\x90\x00",4);
transmit_bytes("\x0a\x00\x00\x0f\x10\x00\x3b\x00\x34\x04\x06\xe1\x04\x0e\xe0\x00\x00\x90\x00",19);
transmit_bytes("\x0b\x00\x90\x00",4);
transmit_bytes("\x0a\x00\x00\x21\x90\x00",6);
transmit_bytes("\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);
transmit_bytes("\xca\x00",2);
transmit_bytes((const byte_t*)"\x0a\x00\x6a\x87",4);
transmit_bytes((const byte_t*)"\x0b\x00\x6a\x87",4);
transmit_bytes((const byte_t*)"\x0a\x00\x90\x00",4);
transmit_bytes((const byte_t*)"\x0b\x00\x90\x00",4);
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);
transmit_bytes((const byte_t*)"\x0b\x00\x90\x00",4);
transmit_bytes((const byte_t*)"\x0a\x00\x00\x21\x90\x00",6);
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);
transmit_bytes((const byte_t*)"\xca\x00",2);
nfc_disconnect(pnd);
exit (EXIT_SUCCESS);