Datalink
Description
The datalink application presents a standard and basic usage of the SPARK Wireless Core. This is a good starting point for anyone wanting to configure wireless communication using the Wireless Core. This application creates a synchronized unidirectional link between 2 devices to send data after a successful pairing.
Behavior
In this example, wireless communication is halted until both devices are paired. Once successfully paired, the Coordinator transmits random data, which incorporates a sequence number and a Cyclic redundancy check (CRC). The Node will verify that the sequence number and CRC are valid.
Application Schedule
The following diagram illustrates the general structure of the schedule used in this application.
Figure 19: Datalink Application’s Schedule.
Pairing
On boot, devices attempt to pair automatically. If unsuccessful, manual pairing can be performed afterward to use the application.
- Auto Pairing:
On boot, devices automatically start the pairing process. RGB blinks blue twice to indicate that pairing is in progress.
If the pairing procedure is unsuccessful, RGB blinks red twice after 10 seconds.
Once successfully paired, RGB turns magenta, and the devices begin exchanging application data.
- Manual Pairing:
Press the SW1 button on both devices to start the pairing procedure; RGB blinks blue twice when doing so.
If the pairing procedure is unsuccessful, RGB blinks red twice after 10 seconds.
Once successfully paired, RGB turns magenta, and the devices begin exchanging application data.
- Unpairing:
When paired, pressing the SW1 button again unpairs the device; RGB blinks red twice to indicate that unpairing has been completed.
Unpairing causes the devices to forget their learned addresses. The devices are no longer able to exchange application data.
To start a new pairing procedure, both devices must be unpaired first.
Note
LED behavior changes in pairing mode versus normal execution mode. During pairing mode, LEDs indicate pairing status as described below. Once paired, LEDs indicate packet transmission and reception and fallback mode status.
- Auto Pairing:
On boot, devices automatically start the pairing process. LED0 blinks twice to indicate the pairing is in progress.
If the pairing procedure is unsuccessful, all LEDs blink twice after 10 seconds.
Once successfully paired, LEDs turn on sequentially, then turn off, and the devices begin exchanging application data.
- Manual Pairing:
Press and hold the SW1 button on both devices for 3 seconds to start the pairing procedure; LED0 blinks twice when doing so.
If the pairing procedure is unsuccessful, all LEDs blink twice after 10 seconds.
Once successfully paired, LEDs turn on sequenstially, then turn off, and the devices begin exchanging application data.
- Unpairing:
When paired, press and hold the SW1 button for 3 seconds to unpair the device; All LEDs blink twice to indicate that unpairing has been completed.
Unpairing causes the devices to forget their learned addresses. The devices are no longer able to exchange application data.
To start a new pairing procedure, both devices must be unpaired first.
Coordinator User Interface
LED1 toggles every time a packet is successfully transmitted to the Node (almost always on because of the high packet rate).
Interface |
Name |
Description |
|---|---|---|
SW1 |
Pairing Process |
Pair, unpair, or abort the pairing process depending on the current state. |
SW2 |
Reset Stats |
Reset the TX and RX statistics. |
SW3 |
N/A |
N/A |
SW4 |
N/A |
N/A |
LED1 |
Transmission Success |
Toggle LED when a wireless transmission is successful. |
LED2 |
N/A |
N/A |
LED3 |
N/A |
N/A |
LED4 |
N/A |
N/A |
RGB |
Pairing Event |
Indicate pairing event as described in the pairing section. |
Interface |
Name |
Description |
|---|---|---|
SW1 |
Pairing Process |
Press and hold for 3 seconds: Pair, unpair, or abort the pairing process depending on the current state. |
Reset Stats |
Press for less than 250 ms: Reset the TX and RX statistics. |
|
SW2 |
||
LED0 |
Transmission Success |
Toggle LED when a wireless transmission is successful. |
LED1 |
N/A |
N/A |
LED2 |
N/A |
N/A |
Node User Interface
LED2 toggles every time a packet is successfully received from the Coordinator (almost always on because of the high packet rate).
Interface |
Name |
Description |
|---|---|---|
SW1 |
Pairing Process |
Pair, unpair, or abort the pairing process depending on the current state. |
SW2 |
Reset Stats |
Reset the TX and RX statistics. |
SW3 |
N/A |
N/A |
SW4 |
N/A |
N/A |
LED1 |
N/A |
N/A |
LED2 |
Reception Success |
Toggle LED when a wireless reception is successful and the data is valid. |
LED3 |
N/A |
N/A |
LED4 |
N/A |
N/A |
RGB |
Pairing Event |
Indicate pairing event as described in the pairing section. |
Interface |
Name |
Description |
|---|---|---|
SW1 |
Pairing Process |
Press and hold for 3 seconds: Pair, unpair, or abort the pairing process depending on the current state. |
Reset Stats |
Press for less than 250 ms: Reset the TX and RX statistics. |
|
SW2 |
||
LED0 |
N/A |
N/A |
LED1 |
Reception Success |
Toggle LED when a wireless reception is successful and the data is valid. |
LED2 |
N/A |
N/A |
Certification
This application has the ability to run in Certification Mode.
When certification mode is active, a dedicated LED is activated to indicate that the mode is enabled. All activity status LEDs (transmission, reception, fallback, and payload) are suppressed so that only the certification indicator is visible.
Board |
Indicator |
|---|---|
Quasar |
RGB LED steady yellow. |
EVK1.4 |
Steady LED2. |
Only one level of certification is needed for this application since the datarate is constant. The activation process must be performed independently on both the Coordinator and the Node.
Table 26: Certification Mode Activation Certification Mode
Activation Process
Datalink Certification
Hold SW2 at startup until the LED 1 blinks once, then release.
Terminal
The following figure shows the terminal output of this application.
See Viewing the Terminal for details on how to view the terminal output.
Figure 20: Datalink Serial Interface Output (from left: Coordinator & Node).
See Wireless Core API - Statistics for more details.