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

How can the Peripheral connect with Central only by using directed Broadcast

Hi

I'm using SKD16.0.0 and S132, and I want to realize that peripherals can only connect to a center with a known MAC address through directed advertising.How should I implement this?

  • Where the central MAC address is known. 
  • The peripheral address is unknown.
  • Use directed advertising directly
  • No pairing or binding is required.

Best regards

Xft

Parents
  • Hi XFT, 

    - You can get the MAC address of a central device when you connect to the central device (BLE_GAP_EVT_CONNECTED event). This only applied for central device that use static address. 

    - Please have a look at our ble_app_mouse example. In the example we use directed advertising after a disconnection. In the example we use bonding but you can think of skipping that if you don't plan to use bonding. When configuring the advertising set, you need to select the adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED or BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE

  • Hi Hung Bui,

    Thank you for your answer, but it does not fulfill my idea.Because I already knew the MAC address of the central in advance, I wanted to communicate with the specified central from the beginning via directed advertising, rather than using directed advertising after the disconnect.Can you provide a solution to this idea?

  • If you already have the address, you can fill that in the p_peer_addr field in ble_gap_adv_params_t struct. And then start directed advertising. Please study the ble_advertising.c library we have. 

Reply Children
Related