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

Direct Advertisement, how to setup central?

Hello,

I have a peripheral based on the nrf52 that connects to my Android phone already in direct advertisement mode.

I am trying to get a NRF52 central working with this direct advertisement. Normal advertisement modes works.

What is the key steps that is needed to have the central setup correctly?

Thanks in advance!

FI

  • FormerMember
    0 FormerMember

    When using direct advertising, there is no specific setup for the central, except that you have to make sure that the central is scanning with appropriate scan interval/scan window.

    In order to achieve a fast connection establishment a possible, the central should have close to continuous scanning and have a fairly short scan interval. Bluetooth core specification v.4.2, vol. 3, part C, appendix A recommends the following parameters for a fast connection initiation:

    • Scan interval: 30 ms to 60 ms
    • Scan window: 30 ms
    • Minimum time for doing the scanning (scan period): 30.72 s.
  • Kristin, Thanks for your input.

    I should clarify better, the implementation:

    1. Only DIRECT ADVERTISEMENT SLOW is enabled on peripheral, low duty cycle, but the timeout is very very long.

    2. Scan window and interval changed to your 30ms/60ms on central per your advise.

    3. Scan params setup: no scan request, no whitelist

    4. No device manager implemented in the Central.

    For normal advertisement the central connects to peripheral fine. Only when the peripheral switch to DIRECT ADV SLOW after an intended link dropout, the central fails to establish the connection.

    When using an Android phone as a central using the Nordic master control panel, the above proposed use scenario works fine.

    What else I should look into? I have read about the ADDR type being Public or Random, but was not able to find where to specify that either in the Central app nor the Peripheral.

    Thanks again!

    FI

  • FormerMember
    0 FormerMember in reply to FormerMember

    Okay, I see. I was thinking high duty cycle directed advertising. Anyway.

    Do you have an extra nRF51-DK or a nRF51-Dongle? If so, could you use the sniffer to check if there is any interaction between the central and the peripheral device? And upload the sniffer trace here?

    The sniffer should be used with Wireshark, and it works best with version 1.10, not one of the newer versions. Wireshark can be downloaded here:

    For directed advertising, the advertising packets will contain an address, the only address that is allowed to send a connect request. Does the address in the advertising packet is the same as the address of your central device?

  • Here is what was checked:

    1. Central device address and its type via UART at central at first connection is
    • type: 1
    • address: 56 67 B3 36 5B D7
    1. Using a sniffer, indirect advertisement Initiator Address is the same 56 67 B3 36 5B D7

    2. Address type is checked on the peripheral side via UART as type 1.

    Here is the packet data from TI sniffer

    +----------------------------------------------------+----------------- - - - | Packet sniffer frame header | +----+-------------+-------------------------+-------+ |info| Packet nbr. | Time stamp | Length| Packet data +----+-------------+-------------------------+-------+----------------- - - - | 01 | 60 02 00 00 | 51 05 A8 33 02 00 00 00 | 18 00 | 17 D6 BE 89 8E C1 0C 2C 69 2E 02 3C DF 56 67 B3 36 5B D7 E7 D1 1F 40 A5 +----+-------------+-------------------------+-------+----------------- - - -

    The central sees the Direct Advertisement from this particular peripheral, and a trap catches the peer advertisement in the BLE_GAP_EVT_ADV_REPORT handler:

    peer type: 1
    2C 69 2E 2 3C DF

    Still the central is not connecting when the peripheral goes into Direct ADV. What are the necessary steps for nrf52 central to connect to this guy? Thanks.

  • My bad. The sniffer is revealing. The "payload" for direct advertisement is initiator address instead of the device name my code was expecting! The code currently checks for proper device name, therefore no connections since no name matches.

    It is working now. Thanks!

    FI

Related