some notes about Core bluetooth

Sellen Wei
1 min readSep 16, 2018

--

  1. initialize central manager, check centralManager.state = .powerOn

2. start scanForPeripherals if you want to start scan for Bluetooth devices (must be inside .powerOn state)

3. call stopScan() if you want to stop scan

4. if scan function find any device, will call :

func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral,
advertisementData: [String: Any], rssi RSSI: NSNumber) {
print(peripheral)
}

more details:https://www.raywenderlich.com/231-core-bluetooth-tutorial-for-ios-heart-rate-monitor

--

--