I have the following code, it's pretty bare in terms of its functionality:
#include <stdint.h>
extern "C"
{
#include "nrf_delay.h"
}
#include "gazell.h"
#include "tools.h"
#include "uart.h"
#include "core.h"
extern uint8_t nodeMode;
uint8_t rxPayload[GAZELL_PACKET_SIZE],
txPayload[GAZELL_PACKET_SIZE] = { 0, 0, 1, 2, 3, 4, 5, 6, 7, 8 };
extern "C"
{
void nrf_gzll_host_rx_data_ready(uint32_t pipe, nrf_gzll_host_rx_info_t rxInfo) { debugOut("dataReady\r\n"); }
void nrf_gzll_device_tx_success(uint32_t pipe, nrf_gzll_device_tx_info_t txInfo) { debugOut("txSuccess\r\n"); }
void nrf_gzll_device_tx_failed(uint32_t pipe, nrf_gzll_device_tx_info_t txInfo) { debugOut("txFailed\r\n"); }
void nrf_gzll_disabled() { debugOut("disabled\r\n"); }
}
nrf_gzll_error_code_t gazellInit()
{
nrf_gzll_error_code_t errorCode;
debugOut("Gazell init %s\r\n", nodeMode == MODE_MASTER ? "host" : "device");
gazellErrorHandle(nrf_gzll_init(nodeMode == MODE_MASTER ? NRF_GZLL_MODE_HOST : NRF_GZLL_MODE_DEVICE));
gazellErrorHandle(nrf_gzll_enable());
while(nodeMode == MODE_SLAVE)
{
nrf_gzll_add_packet_to_tx_fifo(1, txPayload, GAZELL_PACKET_SIZE);
++txPayload[0];
nrf_delay_ms(1000);
}
return NRF_GZLL_ERROR_CODE_NO_ERROR;
}
For some reason though, it appears the callbacks aren't being called. I am however sure that the transmission takes place, since when I start the device with having the host off I quickly get an overflow in the tx fifo. What am I missing/doing wrong?
Thank you in advance