最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swift - How do I identify which peripheral is my Fitbit using Core Bluetooth in an iOS project? - Stack Overflow

programmeradmin3浏览0评论

Here is my code:

func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
    guard peripheral.identifier != UUID(uuidString: "FEFEA0F0-90D3-BB0A-7732-12ADAB579D77") else {
        return
    }
    
    print("Discovered peripheral: \(peripheral.identifier)")
}

Here is the result in the debug window including when I stopped the debugging:

Discovered peripheral: 49AB5D83-1F40-0B71-9DD0-E51E60AD4BD4
Discovered peripheral: FE0BF3FD-9BCC-B016-A386-ACD063B70927
Discovered peripheral: 42270FB6-518C-EEF2-909A-6B2D77B2F0CF
Discovered peripheral: 49AB5D83-1F40-0B71-9DD0-E51E60AD4BD4
Discovered peripheral: C12736EB-B976-ACAB-BC6F-56FDA73CC7F1
Message from debugger: killed
发布评论

评论列表(0)

  1. 暂无评论