<?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>How to disable buffer in Nordic Uart Service?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23014/how-to-disable-buffer-in-nordic-uart-service</link><description>I&amp;#39;m trying to replace a RS232 cable with a BLE bridge with the Nordic Uart Service. 
 One nRF52832 configured as central (app_uart_example_central) and an other one as peripheral.
The connection is working well with putty or the nRF connect app on the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Feb 2022 07:56:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23014/how-to-disable-buffer-in-nordic-uart-service" /><item><title>RE: How to disable buffer in Nordic Uart Service?</title><link>https://devzone.nordicsemi.com/thread/353766?ContentTypeID=1</link><pubDate>Fri, 18 Feb 2022 07:56:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e82ca5df-d6ac-4fd6-8564-790fc96c823a</guid><dc:creator>lm</dc:creator><description>&lt;p&gt;thank you so much&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable buffer in Nordic Uart Service?</title><link>https://devzone.nordicsemi.com/thread/353765?ContentTypeID=1</link><pubDate>Fri, 18 Feb 2022 07:53:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26cf41e4-9a30-44a3-8136-2beefe236169</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The UART buffers can be cleared using the&amp;nbsp;&lt;em&gt;app_uart_flush()&lt;/em&gt; function, if that is what you mean.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable buffer in Nordic Uart Service?</title><link>https://devzone.nordicsemi.com/thread/353235?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 07:23:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0acd49ca-9601-422b-a4cb-8a88850e23f3</guid><dc:creator>lm</dc:creator><description>&lt;p&gt;Hello, yes that was a question for you actually I would like to have your help about how to clear the buffer after all the info is transmitted. Thank you&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable buffer in Nordic Uart Service?</title><link>https://devzone.nordicsemi.com/thread/353197?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 19:07:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77b02dd6-3f5f-482c-8a68-04aad72a9801</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Is that a question for me or Hermann?&lt;/p&gt;
&lt;p&gt;Since he hasn&amp;#39;t responded to the case I consider it resolved.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have a related UART issue I recommend opening a new ticket.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable buffer in Nordic Uart Service?</title><link>https://devzone.nordicsemi.com/thread/353152?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 14:58:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bee27f37-de0d-4e3e-a158-f9685b8fcd03</guid><dc:creator>lm</dc:creator><description>&lt;p&gt;Hello, do you have news fr this post? thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable buffer in Nordic Uart Service?</title><link>https://devzone.nordicsemi.com/thread/90541?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 13:12:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61eb993c-0648-40ee-b04b-560e6ef21795</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Hermann&lt;/p&gt;
&lt;p&gt;Have you modified the UART driver to do the timeout internally?&lt;/p&gt;
&lt;p&gt;It&amp;#39;s hard to say why the problem occurs, but I assume it is related to how the app_timer callback is reset if you receive more data before the timeout should occur.&lt;/p&gt;
&lt;p&gt;I think it would be simpler from a logical standpoint to use a repeated timer instead, and check the state of the buffer in the timer, sending a packet if the buffer contains more than 0 bytes.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable buffer in Nordic Uart Service?</title><link>https://devzone.nordicsemi.com/thread/90540?ContentTypeID=1</link><pubDate>Mon, 10 Jul 2017 11:07:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af59a300-bb27-4e9b-8fcf-cdf01f5dcefb</guid><dc:creator>hermann</dc:creator><description>&lt;p&gt;Hi Torbjørn,&lt;/p&gt;
&lt;p&gt;thanks for your tip with the timer.&lt;/p&gt;
&lt;p&gt;I created a app_timer (single_shot) which is (re-)started after a recieved byte on the UART. So the last bytes in the buffer are send after a few ticks. But sometimes there are delays which are a lot longer than the timer should be.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void uart_event_handle(app_uart_evt_t * p_event)
{
static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];
static uint8_t index = 0;
uint32_t       err_code;

switch (p_event-&amp;gt;evt_type)
{
  // event is called when timer expiers
		  case APP_CLEAR_BUFFER:
				  //copy of APP_UART_DATA_READY without getting byte from UART --&amp;gt; no new byte there...
        if (index != 0)
        {
            NRF_LOG_DEBUG(&amp;quot;Ready to send data over BLE NUS\r\n&amp;quot;);
            NRF_LOG_HEXDUMP_DEBUG(data_array, index);

            do
            {
                err_code = ble_nus_string_send(&amp;amp;m_nus, data_array, index);
                if ( (err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY) )
                {
                    APP_ERROR_CHECK(err_code);
                }
            } while (err_code == NRF_ERROR_BUSY);

            index = 0;
        }
        break;				
		
		case APP_UART_DATA_READY:
                    // ...
   }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Any idea what causes this delay?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable buffer in Nordic Uart Service?</title><link>https://devzone.nordicsemi.com/thread/90539?ContentTypeID=1</link><pubDate>Mon, 26 Jun 2017 11:51:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b24c0ea4-67a1-4483-9c7d-61ed8fd73d61</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Hermann&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think removing the buffer is the best option, since having the buffer is a good way to ensure you can send larger chunks of data at once, but what you can do is to add some code to empty the buffer more aggressively.&lt;/p&gt;
&lt;p&gt;For instance you can set up an app_timer callback that checks the buffer every N milliseconds, and sends whatever is in the buffer as long as it is not empty. Then you know that your data will be sent on certain intervals, even if you haven&amp;#39;t filled the buffer first.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>