<?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 to find the handle value?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/759/how-to-find-the-handle-value</link><description>Hi,
I modified the ble_app_hrs sample application with one custom service which includes, some custom characteristics (128 bit uuid), Now the problem i am facing is, i am not getting the correct handle values which are shown in master control panel,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Oct 2013 15:04:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/759/how-to-find-the-handle-value" /><item><title>RE: How to find the handle value?</title><link>https://devzone.nordicsemi.com/thread/3838?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2013 15:04:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecf0c95f-6730-4e2c-a04b-7d0911ad7bfc</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;ve added the two other files as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find the handle value?</title><link>https://devzone.nordicsemi.com/thread/3837?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2013 14:59:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6015380-68a7-4c7d-a75b-5d984c6fee8f</guid><dc:creator>balaji</dc:creator><description>&lt;p&gt;Thanks you morten, please send me the other two files also. And please look at this link and give your suggestion &lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/how-to-test-the-radio-on-the-hardware#reply-236" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/how-to-test-the-radio-on-the-hardware#reply-236&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find the handle value?</title><link>https://devzone.nordicsemi.com/thread/3836?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2013 14:49:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d92304c-1f40-4343-87fd-e6592437f569</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;ve attached the main file, but the modifications from your example is minor, except for removing some of your code and removing the reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find the handle value?</title><link>https://devzone.nordicsemi.com/thread/3835?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2013 14:45:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44152c21-9470-4d64-a068-1b4ffc5bb388</guid><dc:creator>balaji</dc:creator><description>&lt;p&gt;Thank you Morten. If possible please upload the source code with changes you made on it.  It will be somewhat helpful for us to find the exact source of the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find the handle value?</title><link>https://devzone.nordicsemi.com/thread/3834?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2013 14:02:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3554cb42-6c58-40b2-9d0b-5ea8f7fc8487</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Once I fixed your compilation errors by commenting out code, so that a binary was actually generated, I was not able to recreate any problems. I added a case to main.c&amp;#39;s on_ble_evt(), and everything worked as expected. I&amp;#39;d strongly recommend you to do a real clean up of your code, as it seemed extremely messy right now, which might very well be the cause of your problems.&lt;/p&gt;
&lt;p&gt;While developing, you should also make sure to not do a reset in app_error_handler, but instead have an infinite loop so that you can catch errors.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find the handle value?</title><link>https://devzone.nordicsemi.com/thread/3833?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2013 13:25:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba85297e-22d2-4557-92a8-f911301012cc</guid><dc:creator>balaji</dc:creator><description>&lt;p&gt;Thanks for your reply, I uploaded the modified source code, please refer it and give us your suggestion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find the handle value?</title><link>https://devzone.nordicsemi.com/thread/3832?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2013 09:59:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a546a83-9d3e-4460-91ee-73e5b02f197b</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Handles are assigned sequentially from 1, so there is no way that you can have a handle that is 0xB001 (= 45057), since there is simply not enough RAM on the nRF51822 to have that many handles. This issue must therefore stem from something else.&lt;/p&gt;
&lt;p&gt;Can you please upload your complete application, so that I can have a look at it?&lt;/p&gt;
&lt;p&gt;Edit: I&amp;#39;ve now had a look at your code, and adding this to main.c&amp;#39;s on_ble_evt, made it reset on device name writes as expected:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
static void on_ble_evt(ble_evt_t * p_ble_evt)
{
...
    ble_gatts_evt_write_t * write_evt;
...
        case BLE_GATTS_EVT_WRITE:
            write_evt = &amp;amp;p_ble_evt-&amp;gt;evt.gatts_evt.params.write;
            if (write_evt-&amp;gt;handle == 0x03)
            {
                sd_nvic_SystemReset();
            }
            break;
...

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I&amp;#39;d strongly recommend you to clean up your code until you get it working and only then add things back in to see what causes your problem.&lt;/p&gt;
&lt;p&gt;Edit 2: I&amp;#39;ve attached the main file after my modifications, but I haven&amp;#39;t done any effort on fixing the other mess.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1145.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_hrs.c"&gt;ble_hrs.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_hrs.h"&gt;ble_hrs.h&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>