gpt4 book ai didi

发现后iOS周边服务还是空的

转载 作者:可可西里 更新时间:2023-11-01 00:59:21 24 4
gpt4 key购买 nike

我正在尝试使用蓝牙我有这样的东西:

func centralManager(central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral) {
Connected = true
TableView.reloadData()
Activityview.stopAnimating()
TabBar.topItem!.rightBarButtonItem = UIBarButtonItem(title: "Suivant", style: UIBarButtonItemStyle.Done, target: nil, action: #selector(Connexion.next))
CM.stopScan()
Scanning = false
Refresh_Button.setTitle("Deconnecté", forState: UIControlState.Normal)
let AlertMessage = UIAlertController(title: "Connecté", message: "Le module est bien connecté", preferredStyle: .Alert)
let ActionAlert = UIAlertAction(title: "Ok", style: .Default) { (action) in }
AlertMessage.addAction(ActionAlert)
self.presentViewController(AlertMessage, animated: true, completion: nil)
peripheral.delegate = self
let servicetoFind = CBUUID(string: "19B10000-E8F2-537E-4F6C-D104768A1214")
peripheral.discoverServices([servicetoFind])
}

我的服务功能:

func peripheral(peripheral: CBPeripheral, didDiscoverServices error: NSError?) {
print("found service")
print(peripheral)
print(peripheral.services)
print(error)
for service in peripheral.services! {
print("Searching for charac...")
peripheral.discoverCharacteristics(nil, forService: service)
}
}

找到我的服务并进入控制台:

found service
<CBPeripheral: 0x13ce1c430, identifier = F39F9D5D-98FE-A350-17BD-21C1185E2089, name = GENUINO 101-1E2D, state = connected>
Optional([])
nil

为什么我的外设服务发现后还是空的,但没有报错?

有什么想法吗?

谢谢!

最佳答案

好吧,我重新启动了我的 iPhone,现在一切正常......谢谢你们!

关于发现后iOS周边服务还是空的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37620722/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com