gpt4 book ai didi

ios - 如何在 CoreBluetooth 中使用 CBCharacteristicPropertyBroadcast?

转载 作者:行者123 更新时间:2023-11-29 12:27:57 25 4
gpt4 key购买 nike

我在谷歌上搜索了很长时间,但找不到关于如何在 iOS 上使用此属性的教程。有人可以发布一个小教程或一个链接吗?我真的非常感激!

我正在使用这段代码:

CBMutableCharacteristic *myCharacteristic = [[CBMutableCharacteristic alloc] initWithType:myUUID
properties:CBCharacteristicPropertyBroadcast
value:nil permissions:CBAttributePermissionsReadable];

此崩溃并出现异常:'NSInternalInconsistencyException',原因:'CBCharacteristicPropertyBroadcast is not allowed'

最佳答案

根据 Apple's documentation on the broadcast Characteristic Property

This property is not allowed for local characteristics published via the addService: method of the CBPeripheralManager class. This means that you cannot use this property when you initialize a new CBMutableCharacteristic object via the initWithType:properties:value:permissions: method of the CBMutableCharacteristic class.

关于ios - 如何在 CoreBluetooth 中使用 CBCharacteristicPropertyBroadcast?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28519764/

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