<?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>Duplicate Events - Periph + Central Database Discovery SDK14</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30539/duplicate-events---periph-central-database-discovery-sdk14</link><description>I am moving an SDK12 peripheral nus + central nus application to SDK14. 
 I am following the ble_app_hrs_rscs_relay example for SDK14 on how to setup the dual role ble event dispatching, but i am getting duplicate nus-c discovery events when I start the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Feb 2018 18:26:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30539/duplicate-events---periph-central-database-discovery-sdk14" /><item><title>RE: Duplicate Events - Periph + Central Database Discovery SDK14</title><link>https://devzone.nordicsemi.com/thread/121841?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2018 18:26:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e7eec44-4742-4ace-9ddd-2b2e97c10ab1</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;One issue that has come up from the SDK14 and the way it handles the events to the services is that my NUS Central was receiving events from the NUS Peripheral.&lt;/p&gt;
&lt;p&gt;I added this to my&amp;nbsp;&lt;em&gt;ble_nus_c_on_ble_evt&lt;/em&gt;.&amp;nbsp; I did the opposite for the&amp;nbsp;&lt;em&gt;ble_nus_on_ble_evt.&amp;nbsp;&amp;nbsp;&lt;/em&gt;Perhaps there is a recommended my to do this other than this but this seems to work for me.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    uint16_t conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
    uint16_t role = ble_conn_state_role(conn_handle);

    // Based on the role this device plays in the connection, dispatch to the right handler.
    if (role == BLE_GAP_ROLE_PERIPH )
    {
        return;
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Duplicate Events - Periph + Central Database Discovery SDK14</title><link>https://devzone.nordicsemi.com/thread/121123?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 17:51:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2e6181a-83cf-4ba3-97fc-95f0530f533e</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;Edvin,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Thanks, that is helpful to understand how the events are being setup using the macros.&lt;/p&gt;
&lt;p&gt;The issue I believe was that I used the BLE_DB_DISCOVERY_ARRAY_DEF(m_ble_db_discovery, 2);from the dual mode example&amp;nbsp;when I should have just used the single discovery instance of&amp;nbsp;LE_DB_DISCOVERY_DEF(m_ble_db_discovery);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Duplicate Events - Periph + Central Database Discovery SDK14</title><link>https://devzone.nordicsemi.com/thread/120948?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2018 10:09:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc67bb02-c7bf-4af6-9408-33d0f3a90203</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;If you look in the SDK14\examples\ble_central\ble_nuc_c example you can see that there is no function called ble_event_handler. There is also no dispatch function, like there was in the older SDKs.&lt;/p&gt;
&lt;p&gt;From SDK14.0.0, the&amp;nbsp;instances are initialized in the macros near the top of the main.c file, such as BLE_NUS_C_DEF(m_ble_nus_c). You can see in the definition of this macro(in ble_nus_c.h), that the event handler is set here, ble_nus_c_on_ble_evt(). Therefore, you do not need to include the ble_nuc_c_on_ble_evt() function in ble_event_handler(). It is already set up when you initialize the ble_nuc_c instance in the BLE_NUS_C_DEF macro.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>