This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

beacon advertise interval

hello Nordic

i am working with nrf52832, sdk 6.0, softdevice s132 v7.0

i read around the forum that i can advertise a beacon packet every 20 ms 

but in the ble_app_beacon example the interval for the advertisement is written to be minimum 100ms ?? so where did that 20 ms go ?

however, since i don't know how to change the data of the message while advertising i put a timer handler that stops the advertise, update the data and start it again.

i put the timer to go every 50 ms and the advertisement interval every 50 ms i put a pin toggle every time i receive a ble from the address i am filtering..

1. the time is not fixed, maybe some messages are lost or maybe not sent, i don't know 

2. the intervals are larger then 50 ms .. more to the 100 ms  when they are sometimes fixed 

can you advice on this matter ?

i need to be sending changeable data in a beacon at list 30 times in one second

best regards

Ziv

  • Hello Ziv,

    This is not the library that was referenced in the ticket I linked.
    The correct reference is this one.

    The Radio Notification feature is written about in the SoftDevice documentation.

    Best regards,
    Karl

  • hi Karl

    it falls on the priority .. i don't really know from where to take the priority .. it falls here:

    __STATIC_INLINE uint32_t __sd_nvic_is_app_accessible_priority(uint32_t priority)
    {
      if( (priority >= (1 << __NVIC_PRIO_BITS))
       || (((1 << priority) & __NRF_NVIC_APP_IRQ_PRIOS) == 0)
        )
      {
        return 0;
      }
      return 1;
    }

    also, not sure what is the distance (second parameter for the function) units, 

    "The time from an Active event until the radio is activated." time in sec / ms / micro sec / nano sec ?

    also, does it means the time from an advertise start till the handler is called? 

    if it set to 0, can it cause some problems since i change the data transferred in the advertised packet ?

    best regards

    Ziv 

  • Hello again Ziv,

    ziv123 said:
    it falls on the priority .. i don't really know from where to take the priority .. it falls here:

    What error is generated? Which arguments did you pass the failing function?
    I will need more information to help you.

    ziv123 said:
    also, not sure what is the distance (second parameter for the function) units,
    ziv123 said:
    if it set to 0, can it cause some problems since i change the data transferred in the advertised packet ?

    Please use the defined enumerations. You may not configure the Radio Notification to be generated 0 us before the next Radio Event, as that would be at the start of the Radio Event itself.

    ziv123 said:
    also, does it means the time from an advertise start till the handler is called? 

    That depends, you can be notified either / both before the next Radio Event, or after. Please see the Radio Notification feature documentation, an exempt reads:

    If it is enabled, the ACTIVE signal is sent before the Radio Event starts. Similarly, if the nACTIVE signal is enabled, it is sent at the end of the Radio Event. These signals can be used by the application developer to synchronize the application logic with the radio activity. For example, the ACTIVE signal can be used to switch off external devices to manage peak current drawn during periods when the radio is ON, or to trigger sensor data collection for transmission during the upcoming Radio Event.

    Best regards,
    Karl

  • Which arguments did you pass the failing function?

    i passed ' NRF_RADIO_PRIORITY_NORMAL ' 

    err_code = ble_radio_notification_init(NRF_RADIO_PRIORITY_NORMAL, NRF_RADIO_NOTIFICATION_DISTANCE_5500US 	
    , data_update_timer_handler);
    and it fails

  • hi Karl

    i managed.. i copied the APP_IRQ_PRIORITY_LOW from the example and now it works.

    not sure if it works better or how much is a safe distance for a 31 bytes beacon (for now i set it to NRF_RADIO_NOTIFICATION_DISTANCE_3620US ) 

    i still only encode the new advdata and nothing else within the handler .. seems ok, hope no surprises later.

    so a lot of thanks on this long long thread for now, my fault, though i guess i am always worried that new threads takes longer time to get replied 

    we can close this thread i think.. for more questions on this matter or other i will open a new one 

    best regards

    Ziv

Related