Extended Advertising - reception and data size

Hi,

I recently started with nRF52840-DK, Zephyr and nRF Connect SDK (v. 1.9.1). I want to test extended advertising. Since there is no example of "pure" extended advertising (i.e. no periodic), I modified the periodic_adv example. Modification is quite easy: In prj.conf setting CONFIG_BT_PER_ADV=n, in main.c skipping bt_le_per_adv_set_param() and bt_le_per_adv_start(), usage of bt_le_ext_adv_set_data() instead of bt_le_per_adv_set_data(). Now extended advertising runs well. With a Sodera sniffer, I can see three ADV_EXT_IND frames in channels 37/38/39, followed by an AUX_ADV_IND frame in one of the data channels. The AUX_ADV_IND frame contains two AD elements: One with the data I want to transmit and one with the complete local name as set in prj.conf.

For reception, I use the periodic_sync example, which should support extended advertising without the periodic functionality too.

Now the questions:

My receiver calls the scan_recv function, but always I see only one of the AD elements. The buffer contains only the AD element with the local name, which is the last one in the frame (according to the sniffer raw data). There is no indication of the reception of my data in the second AD element. What have I to do to receive both (or even more) AD elements? What is the intention here - to have several calls of scan_recv for every AD element or to have a list of buffers or something else?

Parents Reply Children
  • Hi Simonr,

    i) as mentioned, both files (main_advertiser.c and main_receiver.c) contain right after the includes the prj.conf settings as a comment. And yes, I think this is where the buffer length should be set. But I don't know which parameter will do a modification of the length of the receive buffer (CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX obviously does not).

    ii) "not every second" simply means that I receive roughly half of the transmitted frames as an average. It means  n o t  good/bad/good/bad/good/bad..., but maybe good/bad/good/good/good/bad/bad/good/bad/bad/bad/good...  My assumption is that due to the heavy work load (50..80 frames per second) the stack can't manage the reception of every frame. That's why I would like to have an indication, how long the stack will need for processing of a received frame up to the call of the call-back function, i.e. which "frame frequency" might be a maximum to ensure the correct reception of every frame. In my example I don't do much in the call-back, which means in that case I should come quite close to this max. frame frequency. When doing more in the call-back, having a single-core processor I clearly reduce this frequency, but in this case I'll be the one who has to optimise the work flow. But the starting point, i.e. the max. frame frequency, comes with the stack.

    Best regards

    Axel

  • Hi Simonr,

    I have another additional question: Occasionally, i.e. maybe once in 30 advertisements, it happens that there are the three ADV_EXT_IND frames, showing in the AUX Pointer in the field "Calculated Offset" 1110µs/810µs/510µs as usual, but there is no AUX_ADV_IND frame at all. The next advertising cycle starts normally roughly a second later with three ADV_EXT_IND frames and the following AUX_ADV_IND frame correctly, also the cycle before was completely ok. Due to the fact that between the first ADV_EXT_IND frame and the AUX_ADV_IND frame time is little more than 1.1ms, my sleeptime of k_sleep(K_MSEC(22)) in the main_advertiser (30 in my current test) seems well sufficient to not stop the advertising before transmission. Do you have any idea what happens there?

    Best regards

    Axel

Related