Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable baud rate #110

Open
kleest opened this issue May 7, 2019 · 0 comments
Open

Configurable baud rate #110

kleest opened this issue May 7, 2019 · 0 comments

Comments

@kleest
Copy link

kleest commented May 7, 2019

Since commit nfc-tools/libnfc@ddde2dd, any baud rate other than 106 leads to an explicit baud rate change request. In mifare_desfire.c, the baud rate is fixed to 424:

int
mifare_desfire_connect(FreefareTag tag)
{
ASSERT_INACTIVE(tag);
nfc_target pnti;
nfc_modulation modulation = {
.nmt = NMT_ISO14443A,
.nbr = NBR_424
};
if (nfc_initiator_select_passive_target(tag->device, modulation, tag->info.nti.nai.abtUid, tag->info.nti.nai.szUidLen, &pnti) >= 0) {

In the case of Android HCE, changing the baud rate is not necessarily supported, thus resulting in error code 01 (Timeout) which aborts the operation. Is it possible to infer the baud rate by the passed FreefareTag instead of setting it to the fixed value 424, or make it configurable somehow?

debug	libnfc.chip.pn53x	InPSL
debug	libnfc.chip.pn53x	No timeout
debug	libnfc.bus.uart	TX: 00 00 ff 05 fb d4 4e 01 02 02 d9 00 
debug	libnfc.bus.uart	RX: 00 00 ff 00 ff 00 
debug	libnfc.chip.pn53x	PN53x ACKed
debug	libnfc.bus.uart	RX: 00 00 ff 03 fd 
debug	libnfc.bus.uart	RX: d5 4f 
debug	libnfc.bus.uart	RX: 01 
debug	libnfc.bus.uart	RX: db 00 
debug	libnfc.chip.pn53x	Chip error: "Timeout" (01), returned error: "RF Transmission Error" (-20))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant