<?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>NUS service without service discovery</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71992/nus-service-without-service-discovery</link><description>Hi. 
 I have implemented the Central and Peripheral NUS service on two devices(nRF52). Since the central knows the characteristic values, I would like to bypass service discovery to reduce the time connection. I removed the &amp;quot;ble_db_discovery_start&amp;quot; from</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Aug 2026 19:59:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71992/nus-service-without-service-discovery" /><item><title>RE: NUS service without service discovery</title><link>https://devzone.nordicsemi.com/thread/570704?ContentTypeID=1</link><pubDate>Fri, 28 Aug 2026 19:59:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:905c66ab-4e6f-41ed-bf26-5e5348815ae5</guid><dc:creator>John Waddell</dc:creator><description>&lt;p&gt;Yes, you can bypass &lt;code&gt;ble_db_discovery_start()&lt;/code&gt; if the peripheral&amp;rsquo;s GATT attribute handles are fixed and you already know the correct RX/TX handles. In that case, store the handles in your own structure and use them directly with the GATT client APIs.&lt;/p&gt;
&lt;p&gt;For example, the TX/write characteristic can be used with &lt;code&gt;ble_gattc_write_params_t&lt;/code&gt;, where you set &lt;code&gt;conn_handle&lt;/code&gt;, &lt;code&gt;handle&lt;/code&gt;, &lt;code&gt;write_op&lt;/code&gt;, &lt;code&gt;offset&lt;/code&gt;, and your data buffer. For reads, you can use &lt;code&gt;sd_ble_gattc_read()&lt;/code&gt; with the known characteristic handle.&lt;/p&gt;
&lt;p&gt;The important part is that these handles are only safe to hard-code if the peripheral&amp;rsquo;s GATT database is guaranteed not to change. Nordic&amp;rsquo;s documentation also notes that discovery is what ensures the client is using the correct attribute handles.&lt;/p&gt;
&lt;p&gt;Also, if you need notifications from RX, remember that knowing the characteristic value handle is not enough; you normally need the CCCD handle and must write the appropriate CCCD value to enable notifications.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re also dealing with other hardware/setup work alongside the BLE project, choosing a reliable &lt;a href="https://powerwashinglv.us/" rel="noopener noreferrer" target="_blank"&gt;pressure washing company&lt;/a&gt; is a completely separate consideration, but for this issue I&amp;#39;d focus on manually assigning and using the GATT handles.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS service without service discovery</title><link>https://devzone.nordicsemi.com/thread/297144?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 11:13:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5d3068e-f6e4-49bd-b75f-a95fc6d6281f</guid><dc:creator>Josef80</dc:creator><description>&lt;p&gt;I solved my problem with the following solution.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;void bypass_discovery(ble_nus_c_t * p_ble_nus_c)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ble_nus_c_evt_t nus_c_evt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;memset(&amp;amp;nus_c_evt,0,sizeof(ble_nus_c_evt_t));&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; // the handle values of rx, tx, and ccd may be different in your project.&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;nus_c_evt.handles.nus_rx_handle = 16;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;nus_c_evt.handles.nus_tx_handle = 20;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;nus_c_evt.handles.nus_tx_cccd_handle = 21;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;nus_c_evt.conn_handle = conn_hndl;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;nus_c_evt.evt_type = BLE_NUS_C_EVT_DISCOVERY_COMPLETE;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;p_ble_nus_c-&amp;gt;evt_handler(p_ble_nus_c, &amp;amp;nus_c_evt);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I made the following changes in the BLE_GAP_EVT_CONNECTED case under the ble_evt_handler function.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;case BLE_GAP_EVT_CONNECTED:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;// err_code = ble_db_discovery_start(&amp;amp;m_db_disc, p_ble_evt-&amp;gt;evt.gap_evt.conn_handle);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;//&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bypass_discovery(&amp;amp;m_ble_nus_c);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS service without service discovery</title><link>https://devzone.nordicsemi.com/thread/296793?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 10:16:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:791ed5af-7ea1-4177-be5b-578aefbaa31e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Harry,&lt;/p&gt;
&lt;p&gt;It is a generic application logic that you create a stucture that has characteristic UUID and its handle value as two members. For all the characteristic your application knows, save one entry for each of them with the handle value. When you need to write something, you need to search for the appropriate handle value for the given characteristic.&lt;/p&gt;
&lt;p&gt;simplest_struct {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;uint16_t char_uuid;&lt;br /&gt;uint16_t&amp;nbsp; handle_value;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;The logic of searching through all the available UUIDs to and getting its appropriate handle value should not be hard. I, unfortunately, do not have time to write the actual code&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS service without service discovery</title><link>https://devzone.nordicsemi.com/thread/296710?ContentTypeID=1</link><pubDate>Sun, 28 Feb 2021 19:01:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6af4350-df8d-43f2-8247-d5c3387258e5</guid><dc:creator>Josef80</dc:creator><description>&lt;p&gt;please help me to overcome this problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS service without service discovery</title><link>https://devzone.nordicsemi.com/thread/296283?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 13:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:773cd8a4-4fd6-4bd2-aa32-a5f912f14b5a</guid><dc:creator>Josef80</dc:creator><description>&lt;p&gt;I know that I should map handle value, but I don&amp;#39;t know how to do it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS service without service discovery</title><link>https://devzone.nordicsemi.com/thread/296246?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 12:26:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59b79a3d-3fa7-4c12-b0d6-6bfd8662bfae</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;There is no standard structure that you can use to save the handle values. You need to create one that maps handle value to your characteristic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS service without service discovery</title><link>https://devzone.nordicsemi.com/thread/296189?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 10:08:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0c0631f-f442-4944-9283-96e4a13c5492</guid><dc:creator>Josef80</dc:creator><description>&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;I mean, is there a specific structure to save the necessary values for each connection?&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Which part of the code do I need to change to use these values to receive and send data? The ble_nus_c_evt_handler should be changed?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Could you share a code snippet for this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS service without service discovery</title><link>https://devzone.nordicsemi.com/thread/296168?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 09:11:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c19ae360-c3b6-4c16-b6d0-5f397489e1e8</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;If you want to store anything persistently then you should use flash storage &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_fstorage.html?cp=7_1_3_17"&gt;drivers or libraries.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>