Closed Lesterpig closed 8 years ago
Thank you for reporting this issue. Currently investigating the problem and looking for a fix.
To your first point, the call to C.nfc_initiator_select_passive_target
looks like this:
n := C.nfc_initiator_select_passive_target(
*d.d,
C.nfc_modulation{C.nfc_modulation_type(m.Type), C.nfc_baud_rate(m.BaudRate)},
(*C.uint8_t)(&initData[0]),
C.size_t(len(initData)),
&pnt)
where initData
is the second parameter of (*Device).InitiatorSelectPassiveTarget
. It's used twice in the appropriate places. Could you elaborate with what you mean by “the second parameter of Device.InitiatorSelectPassiveTarget
is not used?” There is a possible nil pointer dereference (which I'm fixing right now).
The second error is already fixed locally on my machine.
Thank you for your answer!
It's used twice in the appropriate places
My mistake, I had a "hotfix" version on my computer to handle the null case... Sorry for that. There is still a tiny bug here you underlined with the null default value, or in case of empty slice.
Closing this. Please tell me if the issue persists and reopen if it does.
Now works like a charm, thank you very much :)
Device.InitiatorSelectPassiveTarget
is not usedReference: http://www.libnfc.org/api/group__initiator.html#gacbe0fa197206cac99c83ed0152174811
The dev version is not working, but I can purpose a PR for a fix in 2.0 if needed :)