Gazell Dynamic Pairing
Overview
This sample demonstrates the functionality of the Gazell Pairing subsystem. It consists of two applications, one running on the device and one running on the host.
Device
The application sends packets continuously. If a packet transmission fails (either times out or encryption fails), the Device makes an attempt to pair with a Host by sending a pairing request, consisting of an “address request” and a “Host ID” request.
If the Device is paired with a Host, the pairing data is stored into the non-volatile memory.
Before adding a packet to the TX queue, the content of the buttons is copied to the first payload byte (byte 0).
The application alternates between sending the packets encrypted through the pairing library or directly as plaintext.
Host
The application listens for packets continuously, monitoring for pairing requests as well as normal user data.
The Gazell pairing library uses pipe 0 and pipe 1 for encrypted communication. The application grants any request for a Host ID, thus granting pairing. Unencrypted packets can be received on pipe 2.
When the Host has received data, the content of the first payload byte is output to LEDs.
Requirements
The sample supports the following development kits:
Hardware platforms |
PCA |
Board name |
Build target |
---|---|---|---|
PCA10056 |
|
||
PCA10100 |
|
||
PCA10040 |
|
You can use any two of the development kits listed above and mix different development kits.
User interface
Building and running
The Device sample is under samples/gazell/gzp_dynamic_pairing/device
in the nRF Connect SDK folder structure.
The Host sample is under samples/gazell/gzp_dynamic_pairing/host
in the nRF Connect SDK folder structure.
See Building and programming an application for information about how to build and program the application.
Testing
After programming the Device sample on one of the development kits and the Host sample on the other kit, test them by performing the following steps:
Power on both kits.
Observe that all the LEDs are off on both kits.
Place the kits next to each other for Gazell pairing.
Observe that the Host sample turns on all LEDs. It indicates that the pairing is done.
Press Button 2 for the Device sample. Observe that the Host sample turns off LED 2 on the other kit.
Dependencies
This sample uses the following nRF Connect SDK libraries:
It uses the following nrfxlib library:
It uses the following Zephyr libraries:
include/zephyr/types.h
-
include/kernel.h