BLE - AVDERTISEMENT TYPE legacy

Hi,

      I am doing the advertisement one second interval and the advertisement mode is in connectable mode. sometimes when i am scanning the beacons there is no uuid bytes in the advertisement not even the major minor bytes only the length of 10 bytes its changing. but i never stopping the advertisement and starting that time , still its changing automatically .

please check is something wrong in this.

Thanks,

Sowmiya

Parents
  • Hi Sowmiya,

    Thank you for posting your question online and apologies for the delay.
    You have placed this question on the Bluetooth Forum instead of the Bluetooth Low Energy Forum. Let me move this to the BLE Forum.
    Regarding the change on the advertising data:
    1) Which BLE device are working with? Is it DA14531?
    2) Which SDK version are you working with?

    If you are using DA14531 and the default ibeacon example (from GitRepo) then it is expected the Advertising Data to change. There is an app_easy_timer that expires after 30 seconds that updates the Advertising Data.

    Best Regards,
    OV_Renesas

  • 1) Which BLE device are working with? Is it DA14531?
    2) Which SDK version are you working with?

    da14531 and sdk : 6.0.16.1144

    DEF_ADV_FOREVER  i have sets this type and where is that 30 sec timer that updates data ?

    static const struct default_handlers_configuration user_default_hnd_conf = {
    // Configure the advertise operation used by the default handlers
    // Possible values:
    // - DEF_ADV_FOREVER
    // - DEF_ADV_WITH_TIMEOUT
    .adv_scenario = DEF_ADV_FOREVER,

    // Configure the advertise period in case of DEF_ADV_WITH_TIMEOUT.
    // It is measured in timer units (3 min). Use MS_TO_TIMERUNITS macro to convert
    // from milliseconds (ms) to timer units.
    .advertise_period = MS_TO_TIMERUNITS(180000),

    // Configure the security start operation of the default handlers
    // if the security is enabled (CFG_APP_SECURITY)
    // Possible values:
    // - DEF_SEC_REQ_NEVER
    // - DEF_SEC_REQ_ON_CONNECT
    .security_request_scenario = DEF_SEC_REQ_NEVER
    };

  • Hi Sowmiya,

    Thank you for the reply.

     One more query from this BLE advertising , can we use the Ibeacon advertisement format with connectable mode ?

    https://community.renesas.com/wireles-connectivity/f/bluetooth-low-energy/30092/ibeacon-abvertisemt-not-working-in-changing-of-connectable-mode

    This was the link which i have queried before . is this method is possible now ?

    The beacon format utilizes all 31 bytes of the Advertising data. This is possible only in non-connectable advertising. 
    If you use connectable advertising you can only use 28 bytes of the Advertising Data (3 bytes are reserved for Flags), this means that you cannot use the beacon formats with Connectable advertising.
    You can modify the Manufacturer Specific Data and add 28 bytes of custom information there that will resemble the beacon format.
    You could also try to add the beacon format on the Scan Response Data but only the Centrals that do Active Scan will be able to read them.


    da14531 and sdk : 6.0.16.1144

    DEF_ADV_FOREVER  i have sets this type and where is that 30 sec timer that updates data ?

    Most of our SDK6 examples have an app_easy_timer running that will update the Advertising data.
    The timer callback looks like this:

    /**
     ****************************************************************************************
     * @brief Advertisement data update timer callback function.
     ****************************************************************************************
    */
    static void adv_data_update_timer_cb()
    {
        // If mnd_data_index has MSB set, manufacturer data is stored in scan response
        uint8_t *mnf_data_storage = (mnf_data_index & 0x80) ? stored_scan_rsp_data : stored_adv_data;
    
        // Update manufacturer data
        mnf_data_update();
    
        // Update the selected fields of the advertising data (manufacturer data)
        memcpy(mnf_data_storage + (mnf_data_index & 0x7F), &mnf_data, sizeof(struct mnf_specific_data_ad_structure));
    
        // Update advertising data on the fly
        app_easy_gap_update_adv_data(stored_adv_data, stored_adv_data_len, stored_scan_rsp_data, stored_scan_rsp_data_len);
    
        // Restart timer for the next advertising update
        app_adv_data_update_timer_used = app_easy_timer(APP_ADV_DATA_UPDATE_TO, adv_data_update_timer_cb);
    }
    

    Please check if the app_easy_gap_update_adv_data API is being called inside your code.

    Best Regards,
    OV_Renesas

  • Hi ,

     Thanks for the reply ,

    /* Advertising data update timer */
    #define APP_ADV_DATA_UPDATE_TO (360000) 

    i have define the timer to 1 hour also i have not done updating of packets without the uuids here i have updated the battery percenetage alone with the same packet .ihave checked with logs also dont know how the advertisement gets changing. as in the below function timer call back.

    static void adv_data_update_timer_cb()
    {
    
    arch_printf("timer exists %d : %d \r\n",stored_adv_data_len,stored_scan_rsp_data_len);
    
    batt_voltage = battery_get_lvl(BATT_CR2032);
    
    arch_printf("battery percentage update: %d\r\n",batt_voltage);
    
    stored_adv_data[11] = batt_voltage;
    
    
    // Update advertising data on the fly
    app_easy_gap_update_adv_data(stored_adv_data, stored_adv_data_len, stored_scan_rsp_data, stored_scan_rsp_data_len);
    
    // Restart timer for the next advertising update
    app_adv_data_update_timer_used = app_easy_timer(APP_ADV_DATA_UPDATE_TO, adv_data_update_timer_cb);
    
    
    
    }

    Thanks,

    SOwmiya

  • Hi Sowmiya,

    Thank you for the reply.
    So indeed you have a timer that updates the Advertising data inside your project.
    You should place a BKPT inside this timer callback and check the stored_adv_data matrix that indeed has the right format after you have updated the data. 
    For instance, on the initial screenshot you shared there is not a specific "field/case" for the Battery voltage. 
    If you add the Battery Service or the Manufacturer Specific Data you could add the batt_voltage byte into the advertising data.

    Please also refer on our:DA145XX Tutorial BLE Advertising — DA145XX Tutorial BLE Advertising (renesas.com) on how to set the correct Advertising and Scan Response Data format.

    Best Regards,
    OV_Renesas

Reply
  • Hi Sowmiya,

    Thank you for the reply.
    So indeed you have a timer that updates the Advertising data inside your project.
    You should place a BKPT inside this timer callback and check the stored_adv_data matrix that indeed has the right format after you have updated the data. 
    For instance, on the initial screenshot you shared there is not a specific "field/case" for the Battery voltage. 
    If you add the Battery Service or the Manufacturer Specific Data you could add the batt_voltage byte into the advertising data.

    Please also refer on our:DA145XX Tutorial BLE Advertising — DA145XX Tutorial BLE Advertising (renesas.com) on how to set the correct Advertising and Scan Response Data format.

    Best Regards,
    OV_Renesas

Children
No Data