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

ble_app_uart ble timeout problem

Hi, all! Sorry, I'm not good at English myself.

My device is nrf52832. Example code is ble_app_uart (pca10040, s132), I did not modify the code.

My problem.

Ble will sleep when Not connet for few time. (APP_ADV_TIMEOUT_IN_SECONDS is 180)

1. Power on (First start) : My Device is Nordic_UART

image description

2. Afer few minute(180sec) : My device is not scanned.

image description

How to let ble always available?

I have tried this. but It was not resolved.

I want connect my device always.

Thank you for reading this question!

Parents
  • Hi JaeHo!

    As max said in his answer, you should set the advertisement timeout to zero:

    #define APP_ADV_TIMEOUT_IN_SECONDS     0
    

    However, if you want to advertise forever you need to set the LE General Discoverable Mode flag, not the LE Limited Discoverable Mode flag.

    So in advertising_init(), change the:

    advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
    

    to

    advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    

    and your device should advertise forever.

    Hope that works.
    Best regards,
    Joakim.

Reply
  • Hi JaeHo!

    As max said in his answer, you should set the advertisement timeout to zero:

    #define APP_ADV_TIMEOUT_IN_SECONDS     0
    

    However, if you want to advertise forever you need to set the LE General Discoverable Mode flag, not the LE Limited Discoverable Mode flag.

    So in advertising_init(), change the:

    advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
    

    to

    advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    

    and your device should advertise forever.

    Hope that works.
    Best regards,
    Joakim.

Children
Related