title: BLE Scanning for unknown service
body: <p>I'm trying to write a toy app to get up to speed on BLE. I have a peripheral device (it's a <a href="https://www.thetileapp.com/how-it-works" rel="nofollow">Tile</a>) that I would like to scan its services. However, I do not know what services it is offering (and I don't see this anywhere in the product's technical specifications). So, I got a <a href="https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx" rel="nofollow">list of services</a> from the Bluetooth specs, and am trying to scan for all of them. I'm only assuming that this list is exhaustive, since it doesn't say one way or another.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];    
  
      // Scan for all available CoreBluetooth LE devices
      _services = @[[CBUUID UUIDWithString:@"1811"],
                    [CBUUID UUIDWithString:@"1815"],
                    [CBUUID UUIDWithString:@"180F"],
                    [CBUUID UUIDWithString:@"1810"],
                    [CBUUID UUIDWithString:@"181B"],
                    [CBUUID UUIDWithString:@"181E"],
                    [CBUUID UUIDWithString:@"181F"],
                    [CBUUID UUIDWithString:@"1805"],
                    [CBUUID UUIDWithString:@"1818"],
                    [CBUUID UUIDWithString:@"1816"],
                    [CBUUID UUIDWithString:@"180A"],
                    [CBUUID UUIDWithString:@"181A"],
                    [CBUUID UUIDWithString:@"1800"],
                    [CBUUID UUIDWithString:@"1801"],
                    [CBUUID UUIDWithString:@"1808"],
                    [CBUUID UUIDWithString:@"1809"],
                    [CBUUID UUIDWithString:@"180D"],
                    [CBUUID UUIDWithString:@"1823"],
                    [CBUUID UUIDWithString:@"1812"],
                    [CBUUID UUIDWithString:@"1802"],
                    [CBUUID UUIDWithString:@"1821"],
                    [CBUUID UUIDWithString:@"1820"],
                    [CBUUID UUIDWithString:@"1803"],
                    [CBUUID UUIDWithString:@"1819"],
                    [CBUUID UUIDWithString:@"1807"],
                    [CBUUID UUIDWithString:@"1825"],
                    [CBUUID UUIDWithString:@"180E"],
                    [CBUUID UUIDWithString:@"1822"],
                    [CBUUID UUIDWithString:@"1806"],
                    [CBUUID UUIDWithString:@"1814"],
                    [CBUUID UUIDWithString:@"1813"],
                    [CBUUID UUIDWithString:@"1824"],
                    [CBUUID UUIDWithString:@"1804"],
                    [CBUUID UUIDWithString:@"181C"],
                    [CBUUID UUIDWithString:@"181D"]];
  
      CBCentralManager *centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
      [centralManager scanForPeripheralsWithServices:_services options:nil];
      self.centralManager = centralManager;
  }
  
  - (IBAction)scanForDevices:(UIButton *)sender {
      [_centralManager scanForPeripheralsWithServices:_services options:nil];
  }
  
  // CBCentralManagerDelegate - This is called with the CBPeripheral class as its main input parameter.
  // This contains most of the information there is to know about a BLE peripheral.
  - (void)centralManager:(CBCentralManager *)central
   didDiscoverPeripheral:(CBPeripheral *)peripheral
       advertisementData:(NSDictionary *)advertisementData
                    RSSI:(NSNumber *)RSSI
  {
      NSString *localName = [advertisementData objectForKey:CBAdvertisementDataLocalNameKey];
      if ([localName length] &gt; 0) {
          NSLog(@"Found the heart rate monitor: %@", localName);
          [self.centralManager stopScan];
          _hRMPeripheral = peripheral;
          peripheral.delegate = self;
          [self.centralManager connectPeripheral:peripheral options:nil];
      }
  }
  
  // method called whenever the device state changes.
  - (void)centralManagerDidUpdateState:(CBCentralManager *)central
  {
      // Determine the state of the peripheral
      if ([central state] == CBCentralManagerStatePoweredOff) {
          NSLog(@"CoreBluetooth BLE hardware is powered off");
      }
      else if ([central state] == CBCentralManagerStatePoweredOn) {
          NSLog(@"CoreBluetooth BLE hardware is powered on and ready");
      }
      else if ([central state] == CBCentralManagerStateUnauthorized) {
          NSLog(@"CoreBluetooth BLE state is unauthorized");
      }
      else if ([central state] == CBCentralManagerStateUnknown) {
          NSLog(@"CoreBluetooth BLE state is unknown");
      }
      else if ([central state] == CBCentralManagerStateUnsupported) {
          NSLog(@"CoreBluetooth BLE hardware is unsupported on this platform");
      }
  }
  </code></pre>
  
  <p>The only log output that I get is this:</p>
  
  <blockquote>
    <p>CoreBluetooth BLE hardware is powered on and ready</p>
  </blockquote>
  
  <p>Otherwise, the app runs fine. No errors or warnings. But it never finds the peripheral device. </p>
  
  <p>What am I doing wrong? Is there a different service that I should be scanning for? </p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong><br>
  Using a suggestion below, I scanned the peripheral using the LightBlue app. I now know that there is an advertised service that uses this UUID:</p>
  
  <blockquote>
    <p>84100CBF-D622-8FF7-C8B8-300FDB52B92D</p>
  </blockquote>
  
  <p>I changed my array to look like this:</p>
  
  <pre><code>_services = @[[CBUUID UUIDWithString:@"84100CBF-D622-8FF7-C8B8-300FDB52B92D"]];
  </code></pre>
  
  <p>but still nothing gets output in the log. I also tried passing <code>nil</code> but still nothing.</p>