<?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>Not able to send notifications and indications after bonding</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64841/not-able-to-send-notifications-and-indications-after-bonding</link><description>Hello, 
 when I send notifications or indications to central device without bonding it works perfect. But after bonding they are not sent. I receive following logs when cetnral subscribes on my characteristics: &amp;lt;info&amp;gt; peer_manager_handler: Peer data updated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Aug 2020 08:46:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64841/not-able-to-send-notifications-and-indications-after-bonding" /><item><title>RE: Not able to send notifications and indications after bonding</title><link>https://devzone.nordicsemi.com/thread/265020?ContentTypeID=1</link><pubDate>Tue, 18 Aug 2020 08:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f530ddfa-f1d0-486f-ad4a-9146510d3894</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="morozovoars"]I found mistake it was in my code. I have my own boolean variables, which indicates if notifications/indications enabled or no. I update them only during changing descriptor of characteristics. In case of bonding and after reset this variables are false and they reject any calls of hvx and handle this like INVALID_STATE error. I use it to overcome APP_ERROR_CHECK calls, because I also use it.&amp;nbsp;&lt;br /&gt;Now I check desriptors of the chars inside connected event and update those boolean variables. In this way everything works perfect.[/quote]
&lt;p&gt;This is exactly what the APP_ERROR_CHECK function is made to do, and how it should be used - alert you that you have gotten an unexpected return from a function.&amp;nbsp;I am happy to hear that you were able to identify and resolve the issue!&amp;nbsp;&lt;/p&gt;
[quote user="morozovoars"]So, anyway thank you very much and sorry for false issue.[/quote]
&lt;p&gt;Do not worry at all, I am happy to help!&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open a new ticket if you should encounter any other issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development! :)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Mvh.&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to send notifications and indications after bonding</title><link>https://devzone.nordicsemi.com/thread/264949?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 20:09:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eda16caf-a475-4573-822b-d228baadc45e</guid><dc:creator>Ars Morozov</dc:creator><description>&lt;p&gt;I found mistake it was in my code. I have my own boolean variables, which indicates if notifications/indications enabled or no. I update them only during changing descriptor of characteristics. In case of bonding and after reset this variables are false and they reject any calls of hvx and handle this like INVALID_STATE error. I use it to overcome APP_ERROR_CHECK calls, because I also use it.&amp;nbsp;&lt;br /&gt;Now I check desriptors of the chars inside connected event and update those boolean variables. In this way everything works perfect.&lt;br /&gt;So, anyway thank you very much and sorry for false issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to send notifications and indications after bonding</title><link>https://devzone.nordicsemi.com/thread/264945?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 19:42:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88dc7af7-0fca-4ad3-9693-06bfbf4749a1</guid><dc:creator>Ars Morozov</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/64841/not-able-to-send-notifications-and-indications-after-bonding/264823"]This happens if you try to notify a central that has not enabled notifications.&lt;br /&gt;In your case, it sounds like you have enabled notifications, but you will need to verify that the particular CCCD is in fact enabled.[/quote]
&lt;p&gt;How can I check this?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/64841/not-able-to-send-notifications-and-indications-after-bonding/264823"]Have you for instance created a custom characteristics that you would like to do notifications / indications on? In that case, the central will need to be told about this in advance, so it knows what to expect from this characteristic.[/quote]
&lt;p&gt;Yes, I did. As I said it works perfectly without bonding.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to send notifications and indications after bonding</title><link>https://devzone.nordicsemi.com/thread/264823?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 10:33:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:542bdc87-1183-467c-ad22-66af5018b1f3</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Karl Ylvisaker"]Notifications and/or indications not enabled in the CCCD[/quote]
&lt;p&gt;This happens if you try to notify a central that has not enabled notifications.&lt;br /&gt;In your case, it sounds like you have enabled notifications, but you will need to verify that the particular CCCD is in fact enabled.&lt;/p&gt;
[quote user="Karl Ylvisaker"]An ATT_MTU exchange is ongoing[/quote]
&lt;p&gt;If a sd_ble_gattc_exchange_mtu_request has been made ( with return value NRF_SUCCESS ) you will need to wait for the&amp;nbsp;BLE_GATTC_EVT_EXCHANGE_MTU_RSP to proceed.&lt;br /&gt;&lt;br /&gt;If you are working out of the ble_app_hrs_rscs_relay example from the SDK, the 3. condition should be handled already, so my suspicion is on the 2nd condition.&lt;br /&gt;Have you for instance created a custom characteristics that you would like to do notifications / indications on? In that case, the central will need to be told about this in advance, so it knows what to expect from this characteristic.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to send notifications and indications after bonding</title><link>https://devzone.nordicsemi.com/thread/264808?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 09:30:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64048589-4468-4d51-9c7f-5c7db4824078</guid><dc:creator>Ars Morozov</dc:creator><description>&lt;p&gt;Ok,&lt;br /&gt;but how can I check 2nd and 3rd conditions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to send notifications and indications after bonding</title><link>https://devzone.nordicsemi.com/thread/264805?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 09:26:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a555b01-cecb-46ba-9341-2001ae2e85ea</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;br /&gt;&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.0.1%2Fgroup___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga313fe43c2e93267da668572e885945db"&gt;The sd_ble_gatts_hvx API Reference Documentation&lt;/a&gt;&amp;nbsp;lists the following possible reasons for the NRF_ERROR_INVALID_STATE return value:&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="1" rowspan="1"&gt;&lt;a title="Invalid state, operation disallowed in this state." href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group__nrf__error.html#gaf0aff2ba7864b34a36b4a96986e1851e"&gt;NRF_ERROR_INVALID_STATE&lt;/a&gt;&lt;/td&gt;
&lt;td colspan="1" rowspan="1"&gt;One or more of the following is true:
&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&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Could you verify that neither of these are the case?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to send notifications and indications after bonding</title><link>https://devzone.nordicsemi.com/thread/264781?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 08:35:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ec2a09d-dc43-468b-addb-0fa443eed813</guid><dc:creator>Ars Morozov</dc:creator><description>&lt;p&gt;Hi Karl,&lt;br /&gt;&lt;br /&gt;sd_ble_gatts_hvx() returns NRF_ERROR_INVALID_STATE&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to send notifications and indications after bonding</title><link>https://devzone.nordicsemi.com/thread/264758?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 07:51:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:564e0b6f-19e8-48d4-894a-696c1addb0b7</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]But when I send notification I get the following error codes -&amp;nbsp;NRF_ERROR_INVALID_STATE[/quote]
&lt;p&gt;Which function is returning with the NRF_ERROR_INVALID_STATE value?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>