title: Why does iOS bluetooth discover the same device more than once?
body: <p>I'm trying to discover a heart rate monitor with this statement:</p>
  
  <pre><code>[self.centralManager scanForPeripheralsWithServices:@[[CBUUID UUIDWithString:SERVICE_HR]] options:@{@"CBCentralManagerScanOptionAllowDuplicatesKey":@NO} ];
  </code></pre>
  
  <p>SERVICE_HR is defined to be the heart rate service number.</p>
  
  <p>As I read the documentation the option I gave means to coalesce all discoveries of the same device into a single discovery event. I'm scanning for 2.2 seconds with only one heart rate monitor available and getting 2 or 3 discoveries. Since the HR monitor advertises once per second that makes sense if every advertisement is "discovered" separately. I get the following callback 2 or 3 times:</p>
  
  <pre><code> (void)centralManager:(CBCentralManager *)central
   didDiscoverPeripheral:(CBPeripheral *)peripheral
       advertisementData:(NSDictionary *)advertisementData
                    RSSI:(NSNumber *)RSSI
  </code></pre>
  
  <p>I save the data from each callback into a mutable array. Here is the array with two discoveries:</p>
  
  <pre><code>(lldb) po [RCLBTLE sharedBTLE].discoveredPeripherals
  &lt;__NSArrayM 0x17404bc70&gt;(
  &lt;CBPeripheral: 0x1700f8180, identifier = 1DC9167F-6DB8-4216-5217-B1E8B2F3FB90, name = Polar H7 3F1DE71C, state = disconnected&gt;,
  &lt;CBPeripheral: 0x1700f8180, identifier = 1DC9167F-6DB8-4216-5217-B1E8B2F3FB90, name = Polar H7 3F1DE71C, state = disconnected&gt;
  )
  </code></pre>
  
  <p>As you can see the same device was discovered twice but I think it should have been discovered only once. What am I doing wrong? Or what am I misunderstanding?</p>