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

HOW to use direct advertising to connect the central successfully?

I use nrf52832 board by fast advertising to connect the central(surface 4 Tablet).Then the board go to sleep.when I push the button the board use direct advertising to connect the central again,but it dont connect. I use the peer manager to get the central address,when the BLE_ADV_EVT_PEER_ADDR_REQUEST event of direct advertising happens.

SDK 14.2  Softdevice 132 .Can you give me some suggestions about direct advertising to connect previous central successfully.

Parents
  • when first time  push button ,the board can connect the central by direct advertising.In connection state, application handles things completely, then the board and central disconnect .The board go to sleep. Next time(push button no matter how many times) the board can use direct advertising ,but cannt connect.I'm confused about this problem,How to solve this problem?

  • Hi, can you make sure that you first delete all bonds on the central and peripheral? 

  • log_keyboard.pdf

    This is a log from example of ble_app_hids_keyboard.The top half part is the nrf52 board connect with CINTIQ.Lower half is the nrf52 board connect with surface 4.when connected ,I pushed button1 long time to disconnect the peripheral and the central . Then they cannt reconnect at the surface 4 tablet.The example use direct adv firstly,fast adv with whitelist following.

  • It seems that the nRF52 for some reason is calling sd_ble_gap_disconnect() with BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION. Is it possible for you to search through your project and comment out sd_ble_gap_disconnect() until you find which one that is doing this? I believe it is called in ble_conn_params.c and main.c, but maybe other places. If you can which one is called, then we can find the cause I believe.

  • Official example  of ble_app_hids_keyboard assigns bitton1 with pushing long time to disconnect the central and peripheral when they connect. But the heart of the matter is when they disconnect, they can reconnect expect the central which is Microsoft's surface 3 or 4 tablet via fast adv with whitelist .You can see the log_keyboard.pdf above .I dont kown why surface tablet cannt reconnect peripheral via direct adv or fast adv with whitelist .Is there any events that i forget to deal with?

  • Just to make sure I don’t misunderstand, what is the name of the problematic log?

    Best regards,

    Kenneth

  • You cann't see the content of the log named log_keyboard.pdf I upload.

    <info> app: New Bond, add the peer to the whitelist if possible 
    <info> app:     m_whitelist_peer_cnt 1, MAX_PEERS_WLIST 8 
    <info> app: Directed advertising. 
    <info> app: Disconnected 
    <info> app: Fast advertising with whitelist. 
    <info> app: Connected to a previously bonded device. 
    <info> app: Connected 
    <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 0. 
    <info> app: Directed advertising. 
    <info> app: Disconnected 
    <warning> nrf_sdh_ble: RAM starts at 0x200020E0, can be adjusted to 0x20001F50. 
    <warning> nrf_sdh_ble: RAM size can be adjusted to 0xE0B0. 
    <info> app: HID Keyboard example started. 
    <info> app: Erase bonds! 
    <info> app: Fast advertising. 
    <info> app: Connected 
    <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 1. 
    <info> app: New Bond, add the peer to the whitelist if possible 
    <info> app:     m_whitelist_peer_cnt 1, MAX_PEERS_WLIST 8 
    <info> app: Directed advertising. 
    <info> app: Disconnected <info> app: Fast advertising with whitelist. 
    <info> app: Slow advertising with whitelist.

    From log it doesn't seem to be caused by sd_ble_gap_disconnect() with BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION.

    Can you see the sniffer log's content?Is there any difference from the normal one?

    I just see the central don't send info of CONNECT_REQ in direct adv.

Reply
  • You cann't see the content of the log named log_keyboard.pdf I upload.

    <info> app: New Bond, add the peer to the whitelist if possible 
    <info> app:     m_whitelist_peer_cnt 1, MAX_PEERS_WLIST 8 
    <info> app: Directed advertising. 
    <info> app: Disconnected 
    <info> app: Fast advertising with whitelist. 
    <info> app: Connected to a previously bonded device. 
    <info> app: Connected 
    <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 0. 
    <info> app: Directed advertising. 
    <info> app: Disconnected 
    <warning> nrf_sdh_ble: RAM starts at 0x200020E0, can be adjusted to 0x20001F50. 
    <warning> nrf_sdh_ble: RAM size can be adjusted to 0xE0B0. 
    <info> app: HID Keyboard example started. 
    <info> app: Erase bonds! 
    <info> app: Fast advertising. 
    <info> app: Connected 
    <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 1. 
    <info> app: New Bond, add the peer to the whitelist if possible 
    <info> app:     m_whitelist_peer_cnt 1, MAX_PEERS_WLIST 8 
    <info> app: Directed advertising. 
    <info> app: Disconnected <info> app: Fast advertising with whitelist. 
    <info> app: Slow advertising with whitelist.

    From log it doesn't seem to be caused by sd_ble_gap_disconnect() with BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION.

    Can you see the sniffer log's content?Is there any difference from the normal one?

    I just see the central don't send info of CONNECT_REQ in direct adv.

Children
Related