<?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>bt_gatt_notify returning -ENOTCONN</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81958/bt_gatt_notify-returning--enotconn</link><description>I am trying to send a notification in a new device we are developing, something which I have done many times before. I am using Zephyr 1.4.1 
 Here is how I set up the service 
 //Vendor Primary Service Declaration BT_GATT_SERVICE_DEFINE(vnd_svc, BT_GATT_PRIMARY_SERVICE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Mar 2023 09:10:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81958/bt_gatt_notify-returning--enotconn" /><item><title>RE: bt_gatt_notify returning -ENOTCONN</title><link>https://devzone.nordicsemi.com/thread/417343?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2023 09:10:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6685e16e-da1c-4e43-ab44-43d9e41e2b1f</guid><dc:creator>ujur007</dc:creator><description>&lt;p&gt;I have them already, but the issue is also there with Zephyr installed within the nRF SDK folder. I copied and flashed the same application.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/55853"&gt;github.com/.../55853&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_gatt_notify returning -ENOTCONN</title><link>https://devzone.nordicsemi.com/thread/416337?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2023 15:31:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e7d45da-0201-42b9-aa34-65f3f2b0ec6d</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please contact &lt;a href="https://discord.com/invite/Ck7jw53nU2"&gt;Zephyr Discord&lt;/a&gt; for vanilla zephyr support.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_gatt_notify returning -ENOTCONN</title><link>https://devzone.nordicsemi.com/thread/416105?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 17:58:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:904629c2-908e-434f-a8c1-bc921347631c</guid><dc:creator>ujur007</dc:creator><description>&lt;p&gt;Was there any update to this issue? I am facing the same problem with Zephyr installation.&lt;/p&gt;
