title: Core Bluetooth, how to determine staleness of detection?
body: <p>Using Core Bluetooth's <a href="https://developer.apple.com/documentation/corebluetooth/cbcentralmanager" rel="nofollow noreferrer">CBCentralManager</a>, one can scan for devices using <code>scanForPeripherals(withServices: [CBUUID]?, options: [String : Any]? = nil)</code>. I can check for devices thanks to the callback <code>centralManager(CBCentralManager, didDiscover: CBPeripheral, advertisementData: [String : Any], rssi: NSNumber)</code>. </p>
  
  <p>Implementing the callback <code>func centralManager(CBCentralManager, didDisconnectPeripheral: CBPeripheral, error: Error?)</code> allows one to detect peripherals disconnecting (unpairing). However, how does one detect an unpaired peripheral which goes down (or moves away) without re-scanning? </p>
  
  <p>Do I need to scan periodically and keep a delta of paired devices?</p>
  
  <p>Do BLE peripherals send a message out when they turn off to warn monitoring devices, or should I assume that a device that is not sending advertising packets is asleep/dead/gone? Does the advertising process follow clear rules I can rely on, or does it depends on the device's manufacturer/firmware writer?</p>