NCS mutiple_adv_sets get adv index

Hello,

When I use the sample mutiple_adv_sets in NCS v2.5.0,

I am wondering if there is a way to print the index of each AD after it has been started, so as to distinguish between different ads when they are sent (such as bt_le_ext_adv_get_index(),

but I don't know where to call it after each AD has started).

ps. Instead of unpacking packets at the receiver to distinguish between different advertising packets, they are immediately differentiated when they are sent.

Thank you

  • The bt_le_adv_update_data() sets single advertisments, correct. To change an advertising set's adv/scan response data you can use bt_le_ext_adv_set_data().

    The bt_le_ext_adv_get_index() function gets an array index of an advertising set. The function is used to map bt_adv to an index of an array of adv sets. It returns the index of the advertising set object.

    Best regards,

    Simon

  • Hi

    bt_le_ext_adv_set_data() is really useful!

    About bt_le_ext_adv_get_index(),the function is passed a pointer(*adv)as an argument. In my example above,  I have three connectable ads in my AD set with 20ms, 50ms, and 100ms periods.

    After these ads have been sent,when and how should I get this pointer to use this function?

    Best regards,

    qianjunwang

  • For bt_le_ext_adv_get_index() You input a struct with the advertising set, right. So you need to make different calls to this function for the different advertising sets. I'm not sure I understand what you mean further by how to get the pointers for them. When do you need/expect to get the array index of these adv sets?

    Best regards,

    Simon

  • Hi

    Sorry, I seem to have misunderstood the concept of AD sets.
    I had thought that the number of bt_le_ext_adv established Pointers combined would be called an AD set, with one AD for each index. But to hear you say, is it building multiple AD sets? What's the difference between a single AD set and a single AD?
    I expect to get the index every time I send an AD(AD set?) with that index. Just like the original multiple_adv_sets example, it has one connectable AD (set)and one unconnectable AD(set), with different cycles. Can I get the index every time an AD packet is sent to distinguish which AD (AD set?) it is.

    My original confusion was called like this

    In fact, the index is already specified by the argument.

    I'm confused about this.

    Best regards,

    qianjunwang

  • Hi

    An advertisement is just one advertising event that a peripheral sends out. Advertising sets is a set of advertisements with the same parameters, and setting multiple advertising sets is possible with the multiple adv sets sample. So multiple advertising sets lets a device send different advertisements concurrently with different parameters.

    Best regards,

    Simon

Related