<?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>BLE UART bridge</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114038/ble-uart-bridge</link><description>Hello! 
 I am programming BLE with the nRF52840-DK. [Toolchain Manager: v1.3.0, IDE: Visual Studio Code (VSCode), SDK: ncs v2.6.0, window11 pro] 
 I am integrating CDC ACM and NUS central . My current goal is to send data received via Bluetooth to a PC</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Aug 2024 07:12:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114038/ble-uart-bridge" /><item><title>RE: BLE UART bridge</title><link>https://devzone.nordicsemi.com/thread/498963?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2024 07:12:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03a98076-8279-4a5b-b380-f4a759db1510</guid><dc:creator>seongmincho</dc:creator><description>&lt;p&gt;When I switched from PuTTY to MATLAB, the issue was resolved. I&amp;rsquo;m not sure why, but I suspect it&amp;rsquo;s because MATLAB has a higher data rate for receiving data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE UART bridge</title><link>https://devzone.nordicsemi.com/thread/498877?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 13:48:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d333e78a-af0d-42e1-9260-2bd81b17f44d</guid><dc:creator>seongmincho</dc:creator><description>&lt;div class="flex-1 overflow-hidden"&gt;
&lt;div class="h-full"&gt;
&lt;div class="react-scroll-to-bottom--css-izrbm-79elbk h-full"&gt;
&lt;div class="react-scroll-to-bottom--css-izrbm-1n7m0yu"&gt;
&lt;div class="flex flex-col text-sm md:pb-9"&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div class="group/conversation-turn relative flex w-full min-w-0 flex-col agent-turn"&gt;
&lt;div class="flex-col gap-1 md:gap-3"&gt;
&lt;div class="flex max-w-full flex-col flex-grow"&gt;
&lt;div dir="auto" data-message-author-role="assistant" data-message-id="82bd386a-6306-4ad5-8d7b-03fbfc67e629"&gt;
&lt;div&gt;
&lt;div class="result-streaming markdown prose w-full break-words dark:prose-invert dark"&gt;
&lt;p&gt;This code also has the same issue.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;- below is other version code&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static uint8_t buffer[8192];
static uint8_t ble_data_received(struct bt_nus_client *nus, const uint8_t *data, uint16_t len){
    ARG_UNUSED(nus);
    uart_irq_tx_enable(usbd_dev);
    int rb_len;
    int send_len;
    rb_len = ring_buf_put(&amp;amp;ringbuf1, data, len);
    if (rb_len &amp;lt; len) {
        LOG_WRN(&amp;quot;ble_data_received - %dth  Current RX buffer full, dropped %d bytes&amp;quot;, rx_count, len - rb_len);
    }
    if(uart_irq_update(usbd_dev) &amp;amp;&amp;amp; uart_irq_is_pending(usbd_dev)){
        if (uart_irq_tx_ready(usbd_dev)){
            rb_len = ring_buf_get(&amp;amp;ringbuf1, buffer, sizeof(buffer));
            if (rb_len != 0) {
                send_len = uart_fifo_fill(usbd_dev, buffer, rb_len);
                if (send_len &amp;lt; rb_len) {
                    ring_buf_put(current_rx_buf, buffer + send_len, rb_len - send_len);
                    LOG_WRN(&amp;quot;ble_data_received - send_len &amp;lt; rb_len: %d&amp;quot;, rb_len - send_len);
                }
            }
        }
    }
    rx_count++;
    return BT_GATT_ITER_CONTINUE;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>