&lt;p&gt;note: I am not using Zephyr inside /ncs folder.&lt;/p&gt;
&lt;p&gt;One question is also that the HRS service notification is working then how can it be that custom notification has a issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_gatt_notify returning -ENOTCONN</title><link>https://devzone.nordicsemi.com/thread/385497?ContentTypeID=1</link><pubDate>Fri, 09 Sep 2022 11:14:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d27d2e32-d89c-42c7-9b6c-f451a10762f2</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please use Zephyr provided by NCS.&amp;nbsp;&lt;span&gt;We only support nRF Connect SDK in our integration layer and we can&amp;#39;t really help if the customer wants to use the vanilla Zephyr. All the development was with nRF Connect SDK in mind, and we cannot guarantee it will work without code changes in a different context.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you still have an issue with NCS, please create a new support case and describe the problem with the NCS version. I will be out of the office for two weeks and would not reply to this case.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_gatt_notify returning -ENOTCONN</title><link>https://devzone.nordicsemi.com/thread/384364?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2022 14:47:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1229a91f-2f70-4317-9ef1-dccaae93d7bc</guid><dc:creator>CacO3</dc:creator><description>&lt;p&gt;I have the same issue using Zephyr 3.1, would be great if Nordic could provide some input!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_gatt_notify returning -ENOTCONN</title><link>https://devzone.nordicsemi.com/thread/340145?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 15:08:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9521e831-5bbf-4fee-a083-a6a4a5a21b52</guid><dc:creator>yayembedded</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;Thanks for the function signatures, but I am not sure how that will help me.&lt;/p&gt;
&lt;p&gt;I forgot to mention there is no problem reading and writing to the characteristic in question.&amp;nbsp;&amp;nbsp;Only notifications for this characteristic have an issue.&lt;/p&gt;
&lt;p&gt;I can keep all my code the same,&amp;nbsp;but change which characteristic I use to notify and there is no issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_gatt_notify returning -ENOTCONN</title><link>https://devzone.nordicsemi.com/thread/340063?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 12:49:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b255d93-6ee5-408a-85ec-f2ba1421dabb</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have a look &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gatt.html?highlight=bt_gatt_notify#c.bt_gatt_notify"&gt;bt_gatt_notify&lt;/a&gt;&amp;nbsp;&lt;span&gt;(&lt;/span&gt;&lt;em&gt;&lt;span&gt;struct&lt;/span&gt;&lt;/em&gt;&lt;span&gt;bt_conn&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;em&gt;&lt;span&gt;conn&lt;/span&gt;&lt;/em&gt;,&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;span&gt;const&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span&gt;struct&amp;nbsp;&lt;/span&gt;&lt;/em&gt;&lt;a title="bt_gatt_attr" href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gatt.html?highlight=bt_gatt_notify#c.bt_gatt_attr"&gt;&lt;span&gt;bt_gatt_attr&lt;/span&gt;&lt;/a&gt;&lt;span&gt;*&lt;/span&gt;&lt;strong&gt;&lt;em&gt;&lt;span&gt;attr&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;,&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;span&gt;const&lt;/span&gt;&lt;/em&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;em&gt;&lt;span&gt;data&lt;/span&gt;&lt;/em&gt;,&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;uint16_t&lt;/span&gt;&lt;em&gt;&lt;span&gt;len&lt;/span&gt;&lt;/em&gt;&lt;span&gt;)&lt;/span&gt;&lt;a title="Permalink to this definition" href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gatt.html?highlight=bt_gatt_notify#c.bt_gatt_notify"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Notify attribute value change.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Send notification of attribute value change, if connection is NULL notify all peer that have notification enabled via CCC otherwise do a direct notification only the given connection.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The attribute object on the parameters can be the so called Characteristic Declaration, which is usually declared with BT_GATT_CHARACTERISTIC followed by BT_GATT_CCC, or the Characteristic Value Declaration which is automatically created after the Characteristic Declaration when using BT_GATT_CHARACTERISTIC.&lt;/em&gt;&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;Parameters&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;conn&lt;/strong&gt;&amp;nbsp;– Connection object.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;attr&lt;/strong&gt;&amp;nbsp;– Characteristic or Characteristic Value attribute.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;data&lt;/strong&gt;&amp;nbsp;– Pointer to Attribute data.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;len&lt;/strong&gt;&amp;nbsp;– Attribute value length.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;Returns&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;
&lt;p&gt;&lt;em&gt;0 in case of success or negative value in case of error.&lt;/em&gt;&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;&amp;nbsp;--&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span&gt;struct &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gatt.html?highlight=bt_gatt_notify#c.bt_gatt_attr"&gt;bt_gatt_attr&lt;/a&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;#include &amp;lt;gatt.h&amp;gt;&lt;/p&gt;
&lt;p&gt;GATT Attribute structure.&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;Public Members&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;a title="bt_uuid" href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/uuid.html#c.bt_uuid"&gt;&lt;span&gt;bt_uuid&lt;/span&gt;&lt;/a&gt;&lt;span&gt;*&lt;/span&gt;&lt;code&gt;&lt;span&gt;uuid&lt;/span&gt;&lt;/code&gt;&lt;a title="Permalink to this definition" href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gatt.html?highlight=bt_gatt_notify#c.bt_gatt_attr.uuid"&gt;&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;
&lt;p&gt;Attribute UUID&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;ssize_t&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;code&gt;&lt;span&gt;read&lt;/span&gt;&lt;/code&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt;bt_conn&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;conn&lt;/span&gt;,&amp;nbsp;&lt;span&gt;const&lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;a title="bt_gatt_attr" href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gatt.html?highlight=bt_gatt_notify#c.bt_gatt_attr"&gt;&lt;span&gt;bt_gatt_attr&lt;/span&gt;&lt;/a&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;attr&lt;/span&gt;,&amp;nbsp;&lt;span&gt;void&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;buf&lt;/span&gt;,&amp;nbsp;&lt;span&gt;uint16_t&lt;/span&gt;&lt;span&gt;len&lt;/span&gt;,&amp;nbsp;&lt;span&gt;uint16_t&lt;/span&gt;&lt;span&gt;offset&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;a title="Permalink to this definition" href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gatt.html?highlight=bt_gatt_notify#c.bt_gatt_attr.read"&gt;&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;
&lt;p&gt;Attribute read callback.&lt;/p&gt;
&lt;p&gt;The callback can also be used locally to read the contents of the attribute in which case no connection will be set.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Parameters&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;conn&lt;/strong&gt;&amp;nbsp;– The connection that is requesting to read&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;attr&lt;/strong&gt;&amp;nbsp;– The attribute that’s being read&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;buf&lt;/strong&gt;&amp;nbsp;– Buffer to place the read result in&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;len&lt;/strong&gt;&amp;nbsp;– Length of data to read&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;offset&lt;/strong&gt;&amp;nbsp;– Offset to start reading from&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;Returns&lt;/dt&gt;
&lt;dd&gt;
&lt;p&gt;Number fo bytes read, or in case of an error&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gatt.html?highlight=bt_gatt_notify#group__bt__gatt_1gaff31756c1bf8ee755e65b1e0fb689bb7"&gt;&lt;span&gt;BT_GATT_ERR()&lt;/span&gt;&lt;/a&gt;&amp;nbsp;with a specific ATT error code.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;/div&gt;
&lt;p&gt;Regards,&amp;nbsp;&lt;br /&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>