This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Timeslot extension

Hello all,

After several tests about extending Timeslot, I have some questions.

  1. I found out that the Timeslot will keep extending automatically after a successful extension, right?

  2. If I am right about the first question, then about the extension length, in my code, extend.length_us = 200, and the "callback_action" will be set to "NRF_RADIO_SIGNAL_CALLBACK_ACTION_END" if the total length above 120,000,000 us, so that the Timeslot will end rather than exceed the 128s limit and extend failed.
    I used the "NRF_LOG_INFO" printed the result:
    :INFO:NRF_EVT_RADIO_SESSION_IDLE
    :INFO:NRF_EVT_RADIO_SESSION_CLOSED
    :INFO: extend_success_count = 600000
    :INFO: extend_fail_count = 0

     case NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED: 
    
         if(total_timeslot_length >= 120000000)
         {
             signal_callback_return_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_END;
         }else
         {
         total_timeslot_length += 200;
         extend_success_count++;
         }
    
         break;
    
     case NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED: 
    
         fail_count++;
    
         break;
    

Also in Timeslot event handler:

    case NRF_EVT_RADIO_SESSION_IDLE:
        
        sd_radio_session_close();
        NRF_LOG_INFO("NRF_EVT_RADIO_SESSION_IDLE\r\n");

        break;

    case NRF_EVT_RADIO_SESSION_CLOSED: 
        
        NRF_LOG_INFO("NRF_EVT_RADIO_SESSION_CLOSED\r\n");
        NRF_LOG_INFO(" extend_success_count            = %d\r\n", extend_success_count);
        NRF_LOG_INFO(" extend_fail_count               = %d\r\n", fail_count);

        break;

But the problem is: the real time about the extension was far less that 120 seconds, only few seconds and as I increase the "extend_length", the real time get even shorter, so where is the problem?

Many thanks!

Parents
  • The NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED signal or the NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED signal will come right after you give the action NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND.

    The way your code works now is that you extend the timeslot until you have successfully extended to 120 seconds. This will happen in the first milliseconds of the timeslot as you call the extend signal back to back. When you have extended the timeslot to 120 seconds you immediately ends it, long before the 120 seconds have elapsed.

    What you should do is to configure the TIMER0 interrupt to fire right before the timeslot is going to expire. I have put together some code that demonstrates this, it is based on the timeslot tutorial:

    timeslot.c

    The timeslot will end after 120 seconds minus the margin with 600 000 successful extends.

Reply
  • The NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED signal or the NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED signal will come right after you give the action NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND.

    The way your code works now is that you extend the timeslot until you have successfully extended to 120 seconds. This will happen in the first milliseconds of the timeslot as you call the extend signal back to back. When you have extended the timeslot to 120 seconds you immediately ends it, long before the 120 seconds have elapsed.

    What you should do is to configure the TIMER0 interrupt to fire right before the timeslot is going to expire. I have put together some code that demonstrates this, it is based on the timeslot tutorial:

    timeslot.c

    The timeslot will end after 120 seconds minus the margin with 600 000 successful extends.

Children
Related