Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Bluetooth - NFC Pairing

Technology badge License badge SDK badge Required board Build badge Flash badge RAM badge

Type badge Type badge Type badge Type badge Type badge Type badge

Description

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.


Table Of Contents


SDK version


Software Required


Hardware Required


Connections Required

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.

board


Setup

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

Create a project based on an example project

  1. 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".

  2. Click Create button on the Bluetooth - NFC Pairing example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.

    create_project

  3. Build and flash this example to the board.

Start with a "Bluetooth - SoC Empty" project

  1. Create a Bluetooth - SoC Empty project for your hardware using Simplicity Studio 5.

  2. Copy all attached files in inc and src folders into the project root folder (overwriting existing).

  3. 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]
  4. 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.


How It Works

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. notify

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. log


Report Bugs & Get Support

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.