<?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>SERVICE HANDLE OF NUS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78094/service-handle-of-nus</link><description>I am trying to determine the service handle of the nus example, to be able to verify that the central has turned on notifications. 
 I am using the sd_ble_gatts_value_get(m_conn_handle, , &amp;amp;pval); function to read the attribute value and then test if for</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Aug 2021 02:35:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78094/service-handle-of-nus" /><item><title>RE: SERVICE HANDLE OF NUS</title><link>https://devzone.nordicsemi.com/thread/323620?ContentTypeID=1</link><pubDate>Fri, 06 Aug 2021 02:35:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adf58899-50d6-4b09-85cb-dd215d0c2596</guid><dc:creator>jing</dc:creator><description>&lt;p&gt;\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_uart\main.c&lt;/p&gt;
&lt;p&gt;static void nus_data_handler(ble_nus_evt_t * p_evt)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; if (p_evt-&amp;gt;type == BLE_NUS_EVT_COMM_STARTED)&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* TX Characteristic notification enabled */&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; else if (p_evt-&amp;gt;type == BLE_NUS_EVT_COMM_STOPPED)&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* TX Characteristic notification disabled */&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; :&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;jing&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SERVICE HANDLE OF NUS</title><link>https://devzone.nordicsemi.com/thread/322929?ContentTypeID=1</link><pubDate>Mon, 02 Aug 2021 14:40:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e3145c8-d68d-4665-b1bf-ae5ca48c031e</guid><dc:creator>Herb Gingold</dc:creator><description>&lt;p&gt;Jing, thank you for your reply, can you show an example of an implementation, I cannot determine what to do at my current nordic skill level from your comment.&lt;/p&gt;
&lt;p&gt;Herb&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SERVICE HANDLE OF NUS</title><link>https://devzone.nordicsemi.com/thread/322777?ContentTypeID=1</link><pubDate>Mon, 02 Aug 2021 05:05:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0eca8bd3-7959-4b0f-b860-170c6414ff9e</guid><dc:creator>jing</dc:creator><description>&lt;p&gt;you can just handle&amp;nbsp;BLE_NUS_EVT_COMM_STARTED (on notification enabled) and&amp;nbsp;BLE_NUS_EVT_COMM_STOPPED (on notification disabled) event type from your registered nus callback.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;jing&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SERVICE HANDLE OF NUS</title><link>https://devzone.nordicsemi.com/thread/322756?ContentTypeID=1</link><pubDate>Sun, 01 Aug 2021 12:18:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1995716-24a1-436e-ad6b-f8216e4c04ce</guid><dc:creator>Herb Gingold</dc:creator><description>&lt;p&gt;No one responded to this, but I found the handle, really obscure documentation and beyond sketchy examples.&lt;/p&gt;
&lt;p&gt;Now that I found this, and got it to compile, it does not return a value, what am I doing wrong here:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if ( Device_Connected &amp;amp;&amp;amp; filter_pointer == FILTER_LENGTH)&lt;br /&gt; {&lt;br /&gt; uint16_t length = 7u;&lt;br /&gt; uint8_t p_bull = NULL;&lt;br /&gt; ble_gatts_value_t pval;&lt;br /&gt; *pval.p_value = p_bull;&lt;br /&gt; &lt;br /&gt; err_code = sd_ble_gatts_value_get(m_conn_handle, m_nus.tx_handles.cccd_handle, &amp;amp;pval);&lt;br /&gt; uint8_t p_temp = *pval.p_value;&lt;br /&gt; if ( p_temp&amp;amp;0x01 )&lt;br /&gt; {&lt;br /&gt; do{&lt;br /&gt; err_code = ble_nus_data_send(&amp;amp;m_nus, ble_buffer, &amp;amp;length, m_conn_handle);&lt;br /&gt; if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_NOT_FOUND))&lt;br /&gt; {&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; }&lt;br /&gt; } while (err_code == NRF_ERROR_RESOURCES);&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; if(filter_pointer == FILTER_LENGTH){filter_pointer = false;}&lt;br /&gt; }&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>