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

Allowing connections, then switching to connection-less.

I need to allow BLE connections for a period of time after restart, then prevent connections (unless a button is pressed).  Is this functionality as simple as re-configuring the advertising parameters to use (  BLE_GAP_ADV_TYPE_ADV_NONCONN_IND ).

Also, I am using scan responses.  Do I need to use BLE_GAP_ADV_TYPE_ADV_NONCONN_IND instead, and will this prevent connections.  I've seen it mentioned in other forum threads but the documentation is not clear whether this allows connections or not.

Is there anything else I need to do to start preventing connections in the code.

Parents
  • Hi,

    To allow a scanner (central) to read your scan response, but not connect, you should use BLE_GAP_ADV_TYPE_ADV_SCAN_IND. I agree that the documentation of these defines are sparse, but if you search for ADV_SCAN_IND in the Bluetooth Core specification you will find the information you need. 

    If you use ADV_NONCONN_IND the scanner will neither be able to read your scan response nor connect. 

Reply
  • Hi,

    To allow a scanner (central) to read your scan response, but not connect, you should use BLE_GAP_ADV_TYPE_ADV_SCAN_IND. I agree that the documentation of these defines are sparse, but if you search for ADV_SCAN_IND in the Bluetooth Core specification you will find the information you need. 

    If you use ADV_NONCONN_IND the scanner will neither be able to read your scan response nor connect. 

Children
No Data
Related