Pairing Basic

Description

This application presents a basic method to pair two devices together in a point-to-point configuration using the SPARK Wireless Core.

When the application is started, the Coordinator and Node devices do not know each other’s addresses and cannot exchange data.

Upon starting the Pairing Procedure, the two devices exchange their addresses.

Once the Pairing Procedure is successful, the application resumes and the Coordinator and Node devices are able to exchange data packets.

See Pairing Module for more information on the Pairing Procedure.

Behavior

The following diagram illustrates the general structure of the schedule used in this application.

Pairing Basic Schedule

Figure 17: Pairing Basic Application Schedule.

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 is unsuccessful after 10 seconds, the Pairing process stops and all the LEDs blink twice.

  • Once the Pairing Procedure is successfully completed, a left-to-right LED pattern occurs and the devices can start exchanging 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.

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

N/A

N/A

LED1

N/A

N/A

LED2

Button state

Toggles upon receiving button state.

Configuration

This application does not require specific configurations.