<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60446/swift-pairing-for-custom-gatt-service</link><description>Hi, 
 I am using custom gatt service &amp;amp; I have included some of the code which supports swift pairing from ble_hid_mouse example. Here is my sniffer log - 
 
 &amp;amp; the jlink rtt log - 
 
 For my application, the MTU size is 32 &amp;amp; data length is 36. 
 Windows</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 May 2020 20:19:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60446/swift-pairing-for-custom-gatt-service" /><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/249306?ContentTypeID=1</link><pubDate>Mon, 11 May 2020 20:19:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a0ce4df-da00-4a57-a67a-b0efc7afab59</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;If you have included peer manager, then&amp;nbsp;those softdevice calls and events are already handled by the module. You should not add additional handling of those two BLE softdevice events directly in your application code. You may however instead use events from the peer manager to override or change the reply by in&amp;nbsp;pm_evt_handler(), you can find a list of events that come from the peer manager module in peer_manager_types.h:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Types of events that can come from the @ref peer_manager module.
 */
typedef enum
{
    PM_EVT_BONDED_PEER_CONNECTED,           /**&amp;lt; @brief A connected peer has been identified as one with which we have a bond. When performing bonding with a peer for the first time, this event will not be sent until a new connection is established with the peer. When we are central, this event is always sent when the Peer Manager receives the @ref BLE_GAP_EVT_CONNECTED event. When we are peripheral, this event might in rare cases arrive later. */
    PM_EVT_CONN_SEC_START,                  /**&amp;lt; @brief A security procedure has started on a link, initiated either locally or remotely. The security procedure is using the last parameters provided via @ref pm_sec_params_set. This event is always followed by either a @ref PM_EVT_CONN_SEC_SUCCEEDED or a @ref PM_EVT_CONN_SEC_FAILED event. This is an informational event; no action is needed for the procedure to proceed. */
    PM_EVT_CONN_SEC_SUCCEEDED,              /**&amp;lt; @brief A link has been encrypted, either as a result of a call to @ref pm_conn_secure or a result of an action by the peer. The event structure contains more information about the circumstances. This event might contain a peer ID with the value @ref PM_PEER_ID_INVALID, which means that the peer (central) used an address that could not be identified, but it used an encryption key (LTK) that is present in the database. */
    PM_EVT_CONN_SEC_FAILED,                 /**&amp;lt; @brief A pairing or encryption procedure has failed. In some cases, this means that security is not possible on this link (temporarily or permanently). How to handle this error depends on the application. */
    PM_EVT_CONN_SEC_CONFIG_REQ,             /**&amp;lt; @brief The peer (central) has requested pairing, but a bond already exists with that peer. Reply by calling @ref pm_conn_sec_config_reply before the event handler returns. If no reply is sent, a default is used. */
    PM_EVT_CONN_SEC_PARAMS_REQ,             /**&amp;lt; @brief Security parameters (@ref ble_gap_sec_params_t) are needed for an ongoing security procedure. Reply with @ref pm_conn_sec_params_reply before the event handler returns. If no reply is sent, the parameters given in @ref pm_sec_params_set are used. If a peripheral connection, the central&amp;#39;s sec_params will be available in the event. */
    PM_EVT_STORAGE_FULL,                    /**&amp;lt; @brief There is no more room for peer data in flash storage. To solve this problem, delete data that is not needed anymore and run a garbage collection procedure in FDS. */
    PM_EVT_ERROR_UNEXPECTED,                /**&amp;lt; @brief An unrecoverable error happened inside Peer Manager. An operation failed with the provided error. */
    PM_EVT_PEER_DATA_UPDATE_SUCCEEDED,      /**&amp;lt; @brief A piece of peer data was stored, updated, or cleared in flash storage. This event is sent for all successful changes to peer data, also those initiated internally in Peer Manager. To identify an operation, compare the store token in the event with the store token received during the initiating function call. Events from internally initiated changes might have invalid store tokens. */
    PM_EVT_PEER_DATA_UPDATE_FAILED,         /**&amp;lt; @brief A piece of peer data could not be stored, updated, or cleared in flash storage. This event is sent instead of @ref PM_EVT_PEER_DATA_UPDATE_SUCCEEDED for the failed operation. */
    PM_EVT_PEER_DELETE_SUCCEEDED,           /**&amp;lt; @brief A peer was cleared from flash storage, for example because a call to @ref pm_peer_delete succeeded. This event can also be sent as part of a call to @ref pm_peers_delete or internal cleanup. */
    PM_EVT_PEER_DELETE_FAILED,              /**&amp;lt; @brief A peer could not be cleared from flash storage. This event is sent instead of @ref PM_EVT_PEER_DELETE_SUCCEEDED for the failed operation. */
    PM_EVT_PEERS_DELETE_SUCCEEDED,          /**&amp;lt; @brief A call to @ref pm_peers_delete has completed successfully. Flash storage now contains no peer data. */
    PM_EVT_PEERS_DELETE_FAILED,             /**&amp;lt; @brief A call to @ref pm_peers_delete has failed, which means that at least one of the peers could not be deleted. Other peers might have been deleted, or might still be queued to be deleted. No more @ref PM_EVT_PEERS_DELETE_SUCCEEDED or @ref PM_EVT_PEERS_DELETE_FAILED events are sent until the next time @ref pm_peers_delete is called. */
    PM_EVT_LOCAL_DB_CACHE_APPLIED,          /**&amp;lt; @brief Local database values for a peer (taken from flash storage) have been provided to the SoftDevice. */
    PM_EVT_LOCAL_DB_CACHE_APPLY_FAILED,     /**&amp;lt; @brief Local database values for a peer (taken from flash storage) were rejected by the SoftDevice, which means that either the database has changed or the user has manually set the local database to an invalid value (using @ref pm_peer_data_store). */
    PM_EVT_SERVICE_CHANGED_IND_SENT,        /**&amp;lt; @brief A service changed indication has been sent to a peer, as a result of a call to @ref pm_local_database_has_changed. This event will be followed by a @ref PM_EVT_SERVICE_CHANGED_IND_CONFIRMED event if the peer acknowledges the indication. */
    PM_EVT_SERVICE_CHANGED_IND_CONFIRMED,   /**&amp;lt; @brief A service changed indication that was sent has been confirmed by a peer. The peer can now be considered aware that the local database has changed. */
    PM_EVT_SLAVE_SECURITY_REQ,              /**&amp;lt; @brief The peer (peripheral) has requested link encryption, which has been enabled. */
    PM_EVT_FLASH_GARBAGE_COLLECTED,         /**&amp;lt; @brief The flash has been garbage collected (By FDS), possibly freeing up space. */
    PM_EVT_FLASH_GARBAGE_COLLECTION_FAILED, /**&amp;lt; @brief Garbage collection was attempted but failed. */
} pm_evt_id_t;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/248835?ContentTypeID=1</link><pubDate>Fri, 08 May 2020 01:01:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:363ddc0a-3bb4-47f2-b3b6-2634135e38ee</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;This workaround only works for Windows, not Android&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
    // Pairing not supported
    err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_SUCCESS, NULL, NULL);
    APP_ERROR_CHECK(err_code);
    break;
