nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Gazell Link Layer Device with Payload in ACK

Functions

int main ()
 Main function. More...
 

Configuration

static uint8_t data_payload [TX_PAYLOAD_LENGTH]
 Payload to send to Host.
 
static uint8_t ack_payload [NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH]
 Placeholder for received ACK payloads from Host.
 
static volatile bool init_ok
 
static volatile bool enable_ok
 
static volatile bool push_ok
 
static volatile bool pop_ok
 
static volatile bool tx_success
 
#define PIPE_NUMBER   0
 We use pipe 0 in this example.
 
#define BUTTONS   NRF_GPIO_PORT_SELECT_PORT0
 GPIO port for reading from buttons.
 
#define LEDS   NRF_GPIO_PORT_SELECT_PORT1
 GPIO port for writing to LEDs.
 
#define TX_PAYLOAD_LENGTH   1
 We use 1 byte payload length when transmitting.
 

Gazell callback function definitions

void nrf_gzll_device_tx_success (uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)
 ACK received callback (Device mode only). More...
 
void nrf_gzll_device_tx_failed (uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)
 Transmission failed callback (Device mode only). More...
 
void nrf_gzll_host_rx_data_ready (uint32_t pipe, nrf_gzll_host_rx_info_t rx_info)
 Data packet received callback (Host mode only). More...
 
void nrf_gzll_disabled ()
 Disabled callback. More...
 

Detailed Description

This project requires that a Host running the Gazell Link Layer Host with Payload in ACK example be used as a counterpart for receiving the data. This can be on either nRF51 device or a nRF24Lxx device running the gzll_host_ack_payload example in the nRFgo SDK.

This example sends a packet and adds a new packet to the TX queue every time it receives an ACK. Before adding a packet to the TX queue, the contents of the GPIO Port BUTTONS is copied to the first payload byte (byte 0). When an ACK is received, the contents of the first payload byte of the ACK are output on GPIO Port LEDS.

Function Documentation

int main ( void  )
Returns
ANSI required int return type.
void nrf_gzll_device_tx_success ( uint32_t  pipe,
nrf_gzll_device_tx_info_t  tx_info 
)

This callback is made when the Device receives an ACK (acknowledgement) packet.

See Also
nrf_gzll_ack_payload_received.
Parameters
pipeis the pipe on which an ACK packet was received.
tx_infostruct used to indicate whether a payload was received in the ack, as well as the number of TX attempts and channel switches required.
void nrf_gzll_device_tx_failed ( uint32_t  pipe,
nrf_gzll_device_tx_info_t  tx_info 
)

This callback is made when a packet does not receive an ACK after nrf_gzll_max_retries is reached. The packet is deleted by Gazell.

Parameters
pipeis the pipe on which the transmission failed.
tx_infostruct used to indicate whether a payload was received in the ack, as well as RSSI and the number of TX attempts and channel switches required.
void nrf_gzll_host_rx_data_ready ( uint32_t  pipe,
nrf_gzll_host_rx_info_t  rx_info 
)

This callback is made when a Host receives a data packet from a Device.

Parameters
pipeis the pipe on which the data packet was received.
rx_infostruct used to indicate whether a payload was removed from the pipe's TX FIFO, as well as RSSI.
void nrf_gzll_disabled ( void  )

This is called after Gazell enters the disabled state. There is no further CPU use by Gazell, the radio is disabled and the timer is powered down.