Pairing Basic¶
Description¶
This application presents a basic method to pair two devices together in a Point-to-Point (PTP) configuration.
When the application is started, the Coordinator and Node devices do not know the other device’s address and cannot communicate with each other.
Upon pressing on SW2 button on both devices, the Pairing Procedure starts and the two devices exchange their address.
The application then resumes once the Pairing Procedure is successful and the Coordinator and Node devices are now able to exchange data with each other.
See Pairing Module for more information on the Pairing Procedure.
Behavior¶
Application States¶
- Pairing:
A device is not paired by default at bootup.
The user needs to press SW2 button on both devices to start the pairing procedure; LED0 should blink twice when doing so.
If the Pairing Procedure fails after 10 seconds, the Pairing process stops all the LEDs blink twice.
Once the Pairing Procedure is completed, a left-to-right LED pattern occurs and the devices can start to exchange application data.
- Data exchange:
Once pairing is successful, pressing the SW1 button on either device sends a toggling state and the receiver adjusts its LED2 state accordingly.
LED0 toggles to indicate successful frame transmission.
LED1 toggles to indicate successful frame reception.
- Unpairing:
When paired, pressing the SW2 button again will unpair the device; All LEDs should blink twice to indicate the unpairing procedure is being done.
The unpairing step will make them forget the learned addresses. Devices will no longer be able to exchange application data.
To start a new Pairing Procedure, both devices must be unpaired first.
Application Interfaces¶
Interface |
Name |
Description |
|---|---|---|
SW1 |
Button activity |
Send a button state to another paired device. |
SW2 |
Pairing activity |
Start the Pairing Procedure when unpaired or unpair the device when paired. |
LED0 |
Wireless activity |
Toggles when receiving sent frame ACK. |
LED1 |
Wireless activity |
Toggles upon frame reception. |
LED2 |
Button state |
Toggles upon receiving button state. |