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

Timeslot with 3 advertisements

Hi, 

I tried to make a special  application that includes 3 advertisements, (one with softdevice, and two others with timeslot), then i successed to

integrate all the three advertisements in the application, everything is fine untill now, but the advertisements with the timeslot have no correct parameters, in fact ,

the advertisements intervals are wrong , i code the first to 1000ms and the second to 400ms but when i start the two adv at the same time, it seems 

like there is a sum of the two advertisements (1400ms for each one), i verified that with nrf connect.

Note: i have already posted this topic, but no one helped me, so i try again with this new topic.

* my starting point was "multiactivity beacon" example in the  SDK11

I will attach my timeslot code  to help you to undersand my problem. 

(SDK14.2 , Softdevice S140 V5.0.2-alpha)

thanks,

regards 

/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-7e61e58d2936419dad0f589b1c3efee5/advertiser_5F00_beacon_5F00_timeslot.c

Parents
  • i have probably unterstood the problem with the adv_intervals:

    here is a figure of what i have inderstand : 

    then the interval beetween the same advertisement still the same (1500 ms) and it's the sum of the two timeslot_distance_us.

    then the problem is i can't manipulate two timeslot_distance_us (two timeslots). at the same time.

    have you any idea how to manipulate two timeslot at the same time ?

    thanks,

  • Hi,

    What you see is expected behaviour. The timeslot API can only have one "user" at the time.

    In this excerpt from your code you set the variable distance_us:

    nrf_radio_request_t * m_configure_next_event_ibeacon(void)
    {
        m_ibeacon.timeslot_request.request_type              = NRF_RADIO_REQ_TYPE_NORMAL;
        m_ibeacon.timeslot_request.params.normal.hfclk       = NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED;
        m_ibeacon.timeslot_request.params.normal.priority    = NRF_RADIO_PRIORITY_HIGH;
        m_ibeacon.timeslot_request.params.normal.distance_us = m_ibeacon.adv_interval * 1000; //to ms
        m_ibeacon.timeslot_request.params.normal.length_us   = SLOT_LENGTH;
        return &m_ibeacon.timeslot_request;
    } ,

    Note however, what the documentation for the nrf_radio_request had to say about the distance_us variable:

    uint32_t      distance_us;                        /**< Distance from the start of the previous radio timeslot (up to @ref NRF_RADIO_DISTANCE_MAX_US microseconds). */ 

    In other words, you are setting the time distance for the next event relative to the previous one. If you need two "asynchronous" advertisers, one with adv interval 400ms and the other with 100ms, you will have to implement some sort of algorithm in your time slots that calculates the time distance until the next time slot that your advertisers require. Maybe you can configure the time slot to generate an event every 200ms (least common denominator of 1000 and 400) and then start one advertiser every other event, and the other advertiser every fifth event.  In your case it would be ideal if you could have two time slot instances that could operate independent of each other, but unfortunately such a feature doesn't exit in the time slot api. 

  • Hi, 

    thanks Martin, i'll try your suggestion, just a last question, only with 2 advertisements (softdevice and ibeacon timelot) i have a big loss of received packets on timeslot, with 1000ms of adv_interval i must receive 1 packet per second (in theory) but after 100 seconds of advertisement (with timeslot) i only received 64 packets, it means that i have lost 36 packet, do you have any idea why i lose too much packets ?

    thank you,

  • Remember that the scanner can only scan on one advertising channel at the time, and unless you have specifically told it otherwise, the scanner is probably not scanning a 100% of the time either. Please have a look at the third image from the top in this blog: Bluetooth Smart and the Nordic's Softdevices - Part 1 GAP Advertising

    Furthermore, even if you are scanning a 100% of the time there is most likely going to be some radio noise in your surroundings. It could come from WiFi devices, other BLE devices, microwave ovens etc. 

    If you are in a "quiet" radio environment and scanning 100% of the time, I think a 36% packet loss sounds a bit high, but you can never expect to receive all packets. 

Reply Children
No Data
Related