OOB (Out-Of-Band) pairing means that the two devices to be paired exchange the pairing information on a medium other than Bluetooth, which is out-of-band.
Near Field Communication (NFC) can be used to share the data needed for OOB pairing, and thus provides a convenient and secure means of establishing Bluetooth connections. Indeed, the short communication range of NFC contributes to both security and selectivity. Remote attacks are not possible when the unauthorized party needs to be physically present within a few centimeters of the equipment, tapping allows the user to be sure that only the device to be connected has received the key.
This example aims to implement a Secure Bluetooth Pairing Using NFC with an NT3H2111.
- SDK version
- Software Required
- Hardware Required
- Connections Required
- Setup
- How It Works
- Report Bugs & Get Support
- 1x Bluetooth Low Energy Explorer Kit. For simplicity, Silicon Labs recommends the BGM220-EK4314A
- 1x NFC Tag 2 Click
- 1x NFC-supported smartphone
Attach the NFC Tag 2 Click board to the Explorer kit. Make sure that the 45-degree corner of the NFC board matches the 45-degree white line of the Silicon Labs Explorer kit.
To test this application, you can either create a project based on an example project or start with a "Bluetooth - SoC Empty" project based on your hardware.
Note
-
Make sure that the Third Party Hardware Drivers extension is installed as part of the SiSDK and the bluetooth_applications repository is added to Preferences > Simplicity Studio > External Repos.
-
SDK Extension must be enabled for the project to install the required components.
-
From the Launcher Home, add your hardware to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering by "nfc".
-
Click Create button on the Bluetooth - NFC Pairing example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-
Build and flash this example to the board.
-
Create a Bluetooth - SoC Empty project for your hardware using Simplicity Studio 5.
-
Copy all attached files in inc and src folders into the project root folder (overwriting existing).
-
Open the .slcp file. Select the SOFTWARE COMPONENTS tab and install the software components:
- [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom
- [Application] → [Utility] → [Log]
- [Third Party Hardware Drivers] → [Wireless Connectivity] → [NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C] → use default configuration
- [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - Common]
- [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - NDEF]
- [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - Tag]
-
Build and flash the project to your device.
Note
A bootloader needs to be flashed to your board if the project starts from the "Bluetooth - SoC Empty" project, see Bootloader for more information.
After flashing the project to your device, use an NFC reader capable Bluetooth LE device to read the tag content to establish the OOB pairing. Android phones often support system-level NFC pairing (no app required). Try to move the phone closer to the NFC Tag 2 click. After detecting and matching a tag, the phone shows a notification as picture below.
![]()
Tap YES to pair with the device, then you will get a "Device connected" or "Pairing complete" notification. You can open the Bluetooth Setting app on your phone and check Connected devices.
Use a serial terminal to monitor the Bluetooth events to make sure connection/bonding works as expected. You should expect a similar output to the one below.
![]()
To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of bluetooth_applications repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.
Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of bluetooth_applications repo.