This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problems in advertsing after disconnect

hiii....

1.can any one tell where do we call advertising_start() function if we want to advertise after getting disconnect from a central device.

2.in ble_evt_dispatch() function there are many functions ryt? eg: ble_dlogs_on_ble_evt(&m_dlogs, p_ble_evt); ble_conn_params_on_ble_evt(p_ble_evt); on_ble_evt(p_ble_evt);

when and how these works?

Parents
    1. Your on_ble_evt function should have a case to handle BLE_GAP_EVT_DISCONNECTED. That would be an appropriate place to restart advertising.

    2. The ble_evt_dispatch function allows you to distribute ble events to any functions your application needs that may want to do some handling of a ble event. At a minimum you probably need the generic on_ble_evt and ble_conn_params_on_ble_evt calls. This allows your application to react appropriately to ble events. In my case I also call the bond manager ble event handler and my own custom event handler. My custom handler allows my custom service and characteristics to react appropriately to connect and disconnect events. You need to understand the needs of your application and handle ble events as needed.

Reply
    1. Your on_ble_evt function should have a case to handle BLE_GAP_EVT_DISCONNECTED. That would be an appropriate place to restart advertising.

    2. The ble_evt_dispatch function allows you to distribute ble events to any functions your application needs that may want to do some handling of a ble event. At a minimum you probably need the generic on_ble_evt and ble_conn_params_on_ble_evt calls. This allows your application to react appropriately to ble events. In my case I also call the bond manager ble event handler and my own custom event handler. My custom handler allows my custom service and characteristics to react appropriately to connect and disconnect events. You need to understand the needs of your application and handle ble events as needed.

Children
No Data
Related