<?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>getting gatts value with nRF51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1287/getting-gatts-value-with-nrf51822</link><description>Hi There, 
 I want the functionality of my device to change when a value is written to a gatt characteristic. I&amp;#39;ve written an event handler that gets called whenever a write is made to the characteristic. This works correctly, but the problem is that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Dec 2015 10:06:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1287/getting-gatts-value-with-nrf51822" /><item><title>RE: getting gatts value with nRF51822</title><link>https://devzone.nordicsemi.com/thread/5927?ContentTypeID=1</link><pubDate>Fri, 18 Dec 2015 10:06:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:544a78b1-a042-4f0b-af45-340277afd448</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;Yes, updated the answer with pointer declaration&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getting gatts value with nRF51822</title><link>https://devzone.nordicsemi.com/thread/5926?ContentTypeID=1</link><pubDate>Fri, 18 Dec 2015 09:58:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d064424-298e-4830-8251-7baee049a945</guid><dc:creator>Maz Shar</dc:creator><description>&lt;p&gt;p_data definition should be like this right?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t * p_data = p_ble_evt-&amp;gt;evt.gatts_evt.params.write.data;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getting gatts value with nRF51822</title><link>https://devzone.nordicsemi.com/thread/5928?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2014 08:29:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4249bc5a-0ad5-43de-8791-a06c0302131c</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;Hi Morgan,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not completely sure of why the chip resets, but it could be because of an assert returned from the stack.&lt;/p&gt;
&lt;p&gt;Instead of resetting the chip in the assert  handler, could you place a breakpoint there and provide information about file and line number where it is failing?&lt;/p&gt;
&lt;p&gt;One of the reasons it could assert is if you do a lot of processing inside the event interrupt, this would be processed in high priority interrupt, and when the stack receive an interrupt it won&amp;#39;t start that one until the processing of the application is done. The best thing is to do is calling the sd_ble_evt_get() in the main context of the application, and only read out events when you have one ready. (like setting a flag in the event interrupt) when there is no event available and no processing to be done you put your application to sleep.&lt;/p&gt;
&lt;p&gt;BR
Pål&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getting gatts value with nRF51822</title><link>https://devzone.nordicsemi.com/thread/5925?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2014 18:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7743b38-4e78-4ab5-b1f5-06ed0434408c</guid><dc:creator>Morgan Redfield</dc:creator><description>&lt;p&gt;Hi Pal,&lt;/p&gt;
&lt;p&gt;I made a service called ble_hex for my application, which is based around the battery measurement service. So ble_hex_evt_t and ble_hex_t are very similar to ble_bas_evt_t and ble_bas_t.&lt;/p&gt;
&lt;p&gt;Thanks for your input about getting the value when receiving the ble_evt_t. I&amp;#39;ll switch to that method of doing things.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m still wondering why the sd_ble_gatts_value_get() call was causing a crash. Any ideas about that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getting gatts value with nRF51822</title><link>https://devzone.nordicsemi.com/thread/5924?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2014 08:10:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:149d062f-5400-49ec-9e57-0ef2f1812eec</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;Hi Morgan,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what the ble_hex_evt_t and ble_hex_t is.&lt;/p&gt;
&lt;p&gt;The best way to get the data from the write event is doing this when receiving the ble_evt_t&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;switch (p_ble_evt-&amp;gt;header.evt_id)
{
    case BLE_GATTS_EVT_WRITE:
        {
            uint8_t * p_data = p_ble_evt-&amp;gt;evt.gatts_evt.params.write.data;
            uint16_t length = p_ble_evt-&amp;gt;evt.gatts_evt.params.write.len;

            new_hex_status = p_data[0];
        }
        break;
    default:
        break;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Update 18.12.2015:
Added pointer declaration to the p_data&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>