<?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>Notification handling in pc-ble-driver vs on-chip handling</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71184/notification-handling-in-pc-ble-driver-vs-on-chip-handling</link><description>I&amp;#39;ve just found through some trial and error that SoftDevice (s130 at least) on the nRF51 DK handles a sequence of notifications in the following manner: 
 
 call sd_ble_gatts_hvx() with the data to be notified 
 if the call returns NRF_SUCCESS then send</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Feb 2021 09:23:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71184/notification-handling-in-pc-ble-driver-vs-on-chip-handling" /><item><title>RE: Notification handling in pc-ble-driver vs on-chip handling</title><link>https://devzone.nordicsemi.com/thread/292845?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2021 09:23:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e94df5bc-5707-4470-83cc-df86b868f59d</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Not that critical - its good for design development and testing new protocols for health devices (which I am doing). But pay dirt is on a real chip. There the notifications are significantly faster.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification handling in pc-ble-driver vs on-chip handling</title><link>https://devzone.nordicsemi.com/thread/292830?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2021 08:40:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cabb3496-8399-4ce6-afeb-b8252caaa41a</guid><dc:creator>run_ar</dc:creator><description>[quote user="brianreinhold"] I suppose the slowness is due to the overhead of going through the serial port meaning I never run out of buffers (never get the out of resources error); by the time I send the next buffer (even in a tight loop) the previous one has gone out the door[/quote]
&lt;p&gt;&amp;nbsp;Exactly. Not sure what throughput you are getting. But the serial interface will be the limiting factor eventually. I guess you could check your connection interval and how many packets you are able to send in each connection event using a sniffer if you want to try to maximize throughput as much as possible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification handling in pc-ble-driver vs on-chip handling</title><link>https://devzone.nordicsemi.com/thread/292469?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 12:43:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e098827-7a1d-4435-a8ce-da46da72ac31</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;On chip I simply notify in a loop as long as I get success. I only wait on the event if I get the error message that I am out of TX buffers. This greatly speeds up transfers compared to indications where I need to wait for the peer confirmation event before sending the next one. Since the peer does not confirm notifications, the speedup is no surprise.&lt;/p&gt;
&lt;p&gt;I tried the same thing using the pc-ble-driver. Of course there are some differences. For one thing I use semaphores since there is no sd_app_evt_wait() support. Then with indications I simply do indications in a loop and repeat if I get an NRF_ERROR_BUSY.&lt;/p&gt;
&lt;p&gt;For notifications, I also repeat the loop and wait for a semaphore event only when I get the out of resources error. However, I did NOT get the big improvement over using indications instead as I did on chip. I noticed that the&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE event was almost in step with the notification. I suppose the slowness is due to the overhead of going through the serial port meaning I never run out of buffers (never get the out of resources error); by the time I send the next buffer (even in a tight loop) the previous one has gone out the door.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification handling in pc-ble-driver vs on-chip handling</title><link>https://devzone.nordicsemi.com/thread/292459?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 12:15:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5492f2e8-3e1d-4607-b56c-8e41b8a6e5aa</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you want to transfer data using notification you should place new data in the tx buffer as soon as you receive the TX_complete event for as long as you have data to transfer. This should be done regardless of whether this is on chip or using the pc_ble driver. If you wait for the last buffer to be freed you will slow down transfer quite significantly as BLE uses lacy acknowledgement. This means the last packet sent by the peripheral in a connection event will not be acked in the same connection event. Instead it will only be acked (and the buffer freed) when the peripheral receives the first packet from the central in the sub subsequent connection event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>