<?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>app_uart_put() check that is transmmited all bytes from FIFO?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50498/app_uart_put-check-that-is-transmmited-all-bytes-from-fifo</link><description>Hi i have tried with uart example and need to change baudrate after the some string is transmmited over UARTS TX. Is it possible to somehow that to check that all bytes from FIFO are transmmited?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Aug 2019 09:06:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50498/app_uart_put-check-that-is-transmmited-all-bytes-from-fifo" /><item><title>RE: app_uart_put() check that is transmmited all bytes from FIFO?</title><link>https://devzone.nordicsemi.com/thread/201780?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2019 09:06:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b12a3de-662a-420b-bc4c-b38ec7d2d01c</guid><dc:creator>gnrboy</dc:creator><description>&lt;p&gt;for solving this in ble_app_uart example in&amp;nbsp;uart_event_handle function add&amp;nbsp; case APP_UART_TX_EMPTY:&amp;nbsp; and you can do everything what you want later&amp;nbsp; if you must to do something when this event happens.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;P.S. when you start app this evens happens you must add some condition :) that you handle later&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&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)
    {
        case APP_UART_DATA_READY:
            UNUSED_VARIABLE(app_uart_get(&amp;amp;data_array[index]));
           // data_array[index] = data_array[index] &amp;amp; 0x7f;
            index++;

            if ((data_array[index - 1] == &amp;#39;\n&amp;#39;) ||
                (data_array[index - 1] == &amp;#39;\r&amp;#39;) ||
                (index &amp;gt;= m_ble_nus_max_data_len))
            {
                if (index &amp;gt; 1)
                {
                    NRF_LOG_DEBUG(&amp;quot;Ready to send data over BLE NUS&amp;quot;);
                    NRF_LOG_HEXDUMP_DEBUG(data_array, index);
                      bsp_board_led_invert(2);
                    do
                    {
                        uint16_t length = (uint16_t)index;
                        err_code = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);
                        if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
                            (err_code != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;
                            (err_code != NRF_ERROR_NOT_FOUND))
                        {
                            APP_ERROR_CHECK(err_code);
                        }
                    } while (err_code == NRF_ERROR_RESOURCES);
                }

                index = 0;
            }
            break;

        case APP_UART_COMMUNICATION_ERROR:
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
            break;

        case APP_UART_FIFO_ERROR:
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);
            break;

        case APP_UART_TX_EMPTY:
            if(data[0] == &amp;#39;q&amp;#39; &amp;amp;&amp;amp; data[1] == &amp;#39;r&amp;#39;){
            bsp_board_led_invert(3);
            }
            break;

        default:
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_uart_put() check that is transmmited all bytes from FIFO?</title><link>https://devzone.nordicsemi.com/thread/201778?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2019 09:01:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce21a722-ec75-49f4-9d91-2384598b6332</guid><dc:creator>gnrboy</dc:creator><description>&lt;p&gt;i have found it and solved my problem &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;yes that event and condition when corresponding string occurs it after it is transmmited then baudrate i have succes to change.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_uart_put() check that is transmmited all bytes from FIFO?</title><link>https://devzone.nordicsemi.com/thread/201777?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2019 08:55:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31f2ce72-e8a8-47d0-ae3f-83a9c4ecbc2e</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;There&amp;#39;s an Event for that:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__app__uart.html#ga9346b21b144fd9499e24853bbf781e17"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__app__uart.html#ga9346b21b144fd9499e24853bbf781e17&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See also:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44934/check-uart-transmit-complete-in-nrf52832/176714#176714"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/44934/check-uart-transmit-complete-in-nrf52832/176714#176714&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>