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

Functions

int main ()
 Main function. More...
 

Configuration

static uint8_t data_payload [NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH]
 Placeholder for data payload received from host.
 
static uint8_t ack_payload [TX_PAYLOAD_LENGTH]
 Payload to attach to ACK sent to device.
 
nrf_gzll_error_code_t nrf_gzll_error_code
 Error code.
 
static bool init_ok
 
static bool enable_ok
 
static bool push_ok
 
static bool pop_ok
 
static bool packet_received
 
#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_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_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_disabled ()
 Disabled callback. More...
 

Detailed Description

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

This example listens for a packet and sends an ACK when a packet is received. The contents of the first payload byte of the received packet is output on the GPIO Port BUTTONS. The contents of GPIO Port LEDS are sent in the first payload byte (byte 0) of the ACK packet.

Function Documentation

int main ( void  )
Returns
ANSI required int return type.
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_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_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.