The manufacture data in the Ble advertisement was abnormal.

example:ble_app_uart + secure_bootloader
sdk:17.1

hello.
Well, a strange phenomenon occurred when I was testing the connection between our ble device and the app。

Our app uses p_manuf_specific_data to identify whether to connect.

So we call advertising_init () first and then call  ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST)
to start advertisment.



Then we change the value of m_manuf_specific_data.company_identifier during program work by calling LL_BLE_SetManu(0x0d0d) or LL_BLE_SetManu(0x0f0f)

As a result, all of them are working properly. But when I reboot the device, the company_identifier changes in a strange way.

When I boot up normally, call advertising_init () first, then call LL_BLE_SetManu(0x0d0d) .company_identifier will be setting to 0x0d0d finally.
At this time, I turned the device off for entering sleep, and then turned it back on, so that he called advertising_init () first, and then called LL_BLE_SetManu(0x0f0f) .

company_identifier will change as strange as in the video,I don't know why 0x0d0d appears and don't want it to appear, will the adv data be stored in flash?

What can I do to prevent 0x0d0d from reconnecting my device to my app?


Looking forward to your reply. Thank you

Parents
  • Hi,

    When I boot up normally, call advertising_init () first, then call LL_BLE_SetManu(0x0d0d) .company_identifier will be setting to 0x0d0d finally.
    At this time, I turned the device off for entering sleep, and then turned it back on, so that he called advertising_init () first, and then called LL_BLE_SetManu(0x0f0f) .

    company_identifier will change as strange as in the video,I don't know why 0x0d0d appears and don't want it to appear, will the adv data be stored in flash?

    What can I do to prevent 0x0d0d from reconnecting my device to my app?

    I don't get it, wouldn't you expect 0x0d0d to be set when it does a reset? You say that you set 0x0d0d initially after a reboot, so that it appears would be expected? 

    adv data will not be stored in flash unless you set it explicitly. 

    regards

    Jared 

  • Hi Jared.

    At this time, I turned the device off for entering sleep, and then turned it back on, so that he called advertising_init () first, and then called LL_BLE_SetManu(0x0f0f) .

    I mean: why does 0x0d0d appear? The right change should be 0x0101 (call advertising_init () )first,then be 0x0f0f(call LL_BLE_SetManu(0x0f0f) ).

    0x0d0d should not appear in the beginning,it's not the company_identifier I wanted.
    I didn't call 0x0d0d the second time I started, but it came up and it confused me

    best regard
    kenyon

  • Hi,

    Looking at your project, I see that you don't initialize the manufacturer data in advertising_init():

    What is m_manuf_specific_data.data.p_data set to in this case?

    regards

    Jared 

  • HI 

    You mean  ble_advdata_manuf_data_t data? We just want to change the value of the cmopany_identifier. This data should not be assigned, right?

    regards
    Kenyon

  • I think you should set it to something in the start since you advertise when you call advertising_start(), before you change it later with LL_BLE_SetAdManu(),

    regards

    Jared 

  • hi Jared
    I initialized its data in advertising_init as you said, but it still didn't solve the problem


    Regard
    Kenyon

  • Hi Kenyon,

    I see.

    I built your project using the bash script and flashed it to my DK with the hope of debugging your project. I press button 4 in the beginning so that the device does not go to sleep, and then press button 2 for it to change the advertising manufacturer data. But the program never enters the LL_BLE_SetAdManu() in the main loop.

    I'm trying to reproduce what you shared in the video.

    Is there something that I forgot?

    Also regarding:

        // 4 bytes version info
        spec_data[0] = 1;
        spec_data[1] = 2;
        spec_data[2] = (unsigned char) ((0x01 & 0xFF00) >> 8);
        spec_data[3] = (unsigned char) ((0xff & 0x00FF) >> 0);

    I think the third line should be spec_data[2] = 0x01; Otherwise it would be set to 0x00.

    regards

    Jared 

Reply
  • Hi Kenyon,

    I see.

    I built your project using the bash script and flashed it to my DK with the hope of debugging your project. I press button 4 in the beginning so that the device does not go to sleep, and then press button 2 for it to change the advertising manufacturer data. But the program never enters the LL_BLE_SetAdManu() in the main loop.

    I'm trying to reproduce what you shared in the video.

    Is there something that I forgot?

    Also regarding:

        // 4 bytes version info
        spec_data[0] = 1;
        spec_data[1] = 2;
        spec_data[2] = (unsigned char) ((0x01 & 0xFF00) >> 8);
        spec_data[3] = (unsigned char) ((0xff & 0x00FF) >> 0);

    I think the third line should be spec_data[2] = 0x01; Otherwise it would be set to 0x00.

    regards

    Jared 

Children
Related