<?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>GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82473/gatt-conn-terminate-local-host-occurs-when-bonding-with-android</link><description>Hello. 
 I am developing using nrf52832 (S132 v7.0.1, SDK v17.0.0). 
 Since I want to bond with Android, I have created a central code that summarizes the functions that I think are necessary by referring to various sample sources. On Android, a pairing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Jan 2022 07:55:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82473/gatt-conn-terminate-local-host-occurs-when-bonding-with-android" /><item><title>RE: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/347923?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 07:55:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e33b1b7-32ba-4f0a-9f7d-2f98ad7aa79a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Not as far as I can tell in terms of enabling bonding at least. I assume you have added functions like ble_stack_init, scan_init, and so on.&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: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/347862?ContentTypeID=1</link><pubDate>Sat, 15 Jan 2022 08:13:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b6307a7-381b-4825-9569-08f2f457da43</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;I have included the peer manager and pm_evt_handler () in my project with the code settings below. Is there anything else I need?&lt;/p&gt;
&lt;p&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            1                                /**&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. */

static void peer_manager_init(void)
{
    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));

    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);

    return;
}

static void pm_evt_handler(pm_evt_t const * p_evt)
{
    pm_conn_sec_config_t conn_sec_config;

    pm_handler_on_pm_evt(p_evt);
    pm_handler_flash_clean(p_evt);

    switch (p_evt-&amp;gt;evt_id) {
        case PM_EVT_BONDED_PEER_CONNECTED:
            break;

        case PM_EVT_CONN_SEC_START:
            break;

        case PM_EVT_CONN_SEC_SUCCEEDED:
            break;

        case PM_EVT_CONN_SEC_FAILED:
            break;

        case PM_EVT_CONN_SEC_CONFIG_REQ:
            // Even true didn&amp;#39;t make sense.
            conn_sec_config.allow_repairing = false;
            pm_conn_sec_config_reply(p_evt-&amp;gt;conn_handle, &amp;amp;conn_sec_config);
            break;

        case PM_EVT_CONN_SEC_PARAMS_REQ:
            break;

        case PM_EVT_STORAGE_FULL:
            break;

        case PM_EVT_ERROR_UNEXPECTED:
            break;

        case PM_EVT_PEER_DATA_UPDATE_SUCCEEDED:
            break;

        case PM_EVT_PEER_DATA_UPDATE_FAILED:
            break;

        case PM_EVT_PEER_DELETE_SUCCEEDED:
            break;

        case PM_EVT_PEER_DELETE_FAILED:
            break;
            
        case PM_EVT_PEERS_DELETE_SUCCEEDED:
            break;

        case PM_EVT_PEERS_DELETE_FAILED:
            break;

        case PM_EVT_LOCAL_DB_CACHE_APPLIED:
            break;

        case PM_EVT_LOCAL_DB_CACHE_APPLY_FAILED:
            break;

        case PM_EVT_SERVICE_CHANGED_IND_SENT:
            break;

        case PM_EVT_SERVICE_CHANGED_IND_CONFIRMED:
            break;

        case PM_EVT_SLAVE_SECURITY_REQ:
            break;

        case PM_EVT_FLASH_GARBAGE_COLLECTED:
            break;

        case PM_EVT_FLASH_GARBAGE_COLLECTION_FAILED:
            break;

        default:
            break;
    }

    return;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/346711?ContentTypeID=1</link><pubDate>Fri, 07 Jan 2022 13:19:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb4858cb-f217-49d2-9d03-9888488619c7</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Have you included the pm_evt_handler() function and peer manager library files in your project in order to include and add bonding to your project? Just setting the SEC_PARAM_BOND to 1 won&amp;#39;t be sufficient in a project that hasn&amp;#39;t implemented the peer manager at all.&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: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/346675?ContentTypeID=1</link><pubDate>Fri, 07 Jan 2022 11:26:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dea03713-589d-4bf5-9382-6abf921bcf75</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;sorry for being late.&lt;br /&gt;I compared the project where my bonding fails with ble_app_hrs_c, but I still don&amp;#39;t understand why it fails.&lt;/p&gt;
&lt;p&gt;Do you have any advertisements?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/344606?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 13:21:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc77d928-683a-4edf-ac09-2a162987ec07</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What kind of error do you see when trying to bond with your Android peripheral. Can you show me a screenshot of how you&amp;#39;ve set up the Android advertiser?&lt;/p&gt;
&lt;p&gt;Please also note that, by default the ble_app_uart_c example project does not support bonding, so it makes sense that you won&amp;#39;t be able to bond an Android device to it. If you try using the ble_app_hrs_c example where SEC_PARAM_BOND is set to 1, and bonding is implemented, that should work better.&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: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/344473?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 03:10:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50b1464d-a0b6-4c16-9f92-a8c991e3cb9b</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;Does that mean I have to register NUS GATT?&lt;br /&gt;It is possible to connect with Android, and I think it is a matter of bonding at that time. So I think GATT has nothing to do with it.&lt;/p&gt;
&lt;p&gt;If I need GATT, I have to add it to nRF Connect, but I don&amp;#39;t know the data structure. Is there any material that describes the configuration?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/343063?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 08:13:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac905002-3ad5-49b8-b263-ae3c17296b8f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Did you add the Nordic UART service as part of your advertiser on Android, as the application scans peripheral devices and connects to a device that advertises with the NUS UUID in its advertisement report.&amp;nbsp;&lt;span&gt;After connecting, the application enables notifications on the device that delivers the Nordic UART Service.&lt;/span&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: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/342798?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 00:43:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:328da318-b699-4380-a230-d20c53524912</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;I tried to see if it can be bonded with ble_app_uart_c on Android.&lt;br /&gt;As a result, bonding was not possible.&lt;/p&gt;
&lt;p&gt;I pressed Bond from nRF Connect because Android didn&amp;#39;t show the pairing request, but it didn&amp;#39;t bond.&lt;br /&gt;Advertising Data was set to UUID only, and Configure GATT server was set to &amp;quot;Sample configuration&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/342511?ContentTypeID=1</link><pubDate>Wed, 08 Dec 2021 10:32:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3ae11eb-0a71-4673-9f53-384d5ea27e36</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Before we go to a code review and make this ticket private. Have you tried using I.E. the default ble_app_uart_c example project to connect to, and does that result in this local host termination as well?&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the Android as a peripheral, how have you set up the advertiser in the nRFConnect app? What advertising data have you added and what services have you added in the Configure GATT server of nRFConnect. It&amp;#39;s also worth tweaking&amp;nbsp;the connection parameters and connection supervision timeout in your central applicaton.&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: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/342443?ContentTypeID=1</link><pubDate>Wed, 08 Dec 2021 01:26:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8164699-986b-4a64-95e5-954dcbc85e2a</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;Isn&amp;#39;t GATT CONN TERMINATE LOCAL HOST from Android?&lt;br /&gt;The device used for connection is XPERIA SO-03J, and the application used is nRF Connect.&lt;br /&gt;The sample sources I referred to are &amp;quot;ble_app_blinky_c&amp;quot; and &amp;quot;ble_app_uart_c&amp;quot; of ble_central.&lt;br /&gt;Should I share the code I&amp;#39;m using? In that case, would you please make it a private ticket?&lt;/p&gt;
&lt;p&gt;It&amp;#39;s difficult to change because we work with people other than me in software development.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATT CONN TERMINATE LOCAL HOST occurs when bonding with Android</title><link>https://devzone.nordicsemi.com/thread/342346?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 13:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dba4739-744c-4320-aa2d-5a556705d440</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Does this GATT CONN TERMINATE LOCAL HOST error come from the Android? What Android device is this you&amp;#39;re trying to connect to, and are you using an Android app for BLE scanning and connecting (like nRFConnect) or are you using the standard settings/Bluetooth menu?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What example project have you based your nRF52832 application on here? Are you able to connect and bond with the Android device if you try using a default SDK example project?&amp;nbsp;Please also note that&amp;nbsp;If you are using v17.0.0 for development, it is strongly recommended to switch to &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/index.html"&gt;v17.0.2&lt;/a&gt;. As it is a bug fix release to v17.0.0 which had some bug fixes properly handling errata.&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>