<?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>Building at State Machine that monitors ble evt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3282/building-at-state-machine-that-monitors-ble-evt</link><description>I am trying to only perform calculations for connected ble services. 
 I am implementing a state machine that monitors the ble evt.
I use this for example when to perform calculations required for ble gatt services. 
 As result I need to know which</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Jul 2014 17:28:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3282/building-at-state-machine-that-monitors-ble-evt" /><item><title>RE: Building at State Machine that monitors ble evt</title><link>https://devzone.nordicsemi.com/thread/11979?ContentTypeID=1</link><pubDate>Mon, 28 Jul 2014 17:28:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:faf295cf-1f5b-4a38-acbc-cc61ce7c54f3</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;If the services are using notifications and/or indications to send the calculated data, you can use the value of the Client Characteristic Configuration Descriptor (CCCD) to decide if your calculations are needed or not.&lt;/p&gt;
&lt;p&gt;In the SDK example services, this is usually handled in the ble_*&lt;em&gt;on_ble_evt() for events of the type BLE_GATTS_EVT_WRITE, usually leading to a local on_write() function that again will multiplex the write to a on&lt;/em&gt;*_cccd_write() function if appliccable. For the ble_cscs example, the service will send an BLE_CSCS_EVT_NOTIFICATION_ENABLED signal if the main context has specified an event handler for the service. You can then either use this signal in your main context to enable calculations, or it can be done in the service itself if that&amp;#39;s a better fit for you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>