<?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>Reading characteristic data in central</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61244/reading-characteristic-data-in-central</link><description>Hi, 
 I am using a ble_app_blinky example (SDK16) to communicate with the BLE devices. NRF52840 is connected with the client devices and successfully sending the data to the client which is connected to NRF52840. Now, how to read the characteristics data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 May 2020 13:00:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61244/reading-characteristic-data-in-central" /><item><title>RE: Reading characteristic data in central</title><link>https://devzone.nordicsemi.com/thread/249736?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:00:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f658abd-6280-4dff-9e7c-6741cf06bc0d</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Nishanth_M"]Thanks for your reply......[/quote]
&lt;p&gt;No problem at all, I am happy to help.&lt;/p&gt;
[quote user="Nishanth_M"]Now the client gets the READ request, but how to view the data or get the data in NRF52840 which i received from the client. What I need to do now....Help me to solve this problem....[/quote]
&lt;p&gt;From this I assume that you have seen the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_ble_gatt_queue.html"&gt;GATT Queue documentation&lt;/a&gt;?&amp;nbsp;&lt;br /&gt;As stated in the documentation, your call to nrf_ble_gq_item_add will queue a read request for execution immediately once the SoftDevice is available to do so. When the read request then is issued, the function &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_c___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga813daa5810a1d2ed31d2d6fe49d3ef11"&gt;sd_ble_gattc_read&lt;/a&gt; is actually called - which generates a &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___b_l_e___g_a_t_t_c___e_n_u_m_e_r_a_t_i_o_n_s.html#ggafd9b8b42eeb832d688e33f4561f97efca2355be2e3b5c9bd1c235f7abbc56ef6d"&gt;BLE_GATTC_EVT_READ_RSP&lt;/a&gt; event. This event contains the data responded by the peripheral to the read request. You therefore need to make sure that your event handler handles this event, in order to receive the data.&lt;br /&gt;&lt;br /&gt;Is this what you were looking for?&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: Reading characteristic data in central</title><link>https://devzone.nordicsemi.com/thread/249575?ContentTypeID=1</link><pubDate>Tue, 12 May 2020 19:51:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1d3ffa7-3723-48b7-9a3e-303b8a2e47e8</guid><dc:creator>Nishanth_M</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your reply......&lt;/p&gt;
&lt;p&gt;I have tried the following:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;nrf_ble_gq_req_t read_req;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; memset(&amp;amp;read_req, 0, sizeof(nrf_ble_gq_req_t));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; read_req.type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = NRF_BLE_GQ_REQ_GATTC_READ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; read_req.error_handler.cb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = gatt_error_handler;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; read_req.error_handler.p_ctx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = p_ble_lbs_c;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; read_req.params.gattc_read.handle&amp;nbsp;&amp;nbsp; = p_ble_lbs_c-&amp;gt;peer_lbs_db.button_handle;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; read_req.params.gattc_read.offset&amp;nbsp;&amp;nbsp; = 0;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;err_code = nrf_ble_gq_item_add(p_ble_lbs_c-&amp;gt;p_gatt_queue, &amp;amp;read_req, p_ble_lbs_c-&amp;gt;conn_handle);&lt;/p&gt;
&lt;p&gt;Now the client gets the READ request, but how to view the data or get the data in NRF52840 which i received from the client. What I need to do now....Help me to solve this problem....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading characteristic data in central</title><link>https://devzone.nordicsemi.com/thread/249254?ContentTypeID=1</link><pubDate>Mon, 11 May 2020 15:13:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6f0f818-8636-428a-bd7b-5163ec1c551e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Have you looked into using notifications for this purpose?&lt;br /&gt;This way, you will not have to read the buffer to discover that it is unchanged - but rather the central might receive a notification once the contents of the buffer is changed.&lt;br /&gt;That way, you could also make use of &amp;quot;slave latency&amp;quot;, which allows the slave to skip connection intervals if the data is not updated - significantly decreasing radio time and battery consumption.&lt;br /&gt;To do this, you will need to make sure that the central device has notifications enabled.&lt;br /&gt;&lt;br /&gt;As an example, you could see the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_hrs.html"&gt;HRS peripheral example&lt;/a&gt;, which uses notifications to send its heart rate measurements.&lt;br /&gt;In the example, there is a timer that triggers the&amp;nbsp;&lt;em&gt;heart_rate_meas_timeout_handler&amp;nbsp;&lt;/em&gt;which in turn calls&amp;nbsp;&lt;em&gt;ble_hrs_heart_rate_measurement_send&lt;/em&gt; that uses the SoftDevice function &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;sd_ble_gatts_hvx&lt;/a&gt;&amp;nbsp;to actually perform the notification.&lt;/p&gt;
&lt;p&gt;For how &amp;#39;notifications&amp;#39; work, please take a look at&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.1.1/group___b_l_e___g_a_t_t_s___h_v_n___m_s_c.html"&gt;this&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;message sequence chart. For how &amp;#39;read&amp;#39; works, please take a look at&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.1.1/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___n_o___a_u_t_h___m_s_c.html"&gt;this&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;message sequence chart.&lt;br /&gt;&lt;br /&gt;If you would like to proceed with using the read function, please see the&amp;nbsp;&lt;em&gt;sd_ble_gattc_read&amp;nbsp;&lt;/em&gt;function and its documentation &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_ble_gatt_queue.html"&gt;here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>