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

How to debug BLE central sd_ble_gap_connect()

Hi,

I am using nrf51822(qfaa), sdk12.3, softdevice s130. I am using the ble_app_uart (both central and peripheral) as reference for my development. I have both central and peripheral module enabled at same time (on device discovery, device with lower mac ID becomes central and other peripheral).

The central device can see the other device advertising. sd_ble_gap_connect() returns SUCCESS inside BLE_GAP_EVT_ADV_REPORT case statement. But after that I never get another ble event (on_ble_evt()), no connect, disconnect or timeout event (I experimented with different SCAN_TIMEOUT values). The other (peripheral) device never gets connection request either (continues advertising).

How can I debug this further?

Note: All the connection parameters are same for both central and peripheral as in the uart example.

Parents
  • Problem Solved! I enabled debugging and found out I had issues with my advertising stop routine, which I fixed. Thanks for the help!

    I have a related question: I noticed that in my advertising_init() API (from ble_app_uart example code) I tired to move the API to another file so I can't keep the function definition as 'static', and it stopped advertising anymore. Further debugging I found out that I must make the variable scanrsp (static ble_advdata_t) as 'static' variable or else advertising doesn't work. Do you know why this is?

Reply
  • Problem Solved! I enabled debugging and found out I had issues with my advertising stop routine, which I fixed. Thanks for the help!

    I have a related question: I noticed that in my advertising_init() API (from ble_app_uart example code) I tired to move the API to another file so I can't keep the function definition as 'static', and it stopped advertising anymore. Further debugging I found out that I must make the variable scanrsp (static ble_advdata_t) as 'static' variable or else advertising doesn't work. Do you know why this is?

Children
No Data
Related