<?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>struct bt_conn issue, how to include conn_internal.h</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88467/struct-bt_conn-issue-how-to-include-conn_internal-h</link><description>1.) I used the sample code for BLE peripheral uart as template for my own project and modified it. I removed the nordic uart service &amp;quot;nus&amp;quot; and replaced it with a custom service &amp;quot;cus&amp;quot; - with a different UUID. My code compiles with warnings, in my custom</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Jun 2022 10:01:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88467/struct-bt_conn-issue-how-to-include-conn_internal-h" /><item><title>RE: struct bt_conn issue, how to include conn_internal.h</title><link>https://devzone.nordicsemi.com/thread/370639?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 10:01:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0190b796-4059-4eca-b0fb-f799c8005d55</guid><dc:creator>MDF</dc:creator><description>&lt;p&gt;I was able to find and fix the crash, which is not related to BLE - but happens because of the (stupid) code in uart_cb().&lt;/p&gt;
&lt;p&gt;When incoming UART data is received the coder enters the case UART_RX_RDY and then checks if the last character was LF or CR - and this code does not check for (buf-&amp;gt;len == 0) which can happen. I also noticed that this buffer management (allocate and release) only works well if 1 char per time is inserted in the fifo. Trying to insert a whole message works once, and then the release mgmt seems to go bad.&lt;/p&gt;
&lt;p&gt;This same sample code is used in central_uart and in peripheral_uart. Since the sample documentation suggests to use a Rxd-Txd loopback between the chip&amp;#39;s pins, this crash is not showing up.&lt;/p&gt;
&lt;p&gt;If ever anyone would have tested these UART samples with a real serial-UART connection to another device and a stupid user like me at the other end, the problem would show up&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: struct bt_conn issue, how to include conn_internal.h</title><link>https://devzone.nordicsemi.com/thread/370293?ContentTypeID=1</link><pubDate>Tue, 31 May 2022 17:46:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2723e407-5a70-4e78-8ff7-6a66653b0cb6</guid><dc:creator>MDF</dc:creator><description>&lt;p&gt;1.) I think I found a solution for the #include issue - I found a comment in ncs\v1.9.1\zephyr\subsys\bluetooth\audio\otc.c, it says&lt;/p&gt;
&lt;p&gt;#include &amp;quot;../host/conn_internal.h&amp;quot;&amp;nbsp; /* To avoid build errors on use of struct bt_conn&amp;quot; */&lt;/p&gt;
&lt;p&gt;so in may case I use now this to get rid of the warnings&lt;/p&gt;
&lt;p&gt;// this is necessary for struct bt_conn &lt;br /&gt;#include &amp;lt;bluetooth/buf.h&amp;gt;&lt;br /&gt;#include &amp;lt;../subsys/bluetooth/host/conn_internal.h&amp;gt;&lt;/p&gt;
&lt;p&gt;2.) but unfortunately it wont fix the crash issue ....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>