<?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>Double notifications on multilink example with custom service</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70651/double-notifications-on-multilink-example-with-custom-service</link><description>Hello, I implemented a firmware based on the multilink central example, with a custom service. I am using NRF52832 (custom board) with SDK v15.2 and Softdevice S132 v6.1.0. My setup is the following one. I have two peripherals (peripheral 1 and peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Jan 2021 10:01:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70651/double-notifications-on-multilink-example-with-custom-service" /><item><title>RE: Double notifications on multilink example with custom service</title><link>https://devzone.nordicsemi.com/thread/290430?ContentTypeID=1</link><pubDate>Thu, 21 Jan 2021 10:01:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca2f8bec-f540-4f50-9125-fec3f115845b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello Quentin,&lt;/p&gt;
&lt;p&gt;Glad to hear that my answer made sense, thank you for the update.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Double notifications on multilink example with custom service</title><link>https://devzone.nordicsemi.com/thread/290428?ContentTypeID=1</link><pubDate>Thu, 21 Jan 2021 09:58:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1db015e-a6f6-45af-aea8-83c0e213906c</guid><dc:creator>Quentin CAVAN</dc:creator><description>&lt;p&gt;Hello Vidar, &lt;br /&gt;&lt;br /&gt;Thank you for this very clear answer. &lt;br /&gt;&lt;br /&gt;Indeed, the number of connections I pass to my BLE_&amp;lt;SERVICE&amp;gt;_ARRAY_DEF is 2 in this case, which explains what I called &amp;quot;double notifications&amp;quot; earlier. &lt;br /&gt;&lt;br /&gt;This answers to my question. And I will use the solution you suggested. &lt;br /&gt;&lt;br /&gt;Best regards, &lt;br /&gt;&lt;br /&gt;Quentin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Double notifications on multilink example with custom service</title><link>https://devzone.nordicsemi.com/thread/290313?ContentTypeID=1</link><pubDate>Wed, 20 Jan 2021 14:52:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27960261-5248-4091-9e61-c92bae57b138</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;ble_customservice_c_on_ble_evt() will get called once for every instance of your service event structure, and the p_context pointer will get updated between calls to point to the current event structure. The number of service instances are defined by number of connections you pass to your BLE_&amp;lt;SERVICE&amp;gt;_ARRAY_DEF macro, which I assume is 2 in this case.&lt;/p&gt;
&lt;p&gt;In other words, a single BLE_GATTC_EVT_HVX event will cause your ble_customservice_c_on_ble_evt() to get called twice when you have 2 instances of the service.&lt;/p&gt;
&lt;p&gt;The solution I would suggest is that you add a filter in your ble_customservice_c_on_ble_evt() function to make it return if p_context-&amp;gt;conn_handle is different from p_context-&amp;gt;conn_handle.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>