case BLE_GATTS_EVT_SYS_ATTR_MISSING:
    // No system attributes have been stored.
    err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
    APP_ERROR_CHECK(err_code);
    break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;OR&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
    // Pairing not supported
    err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
    APP_ERROR_CHECK(err_code);
    break;
case BLE_GATTS_EVT_SYS_ATTR_MISSING:
    // No system attributes have been stored.
    err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
    APP_ERROR_CHECK(err_code);
    break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But on Android, I get an error &amp;#39;&lt;span&gt;incorrect pin or passkey&amp;#39;, how do I overcome that?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/248348?ContentTypeID=1</link><pubDate>Wed, 06 May 2020 07:53:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b40fc977-42a1-4cb7-bca6-3a1e3e63759b</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Sorry, you are right. I was looking at an old SDK.&lt;/p&gt;
&lt;p&gt;My suggestion now is to take a look at the&amp;nbsp;\examples\ble_peripheral\ble_app_hids_keyboard or &lt;span&gt;ble_hid_mouse&lt;/span&gt;, replace all the parameters and callbacks from that project to your project. Double check that you have not by accident modified any of the SDK libraries for instance to test something&amp;nbsp;earlier.&lt;/p&gt;
&lt;p&gt;You will notice that the&amp;nbsp;\examples\ble_peripheral\ble_app_hids_keyboard or &lt;span&gt;ble_hid_mouse&amp;nbsp;&lt;/span&gt;will not send the &amp;quot;S&lt;span&gt;ecurity Request: AuthReq: Bonding&amp;quot;. If you are not able to find the problem, then only way forward would be to share a project that can be unzipped to the&amp;nbsp;examples\ble_peripheral and run an nRF52-DK to test here.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/248308?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 20:00:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eded6c31-b2d2-415a-8b5e-d587b0cd38f8</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;I tried adding all these functions, seems like they have been deprecated in SDK 16 according to few tickets and the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/migration.html"&gt;Migration doc&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m getting these errors in my Keil project.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1588708726849v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/248078?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 08:01:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63e989b3-258c-4c44-a7af-1c6592fc40c0</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Edit: Removed this reply since it was invalid for new SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/248073?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 07:48:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94c2df6e-5dc7-4223-b1ee-0f58c7e62059</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Ahh I see, do you need the code snippets for&amp;nbsp;&lt;span&gt;peer_manager_init(),&amp;nbsp;sys_evt_dispatch() and&amp;nbsp;pm_evt_handler() or do you need the location where these are being called?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void peer_manager_init()
{
    ble_gap_sec_params_t sec_param;
    ret_code_t           err_code;
    err_code = pm_init();
    APP_ERROR_CHECK(err_code);
    memset(&amp;amp;sec_param, 0, sizeof(ble_gap_sec_params_t));
    // Security parameters to be used for all security procedures.
    sec_param.bond           = SEC_PARAM_BOND;
    sec_param.mitm           = SEC_PARAM_MITM;
    sec_param.lesc           = SEC_PARAM_LESC;
    sec_param.keypress       = SEC_PARAM_KEYPRESS;
    sec_param.io_caps        = SEC_PARAM_IO_CAPABILITIES;
    sec_param.oob            = SEC_PARAM_OOB;
    sec_param.min_key_size   = SEC_PARAM_MIN_KEY_SIZE;
    sec_param.max_key_size   = SEC_PARAM_MAX_KEY_SIZE;
    sec_param.kdist_own.enc  = 1;
    sec_param.kdist_own.id   = 1;
    sec_param.kdist_peer.enc = 1;
    sec_param.kdist_peer.id  = 1;
    err_code = pm_sec_params_set(&amp;amp;sec_param);
    APP_ERROR_CHECK(err_code);
    err_code = pm_register(pm_evt_handler);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define SEC_PARAM_BOND                  1                              /**&amp;lt; Perform bonding. */
#define SEC_PARAM_MITM                  0                                           /**&amp;lt; Man In The Middle protection not required. */
#define SEC_PARAM_LESC                  0                                           /**&amp;lt; LE Secure Connections not enabled. */
#define SEC_PARAM_KEYPRESS              0                                           /**&amp;lt; Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES       BLE_GAP_IO_CAPS_NONE                        /**&amp;lt; No I/O capabilities. */
#define SEC_PARAM_OOB                   0                                           /**&amp;lt; Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE          7                                           /**&amp;lt; Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE          16                                          /**&amp;lt; Maximum encryption key size. */&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I couldnt find&amp;nbsp;sys_evt_dispatch() in my project.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void pm_evt_handler(pm_evt_t const * p_evt)
{
	ret_code_t err_code;
    pm_handler_on_pm_evt(p_evt);
    pm_handler_flash_clean(p_evt);
	/*not included*/
	switch (p_evt-&amp;gt;evt_id)
    {
		case PM_EVT_BONDED_PEER_CONNECTED:
        {
            NRF_LOG_INFO(&amp;quot;PM_EVT_BONDED_PEER_CONNECTED - Connected to a previously bonded device.&amp;quot;);
        } break;
		case PM_EVT_CONN_SEC_START:
			NRF_LOG_INFO(&amp;quot;PM_EVT_CONN_SEC_START&amp;quot;);
		break;
		case PM_EVT_CONN_SEC_SUCCEEDED:
        {
            NRF_LOG_INFO(&amp;quot;PM_EVT_CONN_SEC_SUCCEEDED - Connection secured: role: %d, conn_handle: 0x%x, procedure: %d.&amp;quot;, ble_conn_state_role(p_evt-&amp;gt;conn_handle),
                         p_evt-&amp;gt;conn_handle, p_evt-&amp;gt;params.conn_sec_succeeded.procedure);
        } break;
		case PM_EVT_CONN_SEC_FAILED:
        {
			NRF_LOG_INFO(&amp;quot;PM_EVT_CONN_SEC_FAILED&amp;quot;);
            /* Often, when securing fails, it shouldn&amp;#39;t be restarted, for security reasons. Other times, it can be restarted directly.
             * Sometimes it can be restarted, but only after changing some Security Parameters. Sometimes, it cannot be restarted until the link is disconnected and reconnected.
             * Sometimes it is impossible, to secure the link, or the peer device does not support it. How to handle this error is highly application dependent. */
        } break;
		case PM_EVT_CONN_SEC_CONFIG_REQ:
        {
			NRF_LOG_INFO(&amp;quot;PM_EVT_CONN_SEC_CONFIG_REQ&amp;quot;);
            // Reject pairing request from an already bonded peer.
            pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
            pm_conn_sec_config_reply(p_evt-&amp;gt;conn_handle, &amp;amp;conn_sec_config);
        } break;
		case PM_EVT_CONN_SEC_PARAMS_REQ:
			NRF_LOG_INFO(&amp;quot;PM_EVT_CONN_SEC_PARAMS_REQ&amp;quot;);
		break;
		case PM_EVT_STORAGE_FULL:
        {
			NRF_LOG_INFO(&amp;quot;PM_EVT_STORAGE_FULL&amp;quot;);
            // Run garbage collection on the flash.
            err_code = fds_gc();
            if (err_code == FDS_ERR_NO_SPACE_IN_QUEUES)
            {
                // Retry.
            }
            else
            {
                APP_ERROR_CHECK(err_code);
            }
        } break;
		case PM_EVT_ERROR_UNEXPECTED:
        {
			NRF_LOG_INFO(&amp;quot;PM_EVT_ERROR_UNEXPECTED&amp;quot;);
            // Assert.
            APP_ERROR_CHECK(p_evt-&amp;gt;params.error_unexpected.error);
        } break;
		case PM_EVT_PEER_DATA_UPDATE_SUCCEEDED:
			NRF_LOG_INFO(&amp;quot;PM_EVT_PEER_DATA_UPDATE_SUCCEEDED&amp;quot;);
			if (p_evt-&amp;gt;params.peer_data_update_succeeded.flash_changed &amp;amp;&amp;amp; (p_evt-&amp;gt;params.peer_data_update_succeeded.data_id == PM_PEER_DATA_ID_BONDING))
            {
                NRF_LOG_INFO(&amp;quot;New Bond, add the peer to the whitelist if possible&amp;quot;);
				// Note: You should check on what kind of white list policy your application should use.
                whitelist_set(PM_PEER_ID_LIST_SKIP_NO_ID_ADDR);	/*For Quest*/
            }
        break;
		case PM_EVT_PEER_DATA_UPDATE_FAILED:
        {
			NRF_LOG_INFO(&amp;quot;PM_EVT_PEER_DATA_UPDATE_FAILED&amp;quot;);
            // Assert.
            APP_ERROR_CHECK(p_evt-&amp;gt;params.peer_data_update_failed.error);
        } break;		
		case PM_EVT_PEER_DELETE_SUCCEEDED:
			NRF_LOG_INFO(&amp;quot;PM_EVT_PEER_DELETE_SUCCEEDED&amp;quot;);
		break;
        case PM_EVT_PEERS_DELETE_SUCCEEDED:
			NRF_LOG_INFO(&amp;quot;PM_EVT_PEERS_DELETE_SUCCEEDED&amp;quot;);
            advertising_start(false);
        break;		
		case PM_EVT_PEER_DELETE_FAILED:
        {
			NRF_LOG_INFO(&amp;quot;PM_EVT_PEER_DELETE_FAILED&amp;quot;);
            // Assert.
            APP_ERROR_CHECK(p_evt-&amp;gt;params.peer_delete_failed.error);
        } break;
		case PM_EVT_PEERS_DELETE_FAILED:
        {
			NRF_LOG_INFO(&amp;quot;PM_EVT_PEERS_DELETE_FAILED&amp;quot;);
            // Assert.
            APP_ERROR_CHECK(p_evt-&amp;gt;params.peers_delete_failed_evt.error);
        } break;
        case PM_EVT_LOCAL_DB_CACHE_APPLIED:
			NRF_LOG_INFO(&amp;quot;PM_EVT_LOCAL_DB_CACHE_APPLIED&amp;quot;);
		break;
        case PM_EVT_LOCAL_DB_CACHE_APPLY_FAILED:
			NRF_LOG_INFO(&amp;quot;PM_EVT_LOCAL_DB_CACHE_APPLY_FAILED&amp;quot;);
		break;
            // This can happen when the local DB has changed.
        case PM_EVT_SERVICE_CHANGED_IND_SENT:
			NRF_LOG_INFO(&amp;quot;PM_EVT_SERVICE_CHANGED_IND_SENT&amp;quot;);
		break;
        case PM_EVT_SERVICE_CHANGED_IND_CONFIRMED:
			NRF_LOG_INFO(&amp;quot;PM_EVT_SERVICE_CHANGED_IND_CONFIRMED&amp;quot;);
		break;
		case PM_EVT_SLAVE_SECURITY_REQ:
			NRF_LOG_INFO(&amp;quot;PM_EVT_SLAVE_SECURITY_REQ&amp;quot;);
		break;
		case PM_EVT_FLASH_GARBAGE_COLLECTED:
			NRF_LOG_INFO(&amp;quot;PM_EVT_FLASH_GARBAGE_COLLECTED&amp;quot;);
		break;
		case PM_EVT_FLASH_GARBAGE_COLLECTION_FAILED:
			NRF_LOG_INFO(&amp;quot;PM_EVT_FLASH_GARBAGE_COLLECTION_FAILED&amp;quot;);
		break;
        default:
            break;
	}
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;FDS defines -&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;e&amp;gt; FDS_ENABLED - fds - Flash data storage module
//==========================================================
#ifndef FDS_ENABLED
#define FDS_ENABLED 1
#endif
// &amp;lt;h&amp;gt; Pages - Virtual page settings

// &amp;lt;i&amp;gt; Configure the number of virtual pages to use and their size.
//==========================================================
// &amp;lt;o&amp;gt; FDS_VIRTUAL_PAGES - Number of virtual flash pages to use. 
// &amp;lt;i&amp;gt; One of the virtual pages is reserved by the system for garbage collection.
// &amp;lt;i&amp;gt; Therefore, the minimum is two virtual pages: one page to store data and one page to be used by the system for garbage collection.
// &amp;lt;i&amp;gt; The total amount of flash memory that is used by FDS amounts to @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes.

#ifndef FDS_VIRTUAL_PAGES
#define FDS_VIRTUAL_PAGES 3
#endif

// &amp;lt;o&amp;gt; FDS_VIRTUAL_PAGE_SIZE  - The size of a virtual flash page.
 

// &amp;lt;i&amp;gt; Expressed in number of 4-byte words.
// &amp;lt;i&amp;gt; By default, a virtual page is the same size as a physical page.
// &amp;lt;i&amp;gt; The size of a virtual page must be a multiple of the size of a physical page.
// &amp;lt;1024=&amp;gt; 1024 
// &amp;lt;2048=&amp;gt; 2048 

#ifndef FDS_VIRTUAL_PAGE_SIZE
#define FDS_VIRTUAL_PAGE_SIZE 1024
#endif

// &amp;lt;o&amp;gt; FDS_VIRTUAL_PAGES_RESERVED - The number of virtual flash pages that are used by other modules. 
// &amp;lt;i&amp;gt; FDS module stores its data in the last pages of the flash memory.
// &amp;lt;i&amp;gt; By setting this value, you can move flash end address used by the FDS.
// &amp;lt;i&amp;gt; As a result the reserved space can be used by other modules.

#ifndef FDS_VIRTUAL_PAGES_RESERVED
#define FDS_VIRTUAL_PAGES_RESERVED 0
#endif

// &amp;lt;/h&amp;gt; 
//==========================================================

// &amp;lt;h&amp;gt; Backend - Backend configuration

// &amp;lt;i&amp;gt; Configure which nrf_fstorage backend is used by FDS to write to flash.
//==========================================================
// &amp;lt;o&amp;gt; FDS_BACKEND  - FDS flash backend.
 

// &amp;lt;i&amp;gt; NRF_FSTORAGE_SD uses the nrf_fstorage_sd backend implementation using the SoftDevice API. Use this if you have a SoftDevice present.
// &amp;lt;i&amp;gt; NRF_FSTORAGE_NVMC uses the nrf_fstorage_nvmc implementation. Use this setting if you don&amp;#39;t use the SoftDevice.
// &amp;lt;1=&amp;gt; NRF_FSTORAGE_NVMC 
// &amp;lt;2=&amp;gt; NRF_FSTORAGE_SD 

#ifndef FDS_BACKEND
#define FDS_BACKEND 2
#endif

// &amp;lt;/h&amp;gt; 
//==========================================================

// &amp;lt;h&amp;gt; Queue - Queue settings

//==========================================================
// &amp;lt;o&amp;gt; FDS_OP_QUEUE_SIZE - Size of the internal queue. 
// &amp;lt;i&amp;gt; Increase this value if you frequently get synchronous FDS_ERR_NO_SPACE_IN_QUEUES errors.

#ifndef FDS_OP_QUEUE_SIZE
#define FDS_OP_QUEUE_SIZE 4
#endif

// &amp;lt;/h&amp;gt; 
//==========================================================

// &amp;lt;h&amp;gt; CRC - CRC functionality

//==========================================================
// &amp;lt;e&amp;gt; FDS_CRC_CHECK_ON_READ - Enable CRC checks.

// &amp;lt;i&amp;gt; Save a record&amp;#39;s CRC when it is written to flash and check it when the record is opened.
// &amp;lt;i&amp;gt; Records with an incorrect CRC can still be &amp;#39;seen&amp;#39; by the user using FDS functions, but they cannot be opened.
// &amp;lt;i&amp;gt; Additionally, they will not be garbage collected until they are deleted.
//==========================================================
#ifndef FDS_CRC_CHECK_ON_READ
#define FDS_CRC_CHECK_ON_READ 0
#endif
// &amp;lt;o&amp;gt; FDS_CRC_CHECK_ON_WRITE  - Perform a CRC check on newly written records.
 

// &amp;lt;i&amp;gt; Perform a CRC check on newly written records.
// &amp;lt;i&amp;gt; This setting can be used to make sure that the record data was not altered while being written to flash.
// &amp;lt;1=&amp;gt; Enabled 
// &amp;lt;0=&amp;gt; Disabled 

#ifndef FDS_CRC_CHECK_ON_WRITE
#define FDS_CRC_CHECK_ON_WRITE 0
#endif

// &amp;lt;/e&amp;gt;

// &amp;lt;/h&amp;gt; 
//==========================================================

// &amp;lt;h&amp;gt; Users - Number of users

//==========================================================
// &amp;lt;o&amp;gt; FDS_MAX_USERS - Maximum number of callbacks that can be registered. 
#ifndef FDS_MAX_USERS
#define FDS_MAX_USERS 4
#endif&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;FSTORAGE defines -&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;e&amp;gt; NRF_FSTORAGE_ENABLED - nrf_fstorage - Flash abstraction library
//==========================================================
#ifndef NRF_FSTORAGE_ENABLED
#define NRF_FSTORAGE_ENABLED 1
#endif
// &amp;lt;h&amp;gt; nrf_fstorage - Common settings

// &amp;lt;i&amp;gt; Common settings to all fstorage implementations
//==========================================================
// &amp;lt;q&amp;gt; NRF_FSTORAGE_PARAM_CHECK_DISABLED  - Disable user input validation
 

// &amp;lt;i&amp;gt; If selected, use ASSERT to validate user input.
// &amp;lt;i&amp;gt; This effectively removes user input validation in production code.
// &amp;lt;i&amp;gt; Recommended setting: OFF, only enable this setting if size is a major concern.

#ifndef NRF_FSTORAGE_PARAM_CHECK_DISABLED
#define NRF_FSTORAGE_PARAM_CHECK_DISABLED 0
#endif

// &amp;lt;/h&amp;gt; 
//==========================================================

// &amp;lt;h&amp;gt; nrf_fstorage_sd - Implementation using the SoftDevice

// &amp;lt;i&amp;gt; Configuration options for the fstorage implementation using the SoftDevice
//==========================================================
// &amp;lt;o&amp;gt; NRF_FSTORAGE_SD_QUEUE_SIZE - Size of the internal queue of operations 
// &amp;lt;i&amp;gt; Increase this value if API calls frequently return the error @ref NRF_ERROR_NO_MEM.

#ifndef NRF_FSTORAGE_SD_QUEUE_SIZE
#define NRF_FSTORAGE_SD_QUEUE_SIZE 4
#endif

// &amp;lt;o&amp;gt; NRF_FSTORAGE_SD_MAX_RETRIES - Maximum number of attempts at executing an operation when the SoftDevice is busy 
// &amp;lt;i&amp;gt; Increase this value if events frequently return the @ref NRF_ERROR_TIMEOUT error.
// &amp;lt;i&amp;gt; The SoftDevice might fail to schedule flash access due to high BLE activity.

#ifndef NRF_FSTORAGE_SD_MAX_RETRIES
#define NRF_FSTORAGE_SD_MAX_RETRIES 8
#endif

// &amp;lt;o&amp;gt; NRF_FSTORAGE_SD_MAX_WRITE_SIZE - Maximum number of bytes to be written to flash in a single operation 
// &amp;lt;i&amp;gt; This value must be a multiple of four.
// &amp;lt;i&amp;gt; Lowering this value can increase the chances of the SoftDevice being able to execute flash operations in between radio activity.
// &amp;lt;i&amp;gt; This value is bound by the maximum number of bytes that can be written to flash in a single call to @ref sd_flash_write.
// &amp;lt;i&amp;gt; That is 1024 bytes for nRF51 ICs and 4096 bytes for nRF52 ICs.

#ifndef NRF_FSTORAGE_SD_MAX_WRITE_SIZE
#define NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096
#endif&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;pm_conn_secure() is not called in main.c&lt;/p&gt;
&lt;p&gt;I never use the delete_bonds() function &amp;amp; I also dont use BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/248069?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 07:36:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e8a4a0c-5b4a-4c38-9ef6-47447ecf3d10</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I think the main problem here is that the slave seem to always send a &amp;quot;Security Request: AuthReq: Bonding&amp;quot;, which should not be necessary, since the link is already encrypted or in the process of being encrypted. I think that is what is causing the master to misbehave by sending a LL_PING_RSP later.&lt;/p&gt;
&lt;p&gt;If you open any of the other SDK examples as-is that support bonding, you will see that it is not sending a &amp;quot;&lt;span&gt;Security Request: AuthReq: Bonding&lt;/span&gt;&amp;quot;. So we need to try to find out what is causing this in your application.&lt;/p&gt;
&lt;p&gt;Can you provide&amp;nbsp;the source for&amp;nbsp;peer_manager_init(),&amp;nbsp;sys_evt_dispatch(),&amp;nbsp;ble_evt_dispatch(),&amp;nbsp; and&amp;nbsp;pm_evt_handler()?&lt;/p&gt;
&lt;p&gt;Is it possible that you are deleting bonds here somewhere?&lt;/p&gt;
&lt;p&gt;*maybe check this first* Is it possible you are calling&amp;nbsp;pm_conn_secure() somewhere?&lt;/p&gt;
&lt;p&gt;Can you provide your defines of&amp;nbsp;FDS*/FSTORAGE* in sdk_config.h?&lt;/p&gt;
&lt;p&gt;What security level have you set for your various characteristics and services? For instance have you set&amp;nbsp;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM() or other? See ble_gap.h for a list of available BLE_GAP_CONN_SEC_MODE_SET_MACROS.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/248026?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 20:27:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4d4c626-d39b-4b38-9cd0-71474f7ff24a</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;Answers to your questions -&lt;/p&gt;
&lt;p&gt;I did not make any changes to peer_manager_handler.c.&lt;/p&gt;
&lt;p&gt;PM_HANDLER_SEC_DELAY_MS is set to 0 in sdk_config.h&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using S132 from SDK16.0, dont know the version though.&lt;/p&gt;
&lt;p&gt;Security procedure is not initiated manually.&lt;/p&gt;
&lt;p&gt;Here are the new logs-&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.dropbox.com/s/nyj104bcryw8cg4/log_4th_may.pcapng?dl=0"&gt;https://www.dropbox.com/s/nyj104bcryw8cg4/log_4th_may.pcapng?dl=0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.dropbox.com/s/jlq7o3u5ei37t6r/rtt_log_4th_may.txt?dl=0"&gt;https://www.dropbox.com/s/jlq7o3u5ei37t6r/rtt_log_4th_may.txt?dl=0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The sniffer trace looks different. I think you are right about LL_PING_RSP.&lt;/p&gt;
&lt;p&gt;My Windows Specifications-&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1588623994017v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;amp; now I have updated to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1588624892705v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Logs after updating -&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.dropbox.com/s/suasjwkssatsqkt/log_after_update.pcapng?dl=0"&gt;https://www.dropbox.com/s/suasjwkssatsqkt/log_after_update.pcapng?dl=0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.dropbox.com/s/yx0opw4vu4guvh7/rt_log_after_update.txt?dl=0"&gt;https://www.dropbox.com/s/yx0opw4vu4guvh7/rt_log_after_update.txt?dl=0&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/247959?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 15:13:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0bdf2ac-171f-4181-ad14-dc8061e20967</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Have you done any changes to peer_manager_handler.c or the modules it is using? I don&amp;#39;t expect you have, but ask anyways.&lt;/p&gt;
&lt;p&gt;Have you set&amp;nbsp;PM_HANDLER_SEC_DELAY_MS to anything beside 0?&lt;/p&gt;
&lt;p&gt;Can you confirm you are using S132v6.1.1?&lt;/p&gt;
&lt;p&gt;Are you somehow initiating security procedure on connected event manually by for instance calling&amp;nbsp;pm_handler_secure_on_connection() in your application?&lt;/p&gt;
&lt;p&gt;From the log of &amp;quot;with_delay_and_4_lines.pcapng&amp;quot; I can see that the LL_LENGTH_REQ is sent from the peripheral after ~20ms.&amp;nbsp;This means that the 100ms delay was not run, so I suggest to add the 100ms delay in the start of&amp;nbsp;on_connected_evt(), e.g.:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void on_connected_evt(nrf_ble_gatt_t * p_gatt, ble_evt_t const * p_ble_evt)
{
nrf_delay_ms(100); // Place it in the start of function, #include &amp;quot;nrf_delay.h&amp;quot;
…
…
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I assume the real problem here is the LL_PING_RSP that is always sent from the master without any preceding LL_PING_REQ. What details can you provide about the&amp;nbsp;Windows 10 version you are using?&amp;nbsp;&lt;a href="https://en.wikipedia.org/wiki/Template:Windows_10_versions"&gt;https://en.wikipedia.org/wiki/Template:Windows_10_versions&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried updating Windows 10 to the latest version? Are all BT drivers updated?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/247413?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 18:12:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d57c0192-a529-4259-9f88-93759b6371bd</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Now it takes more than a minute to connect.&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61e.svg" title="Disappointed"&gt;&amp;#x1f61e;&lt;/span&gt;&amp;nbsp;Behavior is still the same..&lt;/p&gt;
&lt;p&gt;Here are the logs -&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Added delay along with the above 4 lines&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/with_5F00_delay_5F00_and_5F00_4_5F00_lines.pcapng"&gt;devzone.nordicsemi.com/.../with_5F00_delay_5F00_and_5F00_4_5F00_lines.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/RTT_5F00_with_5F00_delay_5F00_and_5F00_4_5F00_lines.txt"&gt;devzone.nordicsemi.com/.../RTT_5F00_with_5F00_delay_5F00_and_5F00_4_5F00_lines.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;&lt;span&gt;Added delay only&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/with_5F00_delay.pcapng"&gt;devzone.nordicsemi.com/.../with_5F00_delay.pcapng&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/RTT_5F00_with_5F00_delay.txt"&gt;devzone.nordicsemi.com/.../RTT_5F00_with_5F00_delay.txt&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In both cases, the peripheral connects to Windows OS but it takes more than a minute.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I also tried increasing/decreasing the time in these 2 lines, but no luck&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;opt.gap_opt.auth_payload_timeout.auth_payload_timeout = 3000;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_delay_ms(100);&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/247222?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 07:24:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:549f6b02-2be4-4037-bc06-7457b5d7f729</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Can you try adding a small delay in nrf_ble_gatt.c as shown below? This is supposed to avoid an LMP_RESPONSE_TIMEOUT, which your issue might be a variant of.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void on_connected_evt(nrf_ble_gatt_t * p_gatt, ble_evt_t const * p_ble_evt)

{

…

        nrf_delay_ms(100); // #include &amp;quot;nrf_delay.h&amp;quot;

        err_code = sd_ble_gattc_exchange_mtu_request(conn_handle, p_link-&amp;gt;att_mtu_desired);

…

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/247161?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2020 17:40:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3b2d51a-0ba8-41f0-bd17-f8151832d4fc</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Yes Simonr, I added all the above 4 lines &amp;amp; I attached the corresponding logs in my previous&amp;nbsp;reply.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case BLE_GAP_EVT_CONNECTED:
			NRF_LOG_DEBUG(&amp;quot;Connected.&amp;quot;);
            m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
            APP_ERROR_CHECK(err_code);
			
			opt.gap_opt.auth_payload_timeout.conn_handle = m_conn_handle;
			opt.gap_opt.auth_payload_timeout.auth_payload_timeout = 3000;
			err_code = sd_ble_opt_set(BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT, &amp;amp;opt);
			APP_ERROR_CHECK(err_code);		
		
			connection_tx_power_set();	/* +4dB Radio Setting */
			/*SET CONN PIN HIGH AFTER BLUETOOTH CONNECTION*/
			nrf_gpio_pin_set(0);  
			/*AFTER BLUETOOTH CONNECTION, SET THE FLAG HIGH*/
			ble_connected = true;
			NRF_LOG_DEBUG(&amp;quot;Connected to %x:%x:%x:%x:%x:%x\r\n&amp;quot;, p_ble_evt-&amp;gt;evt.gap_evt.params.connected.peer_addr.addr[0]);
			/*Testing*/
			// only trigger event if more than 3 rssi samples have deviated from the last reported rssi by 10db or more
     		// sd_ble_gap_rssi_start(uint16_t conn_handle, uint8_t threshold_dbm, uint8_t skip_count))
			sd_ble_gap_rssi_start(m_conn_handle, 10, 3);	/*rssi*/ //Print RSSI every time it changes with more than 10dB
            break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But that did not solve the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/247089?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2020 12:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e66077ff-9251-4e0b-8f4f-d8c0d776c407</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Sonal&lt;/p&gt;
&lt;p&gt;You added the lines suggested in your ble_evt_handler function, correct?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The disconnect reason is still the same (0x2A) and is defined by the spec. as: &amp;quot;The Different Transaction&amp;nbsp;&lt;span&gt;Collision error code indicates that an LMP transaction or LL Procedure was started that collides with an ongoing transaction&amp;quot;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please also try calling&amp;nbsp;sd_ble_opt_set(BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT, &amp;amp;opt); to trigger a LL_PING_REQ from the peripheral side.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/246942?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 21:10:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:267f7e00-c2b8-4a35-894b-ae1e63d7e2e2</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;I&amp;#39;m using SDK 16.0. I had tried the above solution by referring to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50982/disconnect-after-a-while-using-nrf52840-sdk-v15-2-0-s140-v6-1-1-and-nokia-5-phone"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/50982/disconnect-after-a-while-using-nrf52840-sdk-v15-2-0-s140-v6-1-1-and-nokia-5-phone&lt;/a&gt;, but the behavior is still the same.&lt;/p&gt;
&lt;p&gt;If it helps, I captured logs again after adding the above 4 lines to the code.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/new_5F00_rtt_5F00_log.txt"&gt;devzone.nordicsemi.com/.../new_5F00_rtt_5F00_log.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/new_5F00_log.pcapng"&gt;devzone.nordicsemi.com/.../new_5F00_log.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You already have the previous log files.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/246685?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 07:28:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ec78499-9e1c-4c37-ac3e-84022a8bda0f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What SDK and SoftDevice version are you using? In some devices, two consecutive LL_PING_REQ without waiting for PING_RSP, this violates the BLE spec and causes this transaction collision. A workaround for this should be implemented in SoftDevice versions 5.x.x and later, but you can see the workaround below.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c738181b9ac94b448291b8a176f894b9/pastedimage1587972415383v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If this is not the same error, I think we&amp;#39;ll need to see a sniffer trace in order to see what exactly causes this error.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/246377?ContentTypeID=1</link><pubDate>Fri, 24 Apr 2020 02:14:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eee10d3a-296b-4d4c-8df6-1d77a037939b</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;I got&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1587694415808v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;which I&amp;#39;m assuming is&amp;nbsp;&lt;span&gt;BLE_HCI_DIFFERENT_TRANSACTION_COLLISION.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there a workaround for this?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/246163?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2020 07:45:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5239cb0-48dd-47e2-a78c-41be1b17a76d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You can try adding the delete_bonds() function to the disconnect event of your application. Looking at the sniffer trace, it seems like your device tries to connect multiple times before it succeeds. Please check the connected and disconnected reasons (BLE_GAP_EVT_DISCONNECTED) as these seem to not be included in your RTT log.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/245902?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 17:31:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0478526c-f164-425b-a2c6-5f2d88f7eab1</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;If I manually pair, the swift pairing feature gets activated &amp;amp; it bricks the device.&lt;/p&gt;
&lt;p&gt;So now after adding the swift pairing feature the code looks like -&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define SWIFT_PAIR_SUPPORTED            1                                           /**&amp;lt; Swift Pair feature is supported. */
#if SWIFT_PAIR_SUPPORTED == 1
#define MICROSOFT_VENDOR_ID             0x0006                                      /**&amp;lt; Microsoft Vendor ID.*/
#define MICROSOFT_BEACON_ID             0x03                                        /**&amp;lt; Microsoft Beacon ID, used to indicate that Swift Pair feature is supported. */
#define MICROSOFT_BEACON_SUB_SCENARIO   0x00                                        /**&amp;lt; Microsoft Beacon Sub Scenario, used to indicate how the peripheral will pair using Swift Pair feature. */
#define RESERVED_RSSI_BYTE              0x80                                        /**&amp;lt; Reserved RSSI byte, used to maintain forwards and backwards compatibility. */
static uint8_t m_sp_payload[] =                                                     /**&amp;lt; Payload of advertising data structure for Microsoft Swift Pair feature. */
{
    MICROSOFT_BEACON_ID,
    MICROSOFT_BEACON_SUB_SCENARIO,
    RESERVED_RSSI_BYTE
};
static ble_advdata_manuf_data_t m_sp_manuf_advdata =                                /**&amp;lt; Advertising data structure for Microsoft Swift Pair feature. */
{
    .company_identifier = MICROSOFT_VENDOR_ID,
    .data               =
    {
        .size   = sizeof(m_sp_payload),
        .p_data = &amp;amp;m_sp_payload[0]
    }
};
static ble_advdata_t m_sp_advdata;
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void advertising_init(void)
{
    uint32_t               err_code;
    memset(&amp;amp;init, 0, sizeof(init));
    init.advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance      = true;
    init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
	init.advdata.uuids_complete.uuid_cnt = 0;

	init.config.ble_adv_whitelist_enabled          = false;
	init.srdata.name_type               = BLE_ADVDATA_NO_NAME;
	init.srdata.uuids_complete.uuid_cnt = 1;
	init.srdata.uuids_complete.p_uuids  = &amp;amp;m_adv_uuids[0];
	init.srdata.uuids_more_available.uuid_cnt = 1;
	init.srdata.uuids_more_available.p_uuids = &amp;amp;m_adv_uuids[1];
	/*BEBOP - Swift Pairing*/
	#if SWIFT_PAIR_SUPPORTED == 1
		init.srdata.p_manuf_specific_data = &amp;amp;m_sp_manuf_advdata;
	#endif
	init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;
	init.config.ble_adv_extended_enabled = true;
	init.config.ble_adv_on_disconnect_disabled = false;
	
    advertising_config_get(&amp;amp;init.config);
    init.evt_handler = on_adv_evt;
    err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init);
    APP_ERROR_CHECK(err_code);
    ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);
	advertising_tx_power_set();	/* +4dB Radio Setting */
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;For this code, the ble connection takes 1 minute. I already attached the sniffer &amp;amp; rtt logs above.&lt;/p&gt;
&lt;p&gt;Is this because the firmware is not deleting the bond?&amp;nbsp;Does it need any modifications to the code?&lt;/p&gt;
&lt;p&gt;I have called the delete_bonds() function at the same location as your example codes.&lt;/p&gt;
&lt;p&gt;My code also has-&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
            pm_conn_sec_config_reply(p_evt-&amp;gt;conn_handle, &amp;amp;conn_sec_config);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swift Pairing for custom gatt service</title><link>https://devzone.nordicsemi.com/thread/245837?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 12:47:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:daf7292e-06d4-4755-9622-eabdab9b9b02</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;One minute to connect and pair seems very long. I assume what is happening when your device is bricked, is that only Windows deletes the bonding information, and the data is still stored in the nRF device, which will cause it to not be able to pair with another device. You should be able to set the device to delete bonding information upon disconnection so that you won&amp;#39;t have the issue with the device being bricked.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you try to explain a bit further on what your issue with swift pairing is, as I&amp;#39;m struggling to see what you mean and what you want to achieve? Please check out &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/42062/windows-swift-pairing/163802#163802"&gt;this thread&lt;/a&gt; to make sure you&amp;#39;ve implemented Swift pairing correctly.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>