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

BLE init Advertising

Hi.

I'm developing a ble module now.

I have a question about time out, interval among BLE init Advertising.

As shown in the picture below, time out (in units of 10ms) is set to Advertise for 2 minutes, and interval is set to 60.

I want to do Advertising continuously, but it stops after 2 minutes.

Question 1. Does the event occur separately after 2 minutes as set by timeout?
Question 2. What is the unit of interval?
Question 3. I want to turn on Advertising without turning it off, do I need to change the mode or need another setting?

Thank you for reading it.

Parents
  • Hello,

    Question 1. Does the event occur separately after 2 minutes as set by timeout?

     I am not exactly sure what you are asking here. The advertising timeout event happens after 2 minutes with the configuration you have sent above, because of the timeout configuration. The timeout is given in units of 10 ms, and is in your case set to 12000, which translates to 2 minutes.

    Question 2. What is the unit of interval?

    The advertising intervals are given in units of 625 us. It seems this is not mentioned in the documentation for the ble_adv_modes_config_t documentation, unfortunately.

    Question 3. I want to turn on Advertising without turning it off, do I need to change the mode or need another setting?

    To advertise without a timeout you will need to change the following in your configuration:

    adv_params.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    ..
    adv_params.config.ble_adv_fast_timeout = 0;

    Advertising without timeout is demonstrated in the ble_app_beacon example, which could be helpful for you to have a look at. In the example, a beacon is created, and its advertisements never time out.
    Try this, and let me know if you achieve the desired functionality.

    Please do not hesitate to ask if you should encounter any other issues or questions!

    Best regards,
    Karl

Reply
  • Hello,

    Question 1. Does the event occur separately after 2 minutes as set by timeout?

     I am not exactly sure what you are asking here. The advertising timeout event happens after 2 minutes with the configuration you have sent above, because of the timeout configuration. The timeout is given in units of 10 ms, and is in your case set to 12000, which translates to 2 minutes.

    Question 2. What is the unit of interval?

    The advertising intervals are given in units of 625 us. It seems this is not mentioned in the documentation for the ble_adv_modes_config_t documentation, unfortunately.

    Question 3. I want to turn on Advertising without turning it off, do I need to change the mode or need another setting?

    To advertise without a timeout you will need to change the following in your configuration:

    adv_params.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    ..
    adv_params.config.ble_adv_fast_timeout = 0;

    Advertising without timeout is demonstrated in the ble_app_beacon example, which could be helpful for you to have a look at. In the example, a beacon is created, and its advertisements never time out.
    Try this, and let me know if you achieve the desired functionality.

    Please do not hesitate to ask if you should encounter any other issues or questions!

    Best regards,
    Karl

Children
Related