title: Issues arising when disconnecting a peripheral (TI CC2541) from iOS using corebluetooth
body: <p>When the firmware calls to disconnect the peripheral, my delegate gets called, (<code>didDisconnectPeripheral</code>), after that, I start a timer and I try to reconnect in 5 seconds (the timer has repeats enabled).</p>
  
  <p>My <code>didFailToConnectPeripheral</code> does not get called, and neither does didConnectToPeripheral. After about 30 seconds, the chip automatically reconnects with the app.</p>
  
  <p>Even though I try to call <code>[_manager cancelPeripheralConnection:_peripheral];</code> the board fails to disconnect cleanly.</p>
  
  <p>Does anyone have more information on this "limbo" state that the peripheral finds itself in? I have found these pages: <a href="https://stackoverflow.com/questions/12958711/ios-6-bluetooth-le-disconnect">iOS 6 - Bluetooth LE disconnect</a>  and <a href="https://stackoverflow.com/questions/17792069/ios-corebluetooth-reconnecting-device-with-uuid">iOS CoreBluetooth reconnecting device with UUID</a> and it seems this issue is with Core Bluetooth. Does anyone know how to get around this problem?</p>
  
  <p>I am getting the following error:</p>
  
  <pre><code>Error Domain=CBErrorDomain Code=6 "The connection has timed out unexpectedly." UserInfo=0x1e09c050 {NSLocalizedDescription=The connection has timed out unexpectedly.}
  </code></pre>
  
  <p>The reason I have to disconnect is because the processor on the board is being used up to do other things and hence the radio cannot be kept alive.</p>
  
  <p>Here is the link to the discussion on apple dev forums:
  <a href="https://devforums.apple.com/message/898902" rel="nofollow noreferrer">https://devforums.apple.com/message/898902</a></p>