<?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>Device manager timeout handler and related event</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8411/device-manager-timeout-handler-and-related-event</link><description>Hi, 
 I&amp;#39;m using device manager for bonding starting from a sample application in the SDK. 
 I see that the DM_EVT_CONNECTION is raised before the BLE_GAP_EVT_CONNECTED but the dm event handler needs to start a timer for securing the link because it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Jul 2015 12:54:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8411/device-manager-timeout-handler-and-related-event" /><item><title>RE: Device manager timeout handler and related event</title><link>https://devzone.nordicsemi.com/thread/30558?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 12:54:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:925116bf-9c2d-482d-8afc-1c77456163ff</guid><dc:creator>ppatierno</dc:creator><description>&lt;p&gt;Thank you very much Aryan !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device manager timeout handler and related event</title><link>https://devzone.nordicsemi.com/thread/30557?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 12:51:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70fa542c-95c2-43e0-9eac-690006c45f0c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I think the security of the link does not effect the service discovery. you can do a service discovery on both secure and open link. This is ok as service discovery information is meant to be public. After having some thinking, I am not really sure for the reason of this delay. I will have to dig more into apple specifications. I do not have the setup to try it here, my opinion is it should just work fine if you do not use this delay and start the security setup immediately&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device manager timeout handler and related event</title><link>https://devzone.nordicsemi.com/thread/30556?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 11:48:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b5ccaca-9b6e-4935-8381-efe60f07436b</guid><dc:creator>ppatierno</dc:creator><description>&lt;p&gt;I lost this point ... it means that the service discovery starts and is executed before the link is secure ? If I avoid the delay and execute setup security without time what happens to the service discovery ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device manager timeout handler and related event</title><link>https://devzone.nordicsemi.com/thread/30555?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 11:44:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e96b0d6-f0ae-41cb-ae26-cf054359a790</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;it usually suggested to delay sending security request because we should allow the client to finish service discovery, I am actually not sure why this example has made it as a requirement, I will have to dig into it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device manager timeout handler and related event</title><link>https://devzone.nordicsemi.com/thread/30554?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 11:43:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:413785d1-dae7-4e27-bf1a-f1175d1b4685</guid><dc:creator>ppatierno</dc:creator><description>&lt;p&gt;Just because I&amp;#39;m so curious but why in this example the security setup was delayed ? You said it&amp;#39;s a mistake but IMHO setup a timer and execute security inside it seems to be an action that the developer wanted (not just a mistake).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device manager timeout handler and related event</title><link>https://devzone.nordicsemi.com/thread/30553?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 11:38:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9898d38-dc1d-4c23-9628-ac0d220c3d70</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I see your point, The security setup was delayed by 1500ms (SECURITY_REQUEST_DELAY) and luckily the m_conn_handle was updated before the app_timer call back was called. This is a mistake (not a bug) in ANCS example but this but will never get triggered because m_conn_handle gets updated in time. Like I said, you can fix this by updating the m_conn_handle in DM_EVT_CONNECTION.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device manager timeout handler and related event</title><link>https://devzone.nordicsemi.com/thread/30552?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 11:32:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d54e68a-04d7-42d9-a8ad-4e916affb853</guid><dc:creator>ppatierno</dc:creator><description>&lt;p&gt;Thanks for the reply Aryan !&lt;/p&gt;
&lt;p&gt;I started from ANCS example and the code is made in this way (you know it better than me) : dm_event_handler that starts timeout timer (in the DM_EVT_CONNECTION event) to setup the security on the link instead of execute it in the dm_event_handler itself.&lt;/p&gt;
&lt;p&gt;Why ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device manager timeout handler and related event</title><link>https://devzone.nordicsemi.com/thread/30551?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 11:29:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cca2c65-7e7a-403e-b224-2175c9d1d24f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi ppatierno,&lt;/p&gt;
&lt;p&gt;In most of our examples we did not have the dependency of the order in which the event_handlers for modules are called. If your example needs that m_conn_handle needs to be update in dm_event_handler then you can update it by just adding something like this&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case DM_EVT_CONNECTION:
    m_conn_handle = p_event-&amp;gt;event_param.p_gap_param-&amp;gt;conn_handle;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The requirement of the order in examples is depending on particular use case.&lt;/p&gt;
&lt;p&gt;or even change the order in which the event handlers are called inside &lt;code&gt;ble_evt_dispatch&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>