<?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>How do I get my DK to Read character values</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12626/how-do-i-get-my-dk-to-read-character-values</link><description>Hi,
i am having some trouble getting my nRF52 DK (S132) to read a value provided by the nRF51 dongle(S130).
First of all, i am very new to this whole Bluetooth thing so i&amp;#39;ve done all the tutorials, tried some things and had fun - so far. But now im</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 19 Mar 2016 16:51:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12626/how-do-i-get-my-dk-to-read-character-values" /><item><title>RE: How do I get my DK to Read character values</title><link>https://devzone.nordicsemi.com/thread/47962?ContentTypeID=1</link><pubDate>Sat, 19 Mar 2016 16:51:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c496e4d-92c8-4a77-b03b-e4fcd6a98d33</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;you had to change what type in what variable where? It&amp;#39;s really not very clear what didn&amp;#39;t compile, but if it didn&amp;#39;t compile,it&amp;#39;s probably a mistake and changing it is probably another mistake.&lt;/p&gt;
&lt;p&gt;BLE_UUID_CHARACTERISTIC is definitely wrong, look at the documentation for that structure, it takes a few things, none of them that. If it&amp;#39;s a standard UUID it&amp;#39;s 	BLE_UUID_TYPE_BLE  else it&amp;#39;s something returned by the function which registered the custom uuid. In your case it&amp;#39;s most likely the latter as you&amp;#39;re using a custom UUID.&lt;/p&gt;
&lt;p&gt;So call the function, with the correct parameters, and wait for the reply to come back, then process the reply. If the reply says nothing, you sent the wrong question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get my DK to Read character values</title><link>https://devzone.nordicsemi.com/thread/47961?ContentTypeID=1</link><pubDate>Sat, 19 Mar 2016 16:26:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d80138b-0c57-440c-a335-590dbe680481</guid><dc:creator>selle</dc:creator><description>&lt;p&gt;ok, i now set up this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define READ_CHAR1_UUID 								 0x900A                                  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;const ble_uuid_t CHAR1 = {READ_CHAR1_UUID, BLE_UUID_CHARACTERISTIC};						
const ble_gattc_handle_range_t CHAR1_RANGE = {0,65535};&lt;/p&gt;
&lt;p&gt;with that, i can call&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sd_ble_gattc_char_value_by_uuid_read(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle,&amp;amp;CHAR1,&amp;amp;CHAR1_RANGE);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;inside the &lt;code&gt;static void on_ble_evt()&lt;/code&gt; in main.c without getting compilation error, but i had to change the variable type for the uuid type from uint8 to uint16.... so im not sure if that&amp;#39;s correct XD. I then stumbled across this &lt;a href="https://devzone.nordicsemi.com/question/40289/read-the-characteristic-value/"&gt;Read Value&lt;/a&gt;
I tried to use this, but i could need a bit more details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get my DK to Read character values</title><link>https://devzone.nordicsemi.com/thread/47960?ContentTypeID=1</link><pubDate>Sat, 19 Mar 2016 13:43:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b5cb8d7-18bb-475f-8378-8f4eafc8969b</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;ok well if you&amp;#39;re connected then there&amp;#39;s your conn_handle, just hold onto it, so you have that.&lt;/p&gt;
&lt;p&gt;For handle range just give it 0-65535 and it will return the first however many values with entries matching the UUID, which will probably be one I expect. You can have multiple of the same UUID in the database so you send in 0-65535 and then, after you get your reply, whatever the last handle was you add 1 to it, and ask again. When you get no more back, you have all of them. In your case you&amp;#39;ll likely get one reply with one handle as you only have one value.&lt;/p&gt;
&lt;p&gt;However it&amp;#39;s usually better to use one of the service discovery procedures to find the service you want, the characteristics it has and hold onto the handles, then you just read the value by handle. But what you&amp;#39;re doing is ok. It will also return you the handle so you can cache it there and use it next time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get my DK to Read character values</title><link>https://devzone.nordicsemi.com/thread/47959?ContentTypeID=1</link><pubDate>Sat, 19 Mar 2016 13:34:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f507422-c9c0-44a2-8d95-f8d4d323836a</guid><dc:creator>selle</dc:creator><description>&lt;p&gt;Thanks for the quick answer. My boards do connect, as i get a BLE_GAP_EVT_CONNECTED. Both Boards also indicate this by lighting up LED1. I think my problem is step 4, central side. When calling the sd_ble_gatts_char_value_by_uuid_read i guess the argument uuid is the uuid from my character i want to read, but what about the handle range?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get my DK to Read character values</title><link>https://devzone.nordicsemi.com/thread/47958?ContentTypeID=1</link><pubDate>Sat, 19 Mar 2016 13:20:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8f120ab-0365-4968-89be-8f4b8b3554cd</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well you have all the peripheral stuff done on one board, now you need to implement the other side of it, the central side, on the DK board. For that you should look at some of the central examples.&lt;/p&gt;
&lt;p&gt;You say you don&amp;#39;t know where the connection handle comes from, well you get that after you connect, have you connected, I&amp;quot;d guess you haven&amp;#39;t else you&amp;#39;d have seen the conn_handle come flying past.&lt;/p&gt;
&lt;p&gt;So for peripherals you&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set up the GATT database&lt;/li&gt;
&lt;li&gt;Set the GAP options&lt;/li&gt;
&lt;li&gt;Start advertising&lt;/li&gt;
&lt;li&gt;(optionally) handle read and write requests if your GATT database is dynamic and requires that&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;on the central side you&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the GAP options&lt;/li&gt;
&lt;li&gt;Start scanning for advertisers until you find one you want&lt;/li&gt;
&lt;li&gt;Connect to it (you can actually skip 2 and go right to 3. if you know what you want to connect to)&lt;/li&gt;
&lt;li&gt;Query the GATT database on the peripheral to find the handles&lt;/li&gt;
&lt;li&gt;Send read and write requests.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It sounds like you&amp;#39;ve skipped straight to 5 without doing 1-4. That message sequence chart you refer to, that&amp;#39;s one of the correct ones, by UUID works ok (also getting the handle first and then reading by handle works). Note the very top of it, the big rounded box says &amp;#39;connection established&amp;#39;. Now if you look in the GAP message sequences you&amp;#39;ll see the charts for how a central scans for and connect to the peripheral it wants to talk to.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get my DK to Read character values</title><link>https://devzone.nordicsemi.com/thread/47957?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2016 11:42:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34685807-e988-41c8-8f6d-e3f7551efc30</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I recommend you to start off with ble_app_uart and ble_app_uart_c, or ble_app_hrs and ble_app_hrs_c. It is also difficult to determine if what you are doing is correct or not, since you haven&amp;#39;t included what you are actually doing. You general approach seems correct though. Maybe you can edit your question, and add some more information?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>