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

when APP_ADV_DURATION expires then BLE should goes in other state

Hello sir,

                I am using nrf58232  Dev kit board  in which when my BLE  goes is in advertisement board  and after couple of seconds  advertise APP_ADV_DURATION  is expired then it stop scanning for  connecting with the phone.My BLE  APP_ADV_DURATION is  3 minutes  and after  if i  want to switch from advertise mode to other  mode then which function should be used in the BLE code.In these code i don't want the timer  function  should use to count  minutes for the APP_ADV_DURATION  should expire .Can you suggest me how to switch  from  APP_ADV_DURATION expires to other mode.

Parents
  • HEllo,

    I suggest to for instance look at the usage of the advertising module in the ble_app_hrs example.

    You typically init the module by calling ble_advertising_init() with the durations of advertisment you want to perform, and start advertisement by calling ble_advertising_start(). As the advertisement is switching modes you will get events in the on_adv_evt() callback handler. For instance when all advertisement modes have occured it will go to idle as reported by an BLE_ADV_EVT_IDLE event in on_adv_evt()

    You can at any time call ble_advertising_start() to switch advertising mode or even go directly to idle by calling ble_advertising_start(&m_advertising, BLE_ADV_MODE_IDLE).

    Also check out documentation:
    https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_ble_advertising.html

    Best regards,
    Kenneth

Reply
  • HEllo,

    I suggest to for instance look at the usage of the advertising module in the ble_app_hrs example.

    You typically init the module by calling ble_advertising_init() with the durations of advertisment you want to perform, and start advertisement by calling ble_advertising_start(). As the advertisement is switching modes you will get events in the on_adv_evt() callback handler. For instance when all advertisement modes have occured it will go to idle as reported by an BLE_ADV_EVT_IDLE event in on_adv_evt()

    You can at any time call ble_advertising_start() to switch advertising mode or even go directly to idle by calling ble_advertising_start(&m_advertising, BLE_ADV_MODE_IDLE).

    Also check out documentation:
    https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_ble_advertising.html

    Best regards,
    Kenneth

Children
No Data
Related