Setting Custom Extended Inquiry Response (EIR) Data in Non-Connectable Advertising using nRF Connect SDK v2.4.2 on nRF52832 DK



Hi! 

I'm currently working with the nRF52832 DK and using the nRF Connect SDK v2.4.2. My goal is to send custom data in non-connectable advertising mode, and I specifically want to set my own Extended Inquiry Response (EIR) data. I would like to include variables or a custom device name in this EIR data. Can someone provide guidance on how to achieve this using the nRF Connect SDK v2.4.2?

Your assistance is greatly appreciated.


Thank you!

Parents Reply Children
  • Is that a nRF52832 application broadcasting the advertisement that you screenshot? EIR and Inquiry is a Bluetooth Classic concept, and I don't believe the nRF52832 is capable of that.

    Yes,I am using nrf52832dk
    but i am getting the results like this 

    #define CUSTOMDATA   0X5A
    #define USERDATA     0X0B
    static const struct bt_data ad[] = {
         BT_DATA(CUSTOMDATA, &switch_status, 1),
         BT_DATA(USERDATA, Target_Address,  ARRAY_SIZE(Target_Address)),
        };
        
    void bt_task_execute(void)
    {
        int err;
        err = bt_enable(NULL);
        if (err)
        {
            printk("Bluetooth init failed (err %d)\n", err);
            return;
        }
    
        err = bt_le_adv_start(BT_LE_ADV_NCONN, ad, ARRAY_SIZE(ad),
                              NULL, 0);
        if (err)
        {
            printk("Advertising failed to start (err %d)\n", err);
            return;
        }
    
        k_sleep(K_MSEC(500));
    
        /* Stop advertising */
        err = bt_le_adv_stop();
        if (err)
        {
            printk("Advertising failed to stop (err %d)\n", err);
            return;
        }
    
        err = bt_disable();
        if (err)
        {
            printk("Bluetooth disable failed (err %d)\n", err);
            return;
        }
    }



    In Bluetooth Low Energy, there is the concept of Scan Response. A scanner that is performing active scanning can get a Scan Response from the advertiser. Note that a scanner that is performing passive scanning will not get this Scan Response

    I don't want to use scan response.
    i want my data in advertisement payload only with custom heading instead of (UNKNOWN EIR).

    thanks!   

  • Hi Hari,

    That is not accurate usage of the BT_DATA helper macro. I believe you also are misunderstanding how BLE Advertising work.

    Please refer to its documentation and the Advertisement webminar I linked previously.

    For a more beginner friendly approach, you can refer to our free Bluetooth Low Energy Fundamental course. To setup BLE Advertising, you only need to finish up to Lesson 2.

  • I understand that my previous statement may not have been entirely accurate.

    However, I would like to clarify my intentions. Is there a way for me to access a specific part(EIR)? If there is a possible method to do so, it would be greatly appreciated.

  • hari said:
    Is there a way for me to access a specific part(EIR)?

    I don't understand this question. 

    Like I said before, EIR is a Bluetooth Classic concept. It is not available on the nRF52 series SoCs, at least for now.

    In a BLE Advertising, there can be multiple data fields in both the main Advertising packet, and in the Scan Response packet. However, almost all of them have specifications that they must comply with, restricting the kind of data you can put in. The data type that provides the most customizability is Manufacturer Specific Data.

    Please go over the resources that I have provided. This kind of back and forth terribly inefficient.

Related