<?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>Issues sending notifications when setting up the MCU as a central and peripheral.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93431/issues-sending-notifications-when-setting-up-the-mcu-as-a-central-and-peripheral</link><description>Hey! 
 My current setup is using an Android tablet ---- BLE ----&amp;gt; MCU1 (nrf52840) ---- BLE----&amp;gt; MCU2 (nrf52832) 
 I&amp;#39;m setting the MCU1 to act as both a peripheral and central. The goal is for the MCU1 to pass along all messages from the tablet to MCU2</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Nov 2022 22:33:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93431/issues-sending-notifications-when-setting-up-the-mcu-as-a-central-and-peripheral" /><item><title>RE: Issues sending notifications when setting up the MCU as a central and peripheral.</title><link>https://devzone.nordicsemi.com/thread/394026?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 22:33:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:380096b3-3a15-4c8e-8383-f547d31ff23b</guid><dc:creator>Vasav Shah</dc:creator><description>&lt;p&gt;Hi Jared!&lt;/p&gt;
&lt;p&gt;I looked at the connection handles, and it was the issue. I didn&amp;#39;t realize that all events were triggered on all events. For anyone in the future, I used BLE_GAP_ROLE_CENTRAL and BLE_GAP_ROLE_PERIPH to differentiate between the types of connection events.&lt;/p&gt;
&lt;p&gt;Vasav&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues sending notifications when setting up the MCU as a central and peripheral.</title><link>https://devzone.nordicsemi.com/thread/393604?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 10:06:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:902afd7c-2712-46bc-9a4e-f23664b134e1</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What is the value of the connection handle when you get this error?&amp;nbsp;&lt;/p&gt;
[quote user=""]The issue I&amp;#39;m facing is when I have a tablet connected to MCU1 and then MCU2 connects, the notifications being sent back from MCU2 do not work. I&amp;#39;m getting &amp;quot;NRF_ERROR_INVALID_STATE&amp;quot; while calling &amp;quot;sd_ble_gatts_hvx.&amp;quot; However, if I have MCU1 and MCU2 connected, and then connect on the tablet, the notifications work fine.[/quote]
&lt;p&gt;If I understand you correctly, it works fine if you first connect MCU1 and MCU2 and then connect MCU 1 and the tablet. But it doesn&amp;#39;t work if you first connect MCU1 and the tablet before you connect MCU2 and MCU1?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues sending notifications when setting up the MCU as a central and peripheral.</title><link>https://devzone.nordicsemi.com/thread/393526?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 16:11:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0558e48e-e374-419c-b734-fb284eda88ed</guid><dc:creator>Vasav Shah</dc:creator><description>&lt;p&gt;Hi Jared,&lt;/p&gt;
&lt;p&gt;I have ensured the device is connected and the CCCD is enabled. I still am not able to get the notification to pass through. &lt;/p&gt;
&lt;p&gt;Vasav&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues sending notifications when setting up the MCU as a central and peripheral.</title><link>https://devzone.nordicsemi.com/thread/393402?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 09:48:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9c0ac88-6fab-4783-a41e-f75cf2510958</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html#ga313fe43c2e93267da668572e885945db"&gt;&lt;span&gt;sd_ble_gatts_hvx()&lt;/span&gt;&lt;/a&gt;&amp;nbsp;returns&amp;nbsp;NRF_ERROR_INVALID_STATE when&lt;/p&gt;
&lt;p&gt;&amp;quot;One or more of the following is true:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Invalid Connection State&lt;/li&gt;
&lt;li&gt;Notifications and/or indications not enabled in the CCCD&lt;/li&gt;
&lt;li&gt;An ATT_MTU exchange is ongoing&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can start with checking if the device is already in a connection when you try to send the notification and if you have already enabled notifications in the CCCD.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>