<?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>Read custom characteristics value in multilink example [central]</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10489/read-custom-characteristics-value-in-multilink-example-central</link><description>Hello! 
 I have a problem with getting a value (uint8_t) from a characteristics. 
 I am using 2 nrf51422 boards, where one is a central and the other is a peripheral. I have modified the multilink example (peripheral) to make an additional characteristic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 May 2016 18:22:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10489/read-custom-characteristics-value-in-multilink-example-central" /><item><title>RE: Read custom characteristics value in multilink example [central]</title><link>https://devzone.nordicsemi.com/thread/39000?ContentTypeID=1</link><pubDate>Thu, 05 May 2016 18:22:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bd8ec41-172a-4f5d-9253-c32e47761f3e</guid><dc:creator>Brook Gebremedhin</dc:creator><description>&lt;p&gt;@Petter ,&lt;/p&gt;
&lt;p&gt;i wanted to read my char value i tried this but it is returning same value even if the char is changed .&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_gatts_hvx_params_t hvx_params;
    memset(&amp;amp;hvx_params, 0, sizeof(hvx_params));
    

       hvx_params.handle = p_our_service-&amp;gt;mycharHandler.value_handle;
        hvx_params.type = BLE_GATT_HVX_NOTIFICATION;
        hvx_params.offset = 0;
        hvx_params.p_len = &amp;amp;len;
        //hvx_params.p_data = (uint8_t *)temperature_value;
        sd_ble_gatts_hvx(p_our_service-&amp;gt;conn_handle, &amp;amp;hvx_params);
      
          printf(&amp;quot; new char:  %d\r\n&amp;quot;, *hvx_params.p_data);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;i wanted to use this function to read my char but not sure how using &lt;code&gt;sd_ble_gattc_read&lt;/code&gt;
is it possible to use sd_ble_gattc_read by passing  &amp;quot;mycharHandler&amp;quot;  ?
can you provide me a sudo code for this ?&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read custom characteristics value in multilink example [central]</title><link>https://devzone.nordicsemi.com/thread/38999?ContentTypeID=1</link><pubDate>Fri, 27 Nov 2015 11:32:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44f29daf-42cd-454c-a717-80f3c903bf2d</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m guessing that you only get the BLE_GATTC_EVT_CHAR_DISC_RSP event once, and because of this sd_ble_gattc_read() is only called once. You can call sd_ble_gattc_read() again when you get the BLE_GATTC_EVT_READ_RSP event. Then it would repeat itself, but you need to make sure that sd_ble_gattc_read() returns NRF_SUCCESS or 0x00000000. If it returns something else, you will not get the BLE_GATTC_EVT_READ_RSP event.&lt;/p&gt;
&lt;p&gt;Notifications are initiated by the server, or peripheral in your case, by calling sd_ble_gatts_hvx() in the server application. Then you will get the BLE_GATTC_EVT_HVX event in the client application. For the server to be able to send notifications, the client first has to enable them by writing 0x0001 to the CCCD of the characteristic you want to send notifications from. In client_handling.c this is done by notif_enable().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read custom characteristics value in multilink example [central]</title><link>https://devzone.nordicsemi.com/thread/38998?ContentTypeID=1</link><pubDate>Fri, 27 Nov 2015 09:47:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce658172-bd7c-4276-87ef-27e037bab9e3</guid><dc:creator>Christian E</dc:creator><description>&lt;p&gt;Hope that you can read the code. The format is not great. Also I&amp;#39;m the a super strong programmer yet, so the answer might be trivial for you.&lt;/p&gt;
&lt;p&gt;Looking forward to your reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read custom characteristics value in multilink example [central]</title><link>https://devzone.nordicsemi.com/thread/38997?ContentTypeID=1</link><pubDate>Fri, 27 Nov 2015 09:46:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5bf47b6-14b7-4e1b-9d4d-badac1a2b60a</guid><dc:creator>Christian E</dc:creator><description>&lt;p&gt;Hi Petter,
thank you for the respond.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve looked at the post you linked me and I have tried to implement it.&lt;/p&gt;
&lt;p&gt;In the &lt;strong&gt;client_handling.c&lt;/strong&gt; file in the &lt;strong&gt;client_handling_ble_evt_handler()&lt;/strong&gt; function i have made to new cases:&lt;/p&gt;
&lt;p&gt;case BLE_GATTC_EVT_CHAR_DISC_RSP:
sd_ble_gattc_read(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,0x0000,0);
break;&lt;/p&gt;
&lt;p&gt;case BLE_GATTC_EVT_READ_RSP:
//DEBUG
z = p_ble_evt-&amp;gt;evt.gattc_evt.params.char_disc_rsp.chars[index].handle_value;		
z = p_client-&amp;gt;client_acc_z_value;
char buffer[20];
sprintf(buffer,&amp;quot;Value is: %d\n\r&amp;quot;,z);
debug_printf(buffer);
break;&lt;/p&gt;
&lt;p&gt;I get one reading in my UART terminal, so my question is why does this only occur once? And how could I make it repeat it self? I want continuous reading as the value from the peripheral is changing.&lt;/p&gt;
&lt;p&gt;I have set the peripheral characteristic up to notify, so maybe I could utilize that?&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read custom characteristics value in multilink example [central]</title><link>https://devzone.nordicsemi.com/thread/38996?ContentTypeID=1</link><pubDate>Thu, 26 Nov 2015 11:21:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7d9ab44-26a0-48d5-ad30-31cd54ab0d38</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Please have a look at &lt;a href="https://devzone.nordicsemi.com/question/52009/identify-characteristic-when-processing-ble_gattc_evt_char_val_by_uuid_read_rsp-event/"&gt;this&lt;/a&gt; question.&lt;/p&gt;
&lt;p&gt;If you have the attribute handle of the characteristic value that you want to read you should use sd_ble_gattc_read().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read custom characteristics value in multilink example [central]</title><link>https://devzone.nordicsemi.com/thread/38995?ContentTypeID=1</link><pubDate>Thu, 26 Nov 2015 10:12:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6449894a-1fdd-4093-8417-44a76b6d9dc5</guid><dc:creator>Christian E</dc:creator><description>&lt;p&gt;Let me know if the code from the peripheral is needed, for how I make the characteristic. I&amp;#39;ll be happy to provide it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>