Hi Nordic I am using GZLL to develop a prototype whereby data from sensors will be transferred to a Computer in a Wireless sensor network. The idea is, when data are requested, the transmission rate should be increased till the data is received and acknowldged at the base. After that, to save energy, transmission rate should be reduced untill further request is made. I have tryed to directly change tranmission rate using the GZLL_timeslot_period funciton while GZLL is enabled and also tryed disabling Gzll, increae the rate, send data, disable Gzll, reduce tramissino rate and enabling it again sequence. Here is the code snippit that demonstrates my attempt. As you can see, I am adjusting the code in the nrf_gzll_disabled() call back function. Any feedback??!!
int main()
{
nrf_gzll_set_timeslot_period(1000000);
enable_ok = nrf_gzll_enable();
while(true) {}
}
void nrf_gzll_device_tx_success(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)
{
increase_t_rate = true;
nrf_gzll_disable();
while(nrf_gzll_is_enabled()){}
nrf_gzll_enable();
uint8_t currReading;
uint32_t ack_payload_length = NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH;
if(tx_info.payload_received_in_ack)
{
pop_ok = nrf_gzll_fetch_packet_from_rx_fifo(pipe, ack_payload, &ack_payload_length);
if (i == 0)//acknowldege reception of TEDS transmission request
{
data_payload[0]= 0xAF; // signal the start
push_ok = nrf_gzll_add_packet_to_tx_fifo(pipe, data_payload, TX_PAYLOAD_LENGTH);
i++;
}
}
increase_t_rate = false;
nrf_gzll_disable();
while(nrf_gzll_is_enabled()){};
nrf_gzll_enable();
}
void nrf_gzll_disabled()
{
if (increase_t_rate == true)
{
nrf_gzll_set_timeslot_period(5000);
}
else if(increase_t_rate == false)
{
nrf_gzll_set_timeslot_period(1000000);
}
}