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

Getting advertisement UUID changed...

Hello All,

I am working on nRF51822 custom board.Use SDK nRF5 12.3.0 in IAR workbench.

I am use ble peripheral example path given below,

...\...\examples\ble_peripheral\ble_app_template.

In application I create one custom service and in advertisement packet I used 128 bit UUID.

In custom service I added three characteristic.In this application is working properly

Below I give characteristic description,

First characteristic : notification and read enable and 64-bit data send to mobile application.

Second characteristic: write, notification and read enabled and 20 byte data send and receive from mobile.

Third characteristic: notification and read enable and 2 byte data send to mobile.

When I add one more characteristic in my application but after that in the advertisement UUID getting changed.

Below I give characteristic description,

Forth characteristic: notification and read enable and 2 byte data send to mobile.

So my question is how can i add one more characteristic in my code?

one more question is what is the reason of advertisement UUID getting changed?

Please give me answer of my question as soon as possible.

Thanks & Regard,

Urvisha Andani 

  • Hi,

     

    When I add one more characteristic in my application but after that in the advertisement UUID getting changed.

     Could you post the code you used to set the service UUID in the advertisement packet?

    what is the reason of advertisement UUID getting changed?

     What was the original value ? What did it change to?

  •  Could you post the code you used to set the service UUID in the advertisement packet?

    yes, i mention below,

    #define SDS_UUID_BASE {0xF4, 0xE7, 0xA4, 0xCF, 0xCD, 0xA2, 0x48, 0xB6, \
                                               0xBD, 0x4C, 0xD8, 0x6F, 0x00, 0x00, 0xE7, 0x7E}
    #define SDS_UUID_SERVICE         0xE1FA
    
    #define SDS_UUID_DATA_FLAG_CHAR  0x2AD1
    #define SDS_UUID_SERIAL_NUMBER   0x2A14
    #define SDS_UUID_MAX_ADC         0x2A16
    #define SDS_UUID_MIN_ADC         0x2A17
    
    

    also i mention advertisement initialization function,

    #define APP_FAST_ADV_INTERVAL                480                                         /**< The advertising interval (in units of 0.625 ms. This value corresponds to 300 ms). */
    #define APP_FAST_ADV_TIMEOUT_IN_SECONDS      60                                         /**< The advertising timeout (in units of seconds). */
    
    static ble_uuid_t m_adv_uuids[] = {{SDS_UUID_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN}}; /**< Universally unique service identifiers. */
    
    
    static void advertising_init(void)
    {
        uint32_t               err_code;
        ble_advdata_t          advdata;
        ble_adv_modes_config_t options;
    
        // Build advertising data struct to pass into @ref ble_advertising_init.
        memset(&advdata, 0, sizeof(advdata));
    
        advdata.name_type               = BLE_ADVDATA_FULL_NAME;
        advdata.include_appearance      = false;
        advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
        advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
        advdata.uuids_complete.p_uuids  = m_adv_uuids;
    
        memset(&options, 0, sizeof(options));
        options.ble_adv_fast_enabled  = true;
        options.ble_adv_fast_interval = APP_FAST_ADV_INTERVAL;
        options.ble_adv_fast_timeout  = APP_FAST_ADV_TIMEOUT_IN_SECONDS;
        
        err_code = ble_advertising_init(&advdata, NULL, &options, on_adv_evt, NULL);
        APP_ERROR_CHECK(err_code);
    }

    What was the original value ? What did it change to?

    original value is : 0x7EE7E1FA-6FD8-4CBD-B648-A2CDCFA4E7F4
     

    Advertisement UUID getting changed in this case in UUID was : 0x7EE71399-6FD8-4CBD-B648-A2CDCFA4E7F4 and it is not fix every time it changed.

  • Urvisha Andani said:
    it is not fix every time it changed

     That is very strange.I have not been able to reproduce this. Do you see other issues/bugs when this happens ?
    Do you see the same issue if you test it on a nRF51-DK ?

    Could you create a small example that reproduces this behavior?

Related