title: iOS CoreBluetooth reconnecting device with UUID
body: <p>I have a Bluetooth 4.0 (BLE) device using the CC2541 chipset which I am interfacing with via the iOS Core Bluetooth Framework.</p>
  
  <p>I can successfully make a connection to the device using Core Bluetooth when the device is in a discoverable/advertising mode and transfer data to and from the device without any problem.</p>
  
  <p>I maintain a collection of device UUIDs that I have connected with and I am now attempting to connect to one of these devices again using:</p>
  
  <pre><code>CBCentralManager 
  - (void)retrievePeripherals:(NSArray *)peripheralUUIDs
  </code></pre>
  
  <p>Calling this function appears to work and I receive a callback to my implementation of the the following function:</p>
  
  <pre><code>CBCentralManagerDelegate 
  - (void)centralManager:(CBCentralManager *)central didRetrievePeripherals:(NSArray *)peripherals
  </code></pre>
  
  <p>The device I'm attempting to connect with is the one and only peripheral listed in the peripherals array that is passed to this function.</p>
  
  <p>When I then attempt to connect to this device using my connect function (shown below) the connection will not initiate and I get no callbacks at all on either the CBCentralManagerDelegate or the CBPeripheralDelegate.</p>
  
  <pre><code>- (void) connectPeripheral:(CBPeripheral *)peripheral {
      NSLog(@"Connecting to peripheral with UUID : %s\r\n",[self UUIDToString:peripheral.UUID]);
      activePeripheral = peripheral;
      activePeripheral.delegate = self;
      [CM connectPeripheral:activePeripheral options:nil];
  }
  </code></pre>
  
  <p>I can make the connection go through successfully, as described above, if I first place the device into discoverable/advertising mode, but this is not a workable solution. The device must allow reconnection without it being placed into discoverable mode.</p>
  
  <p>I did note the answer given to this question <a href="https://stackoverflow.com/questions/17575949/corebluetooth-what-is-the-lifetime-of-unique-uuids">CoreBluetooth: What is the lifetime of unique UUIDs</a> suggests I need to pair/bond the BLE device with the iOS device but that this may be dependent on the BLE chipset, the device I'm using is the CC2541. Any advice on how to go about pairing with the device would be most useful, or indeed whether this is a necessary step. I have attempted to watch <a href="https://developer.apple.com/videos/wwdc/2012/?id=705" rel="nofollow noreferrer">WWDC 2012: Advanced Core Bluetooth</a> which might give me some assistance, but since Apple were hacked on Thursday I'm not able to access my acccount to watch the video.</p>
  
  <p>Please let me know if any more details are required. The Bluetooth device is stable, but it is being developed internally. If changes may be required to the firmware to assist with the pairing process, I can pass this information along to the electronics team.</p>