<?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>Unable to disable pairing in my peripheral app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122751/unable-to-disable-pairing-in-my-peripheral-app</link><description>I have a simple GATT server application with two characteristics, RX and TX. In my prj.conf, I am trying to disable pairing as follows : 
 
 I can connect to the server from a BLE scanner app. When I try to write to the TX characteristic, it asks me for</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Jul 2025 09:18:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122751/unable-to-disable-pairing-in-my-peripheral-app" /><item><title>RE: Unable to disable pairing in my peripheral app</title><link>https://devzone.nordicsemi.com/thread/541899?ContentTypeID=1</link><pubDate>Wed, 09 Jul 2025 09:18:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04c15b6d-f0ac-476a-9816-2b75315e65bc</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Pablo,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t see a reason why the characteristic requires encryption.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Could you try to go through the lesson in devacademy?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;At step 1 in this excercise:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-5-bluetooth-le-security-fundamentals/topic/blefund-lesson-5-exercise-1/"&gt;https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-5-bluetooth-le-security-fundamentals/topic/blefund-lesson-5-exercise-1/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Can you just test with the original sample (without&amp;nbsp; changing BT_GATT_PERM_WRITE to BT_GATT_PERM_WRITE_ENCRYPT ), to see if you can access the characteristic without encryption ?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to disable pairing in my peripheral app</title><link>https://devzone.nordicsemi.com/thread/541783?ContentTypeID=1</link><pubDate>Tue, 08 Jul 2025 11:02:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c48b13c-9526-411d-818b-62baf59c16e9</guid><dc:creator>mul</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/hungbui"&gt;Hung Bui&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;Thanks for your response. I am defining the service and characteristics as follows which shouldn&amp;#39;t require an encrypted link? (I believe):&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define CUSTOM_SERVICE_UUID 0x180A
#define CUSTOM_CHAR_UUID_READ  0x2A01
#define CUSTOM_CHAR_UUID_WRITE 0x2A02

/* GATT Callbacks */
static ssize_t read_callback(struct bt_conn *conn,
                             const struct bt_gatt_attr *attr,
                             void *buf, uint16_t len, uint16_t offset)
{
    const uint8_t *value = attr-&amp;gt;user_data;
    LOG_INF(&amp;quot;GATT Read: 0x%02X&amp;quot;, *value);
    return bt_gatt_attr_read(conn, attr, buf, len, offset, value, sizeof(*value));
}

static ssize_t write_callback(struct bt_conn *conn,
                              const struct bt_gatt_attr *attr,
                              const void *buf, uint16_t len, uint16_t offset,
                              uint8_t flags)
{
    uint8_t *value = attr-&amp;gt;user_data;

    if (offset + len &amp;gt; sizeof(*value)) {
        return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET);
    }

    memcpy(value + offset, buf, len);
    LOG_INF(&amp;quot;GATT Write: 0x%02X&amp;quot;, *value);

    // TODO - Process data - analyse frame etc. 

    return len;
}

/* GATT Service Definition */
BT_GATT_SERVICE_DEFINE(custom_svc,
    BT_GATT_PRIMARY_SERVICE(BT_UUID_DECLARE_16(CUSTOM_SERVICE_UUID)),
    BT_GATT_CHARACTERISTIC(BT_UUID_DECLARE_16(CUSTOM_CHAR_UUID_READ),
                           BT_GATT_CHRC_READ,
                           BT_GATT_PERM_READ,
                           read_callback, NULL, &amp;amp;read_value),
    BT_GATT_CHARACTERISTIC(BT_UUID_DECLARE_16(CUSTOM_CHAR_UUID_WRITE),
                           BT_GATT_CHRC_WRITE,
                           BT_GATT_PERM_WRITE,
                           NULL, write_callback, &amp;amp;write_value)
);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to disable pairing in my peripheral app</title><link>https://devzone.nordicsemi.com/thread/541660?ContentTypeID=1</link><pubDate>Mon, 07 Jul 2025 14:53:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d444710e-dfc4-45ed-8ff8-5100d5ee148e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Paolo,&amp;nbsp;&lt;br /&gt;Most likely your TX characteristic requires the link to be encrypted to access it (write to it). You need to remove that. Please check how you declare the characteristic.&amp;nbsp;&lt;br /&gt;I would suggest to take a look at our dev academy course here:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-5-bluetooth-le-security-fundamentals/"&gt;academy.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>