<?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>Can not notify</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6116/can-not-notify</link><description>Hi all! 
 My project is depend on the &amp;quot;ble_app_template&amp;quot;,which uses the &amp;quot;scheld structure&amp;quot;, I am able to read the data from app but not able to send my data with notification. I have set all the points about notification the same as the &amp;quot;ble_app_hrs</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Aug 2015 09:34:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6116/can-not-notify" /><item><title>RE: Can not notify</title><link>https://devzone.nordicsemi.com/thread/21396?ContentTypeID=1</link><pubDate>Mon, 03 Aug 2015 09:34:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0caf5bd2-8271-409a-9dd7-d70930e06910</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;You are right, I could have been more clear here. I wanted to highlight that buffer_count_get() does not return the number of free buffers, but the maximum number of available buffers. I will edit my answer to mention reconnections.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not notify</title><link>https://devzone.nordicsemi.com/thread/21395?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 10:49:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a2241d5-2987-45d1-95cf-f8318b8f4a9c</guid><dc:creator>Matteo Scordino</dc:creator><description>&lt;p&gt;I think there is an error here; you should not &amp;quot;Get the maximum number of buffers&amp;quot; &lt;strong&gt;ONCE&lt;/strong&gt; as stated in the answer. I think you should do it at every reconnection, otherwise the counter will get out of sync with the actual number of available buffers and you will be unable to transmit.&lt;/p&gt;
&lt;p&gt;This is what I see: if a disconnection occurs after one buffer is used and BEFORE it is freed again, you won&amp;#39;t get a BLE_EVT_TX_COMPLETE event, but on disconnection the buffers will be freed. As a result, you will think that you have N-1 available buffers, but you actually have N. This will accumulate every time you have a disconnection while a packet is &amp;quot;over the air&amp;quot;, with the result that in the end you will always think you have 0 available buffers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not notify</title><link>https://devzone.nordicsemi.com/thread/21394?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2015 16:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58013423-83bb-4fe0-9f2d-e34f5dd310cf</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please refer to the documentation for sd_ble_gatts_hvx() and sd_ble_tx_buffer_count_get() for information on this.&lt;/p&gt;
&lt;p&gt;The application has a number of &lt;em&gt;application buffers&lt;/em&gt; available to be queued for sending, and you must keep track of these. This is well-explained in the documentation for buffer_count_get(), but in short pseudo-code you would do something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Get the maximum number of buffers (this is done in the CONNECTED event, only once per connection)
uint32_t buffers_free;
sd_ble_tx_buffer_count_get(&amp;amp;buffers_free);

// When calling a function that consumes a buffer
if (buffers_free &amp;gt; 0) { // Else, queue it internally in your app - or discard
    sd_ble_gatts_hvx(...);
    buffers_free--;
}
on_ble_evt(evt) {
   switch (evt-&amp;gt;header.evt_id) {
       case BLE_EVT_TX_COMPLETE:
           buffers_free += evt.count;
           break;
      case other events:
         (...)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the connection interval is longer than the sending rate, the peer is NACKing the packets (its buffers are full), or i there is too much noise to do the full throughput you will eventually run out of application buffers. All the successfully queued packets will eventually be sent, in the same order as you queued them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>