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

[nRF Connect SDK] Make ble connectable only for multiple paired(bonded) devices

Target nRF52832(nrf52dk_nrf52832)
SDK NCS v1.9.1

Base source
1. C:\Users\user\ncs\v1.9.1\nrf\samples\bluetooth\peripheral_hids_keyboard
2. C:\Users\user\ncs\v1.9.1\nrf\samples\bluetooth\peripheral_uart

My project require two mode(HID and NUS).
I made new project that support two mode.(User can select mode, and each mode will begin at boot time).

-----------------------------------------------------------------------------------------------------
My project used BT classic. So it can be acceptable for incoming connection regarding paired(bonded) device without discoverable option.
BLE protocol as peripheral role does not allow to accept incoming connection without advertise.
My question is following scenario is possible.

1. Make bonding with serveral other devices(Android, iOS or Windows). (CONFIG_BT_MAX_PAIRED=4)
2. Reboot BLE device(nordic)
3. BLE begin to advertise only for paired devices. (I found we could add paired list into advertise information)
4. Keep advertise until one of paired devices try to connect.
5. Accept incoming connection.
6. If BLE disconnected, BLE begin to advertise again. (Only for paired)
7. If BLE want to pair another device, BLE stop advertise and begin to advertise without paired list.
8. Make pairing for new device.

My customer use several our BLE product at the same time, so please review if my scenario is possible.
Thanks.

  • Thank you for your kind reply.

    1. What I'm expecting is..
    Only bonded devices(>= 2) can see advertise. The others cannot find BLE device until ble device begin regular advertise(no peer list). One of them try to connect, it will be connected.(accepted)

    2. Whitelist
    I don't know Whitelist exactly. However from your comments, whitelist feature is allowed to incoming connection for specific central devices. And all central device can see advertise, right? Or please let me know.

    3. In my product scenario..
    If a user can see Nordic BLE but Android cannot connect it due to any policy, it will be more important issue. because they probably cannot understand such scenario.

    My scenario looks like BT classic. My product have used BT classic chipset.
    Last year my product replace it from BT classic to BLE device.
    As you know, BT classic have connectable and discoverable properties.
    Without discoverable, it can make connection unlikely BLE.

    I'm wondering if BLE can do similar scenario. 

  • Tim Hwang said:
    1. What I'm expecting is..
    Only bonded devices(>= 2) can see advertise. The others cannot find BLE device until ble device begin regular advertise(no peer list). One of them try to connect, it will be connected.(accepted)

    Not exactly. All devices can see advertisements, but most central devices will ingore advertisements that are using a whitelist (it is a flag inside the advertisement), and the scanner is not known for the device.

    Tim Hwang said:
    2. Whitelist
    I don't know Whitelist exactly. However from your comments, whitelist feature is allowed to incoming connection for specific central devices. And all central device can see advertise, right? Or please let me know.

    Same on 1)

    Tim Hwang said:
    3. In my product scenario..
    If a user can see Nordic BLE but Android cannot connect it due to any policy, it will be more important issue. because they probably cannot understand such scenario.

    Phones will typically ignore devices which it knows it can't connect to (whitelist/directed advertisement). So for an end user this is typically not a problem.

    Tim Hwang said:
    My scenario looks like BT classic. My product have used BT classic chipset.
    Last year my product replace it from BT classic to BLE device.
    As you know, BT classic have connectable and discoverable properties.
    Without discoverable, it can make connection unlikely BLE.

    I am actually not that familiar with BT Classic. But if you mean that you can connect to different properties in Classic, that is not the case in BLE, but I am not sure I understood this question.

    Best regards,

    Edvin

  • Thanks for updating. I understand whitelist somehow.
    I'll do whitelist API with Android and Windows PC. 

    [Update]
    I did whitelist test. I refered follwing case.
    devzone.nordicsemi.com/.../ncs-zephyr-how-to-enable-whitelist

    Changes:
    1) Prj.conf
    CONFIG_BT_FILTER_ACCEPT_LIST=y
    2) Add whitelist when make bonding .
    bt_le_whitelist_add(..)

    #define BT_LE_ADV_WLIST_CONN BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE|BT_LE_ADV_OPT_FILTER_CONN, \
    BT_GAP_ADV_FAST_INT_MIN_2, \
    BT_GAP_ADV_FAST_INT_MAX_2, NULL)

    err = bt_le_adv_start(discoverable ? BT_LE_ADV_CONN : BT_LE_ADV_WLIST_CONN, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));

    Result
    Adding whitelist is done. In case whitelist is enabled, Android can find BLE, but cannot make connection. Or it worked normally.(pairing&connecting)

    Bluebird_ab:cd:a0: Nordic BLE
    55:55:0f:28:d1:a4: Android



    From this test, I would say BLE cannot advertise only for paired (bonded) devices only, right?
    If yes, it is official announcement to our customers.

  • Tim Hwang said:
    From this test, I would say BLE cannot advertise only for paired (bonded) devices only, right?

    What do you mean by this?

    Advertisements are never encrypted, so it is not possible to advertise so that certain devices "doesn't see it". However, most devices will not display whitelisted/directed advertisements to the user if they are not bonded with the device. However, if you used nRF Connect for Android to connect to this device, it will show you all advertising devices. 

    Did you see your device in the phone's bluetooth settings?

    BR,

    Edvin

  • However, most devices will not display whitelisted/directed advertisements to the user

    -> Can you please check my advertisements has whitelisted option properly in sniff log?
    Galaxy, Windows PC also display advertisement whitelist enabled BLE.

    Nordic_whitelist_filtered.pcapng

    Here is no whitelist sample.
    No difference, in my thought, was found advertisement packet between them.
     Nordic_No_whitelist.pcapng

Related