Gazell ACK Payload
Overview
This sample shows basic Gazell communication and demonstrates how to send payloads and acknowledgments. It consists of two applications, one running on the device and one running on the host.
Device
A Device sends a packet and adds a new packet to the TX queue every time it receives an ACK from Host. Before adding a packet to the TX queue, the contents of the buttons is copied to the first payload byte (byte 0). When the Device receives an ACK, the contents of the first payload byte of the ACK are output to LEDs.
Host
A Host listens for a packet and sends an ACK when it has received the packet. The contents of the first payload byte of the received packet is output to LEDs. The contents of buttons are sent in the first payload byte (byte 0) of the ACK packet.
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
- LED 1-4:
Indicate that packets are received. A LED is turned off when the corresponding button is pressed on the other kit.
- Button 1-4:
The button pressed state bitmask is sent to the other kit. A button pressed is sent as 0 and a button released is sent as 1.
Building and running
The Device sample is under samples/gazell/gzll_ack_payload/device
in the nRF Connect SDK folder structure.
The Host sample is under samples/gazell/gzll_ack_payload/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 light up on both kits.
Press Button 1 for the Device sample. Observe that the Host sample turns off LED 1 on the other kit.
Press Button 2 for the Host sample. Observe that the Device sample turns off LED 2 on the other kit.
Optionally, connect to the kits with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.
Observe the logging output for both kits.
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
include/irq.h