<?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>Clear a buffer and timer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84771/clear-a-buffer-and-timer</link><description>Hello, 
 i&amp;#39;m using a nrf52832 dk and i&amp;#39;m using the example ble app uart. 
 I saw the packets that are send for rx or tx but with packets of 20 bytes 
 I saw this post, https://devzone.nordicsemi.com/f/nordic-q-a/71414/how-to-clear-memory-buffer-which</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Feb 2022 20:06:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84771/clear-a-buffer-and-timer" /><item><title>RE: Clear a buffer and timer</title><link>https://devzone.nordicsemi.com/thread/353714?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 20:06:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a2e10b0-5c7c-4832-b411-7221865d86bd</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Also check out documentation:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_timer.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_timer.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clear a buffer and timer</title><link>https://devzone.nordicsemi.com/thread/353653?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 14:42:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9e45cef-61ee-4e2b-a916-c49d54278946</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Please look at the examples that include app_timer, I believe there is at least one in the /peripheral/ folder.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clear a buffer and timer</title><link>https://devzone.nordicsemi.com/thread/353636?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 13:53:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81597747-e5e0-4700-a5e1-de0a2ff90ef8</guid><dc:creator>lm</dc:creator><description>&lt;p&gt;Kenneth do you have an example? thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clear a buffer and timer</title><link>https://devzone.nordicsemi.com/thread/353255?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 08:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91a9b2e8-2f49-455f-8678-0a9b1884454c</guid><dc:creator>lm</dc:creator><description>&lt;p&gt;I understand your explanation :) and it&amp;#39;s very helpful for understanding the goal but do you have an example that could be useful fr the app timer timeout handler thank you :)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clear a buffer and timer</title><link>https://devzone.nordicsemi.com/thread/353149?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 14:52:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47125ee1-abc1-4c5f-b9ff-ecb8a4744394</guid><dc:creator>lm</dc:creator><description>&lt;p&gt;Hello Kenneth thank you so much for your helo, do you have an example that I can use or see to see the use of data array in extern of the main and the use of APP TIMER DEF? thank you for your time&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clear a buffer and timer</title><link>https://devzone.nordicsemi.com/thread/353148?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 14:49:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e0b4ddb-5d92-473e-b77f-2798fb7dafd5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I guess there are many ways this can be solved.&lt;/p&gt;
&lt;p&gt;You can make the UART data available globally in main.c by declaring&amp;nbsp;data_array[] it on top of main.c (instead of in&amp;nbsp;uart_event_handle()).&lt;/p&gt;
&lt;p&gt;You can now use the&amp;nbsp;uart_event_handle() to fill up the&amp;nbsp;&lt;span&gt;data_array[], but don&amp;#39;t send data using&amp;nbsp;ble_nus_data_send() from uart_event_handle().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You can for instance&amp;nbsp;create an&amp;nbsp;app_timer using APP_TIMER_DEF() that you start in main(), this app_timer can for instance be&amp;nbsp;timeout every 1ms.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In the app_timer timeout handler you can call&amp;nbsp;ble_nus_data_send() to send any received data in data_array[].&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Something like that,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clear a buffer and timer</title><link>https://devzone.nordicsemi.com/thread/353107?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 13:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36ea579b-83ea-433a-8a48-f4a62e47d17d</guid><dc:creator>lm</dc:creator><description>&lt;p&gt;I saw that the function &amp;quot;&lt;span&gt;app_uart_flush&amp;quot; could be used but I would like to have more explanations of how to put the function if this is the right thing to use. Thank you&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>