Using NCS V2.0.0
NRF52840 DK
Testing Using NRF Connect Mobile on Android
Programed the Peripheral_nfc_pairing Example
when set as a type 2 tag it works and bonds multiple times without issue.
when set as type 4 tag it works intermittently. below is the sequence and testing done with Type 4 example
NFC did its try-and-fail on Tag 4 nfc-pairing sample.
Rebooted phone and reflashed the FW and the Tag 4 bonded.
Connected and then deleted bond-info while connected, and phone disconnected.
NFC worked a second time and bonded.
Did a normal disconnect.
Tried connect (still bonded) but failed connection. Repeated attempts failed.
Deleted bond info (no connection). NFC attempt bonded and connected.
Repeated connection attempts failed. Tried scanning but the unit was apparently not advertising.
Touched NFC but refused pairing attempt, and unit was now advertising.
Now connected fine UN-bonded. Could read characteristics and stayed connected.
Disconnected and reconnected without bonding…worked fine. Disconnected again.
Retried NFC…bonded and connected. Disconnected
Tried bonded connect…failed. Unit likely not advertising.
Used NFC and bonded again. Worked fine.
This is using Android 13, but older versions are not as reliable and typically need to reboot phone to get pairing/bonding
When pairing, it will report:
Security changed: E4:FA:ED:AA:95:1D (public) level 4
Pairing completed: E4:FA:ED:AA:95:1D (public), bonded: 1
when failing it will report
Security Failed: E4:FA:ED:AA:95:1D level 1 err9
Pairing Failed Conn: reason 9
It apparently does directed advertising to a MAC address which (it appears) has been seen by the NFC-touch.
Once that occurs, resetting the device or power-cycling does not change that directed address.
So when a second MAC address attempts to pair, it fails. Re-flashing the firmware fixes that and the second phone will pair.
It also does not start advertising until an NFC touch occurs, so even a previously bonded unit cannot connect without NFC
As for Type 4 vs Type 2 tags, I assumed type 4 would be more secure.
However memory requirements for Type 2: 48 to 144 bytes, Type 4: 4 Kb to 32 Kb.
Do have any recommendations?
We just use tags for security level 4 OOB LE SC pairing.