<?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>How to handle a sudden disconnection of the master on the peripheral (NRF8001)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1968/how-to-handle-a-sudden-disconnection-of-the-master-on-the-peripheral-nrf8001</link><description>Hello Nordic team, 
 I am working on a BLE RedBearLab shield (nrf8001) mounted on an Arduino board. 
 Consider that a connection is correctly made from a Master app to my nrf8001 (Peripheral) . The master have already subscribed to an advertising characteristic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Mar 2014 22:20:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1968/how-to-handle-a-sudden-disconnection-of-the-master-on-the-peripheral-nrf8001" /><item><title>RE: How to handle a sudden disconnection of the master on the peripheral (NRF8001)</title><link>https://devzone.nordicsemi.com/thread/8468?ContentTypeID=1</link><pubDate>Thu, 27 Mar 2014 22:20:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcc37fb9-088f-4ef7-93c9-3e947c3ab89d</guid><dc:creator>Omnia</dc:creator><description>&lt;p&gt;hello,&lt;/p&gt;
&lt;p&gt;I am back. After several tests to understand why I don’t have any  DisconnectedEvent on the peripheral side when I stop my iOS/OSX  app (Central side). I was looking from the wrong side, the problem was coming from the Central side and not the one I suspected (Peripheral side).&lt;/p&gt;
&lt;p&gt;I tried on both iOS 7 and Mac OSX 10.9.
It seems that CoreBluetooth keeps alive the connection during severals minutes after the link had been disconnected to the app. In other word the central still maintains a connection even if you stop the app (From the stop button of Xcode) and that’s why there is no DisconnectedEvent on the peripheral side.&lt;/p&gt;
&lt;p&gt;Hope it will help someone.
Thanks for the nordic team support to guide me to understand where was the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle a sudden disconnection of the master on the peripheral (NRF8001)</title><link>https://devzone.nordicsemi.com/thread/8467?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2014 13:18:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b6d2052-350d-4046-92cd-b2c8bda5e0f9</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure I understand what you mean; as I said initially you&amp;#39;ll get a DisconnectedEvent once the Central device goes out of range or disconnects the link in any way, no matter if it crashes, runs out of battery or anything else. At that time, you can restart advertising again by sending the Connect command to the nRF8001. No encryption is needed for this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle a sudden disconnection of the master on the peripheral (NRF8001)</title><link>https://devzone.nordicsemi.com/thread/8466?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2014 20:53:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12640088-634b-4f70-bbfc-ff58662fc202</guid><dc:creator>Omnia</dc:creator><description>&lt;p&gt;Thanks for your answer,&lt;/p&gt;
&lt;p&gt;All your sentences are correct, I mean, it&amp;#39;s what is happening.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I not using any encryption on the link.&lt;/li&gt;
&lt;li&gt;The master has to subscribe again (At each reconnection) to the Characteristics that are Notify or Indicate.&lt;/li&gt;
&lt;li&gt;The subscription has to be done for every connection from the master when encryption is not used.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And effectively, if the master close properly the connection, the peripheral receive an ACI Disconnected Event  to signal that the app has finished.&lt;/p&gt;
&lt;p&gt;However, even if I think I understand what you said, what is the link between this and my problem?
My goal is to receive an event from the peripheral side when I lost the master. To be able to get that, do I have to do an encryption on the link (for example a paring without man-in-the-middle (MITM) protection would work)?&lt;/p&gt;
&lt;p&gt;I am little bite confused about what you call encryption. Do you have any example or document to help me to understand this concept and how it will resolve my problem?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle a sudden disconnection of the master on the peripheral (NRF8001)</title><link>https://devzone.nordicsemi.com/thread/8465?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2014 15:58:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eeddfa11-78af-4047-a443-b89dae453c7c</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;You are using the ble_heart_rate_template , this means that you are not using any encryption on the link. This also means that as soon as the ACI Disconnected Event is received, all subscriptions for Notify and Indicate are cancelled.
This means that the next time the master connects, she will have to subscribe again to the Characteristics that are Notify or Indicate.
When the master subscribes, a ACI Pipe Status Event will be received that shows that the specific Notify pipe is available. The subscription has to be done for every connection from the master when encryption is not used.&lt;/p&gt;
&lt;p&gt;In short: The ACI Disconnected Event can act as the way to signal that the app has finished.&lt;/p&gt;
&lt;p&gt;I hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle a sudden disconnection of the master on the peripheral (NRF8001)</title><link>https://devzone.nordicsemi.com/thread/8464?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2014 13:12:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d124f13-2684-4aa3-bdf4-c550fd9829c1</guid><dc:creator>Omnia</dc:creator><description>&lt;p&gt;Thanks Ole Morten to answer to my question.&lt;/p&gt;
&lt;p&gt;My application (Peripheral) is based on your github :: NordicSemiconducteur/ble-sdk-arduino / libraries / BLE / examples / ble_heart_rate_template /&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;On the Central side I effectively have an alert when the peripheral peripheral goes out of range (iOS app).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;However, on the peripheral(nrf8001) side even if I have a ACI_EVT_DISCONNECTED (0x86) in the loop (aci_loop()) (as you made in  “the ble_heart_rate_template” source code), I don’t have any callback information when I stop my application from the central side.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What/where I should have a look at the code ( ble_heart_rate_template ) to resolve this problem ? What did I do wrong ? What kind of information you need to better answer  to my question ?&lt;/p&gt;
&lt;p&gt;Thanks,
Regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle a sudden disconnection of the master on the peripheral (NRF8001)</title><link>https://devzone.nordicsemi.com/thread/8463?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2014 10:26:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16028821-a95b-4584-b1ac-3c8b84740290</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;If the Central goes out of range or in any other way crashes, you&amp;#39;ll see a DisconnectedEvent (section 26.6. in the nRF8001 Product specification) coming from the nRF8001. Keeping a link alive and well by sending packets is a fundamental part of the BLE specification, so this is not something you need to take care about from the application. Once a conneciton has been established, the Central and the Peripheral will &lt;a href="https://devzone.nordicsemi.com/index.php/what-is-connection-parameters"&gt;exchange packets every connection interval&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When you get this event, you typically want to start advertising again, to make it possible for the Central to reconnect, and this can be done with the Connect command (secton 24.14).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>