<?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>nRF52840 SDK16 - Manipulate BLE Events</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63416/nrf52840-sdk16---manipulate-ble-events</link><description>Hi everyone, 
 I am writting a custom firmware and I am stacked on how to manipulate properly BLE events. First of all I have a handler function that listens for BLE events, If the BLE_GATTS_EVT_WRITE (see ble_gatts.h) is received then I call the on_write</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Aug 2020 09:11:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63416/nrf52840-sdk16---manipulate-ble-events" /><item><title>RE: nRF52840 SDK16 - Manipulate BLE Events</title><link>https://devzone.nordicsemi.com/thread/264798?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 09:11:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bc9c69f-10e7-4055-8848-c0c5aadf78d5</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Glad to hear it Nick, the best of luck with your project &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK16 - Manipulate BLE Events</title><link>https://devzone.nordicsemi.com/thread/264708?ContentTypeID=1</link><pubDate>Sun, 16 Aug 2020 14:39:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53c458f0-68d9-40bf-818e-457a69836db7</guid><dc:creator>Nikosant03</dc:creator><description>&lt;p&gt;Thank you ovrebekk!!&lt;/p&gt;
&lt;p&gt;That solved my issue!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK16 - Manipulate BLE Events</title><link>https://devzone.nordicsemi.com/thread/258675?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2020 17:01:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65445de1-0ca6-4234-bcf1-ad05bd9a3b68</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Nick&lt;/p&gt;
&lt;p&gt;Since you declare the evt variable inside the on_write function it will be an automatic variable,&amp;nbsp;which is located on the call stack. After leaving on_write() it will be removed from the stack, and other variables might be put on the stack in the same memory location.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In order for it to retain it&amp;#39;s value between calls to on_write(..) you should declare it static:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static ble_cus_evt_t evt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>