【发布时间】:2019-10-12 09:33:20
【问题描述】:
我正在开发一个 BLE 外围应用。根据要求,广告数据包必须包含服务数据字段。我在Android中做过这个,数据包应该是这样的:
0x16 是此处列出的服务数据字段https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/
同样的事情,我在 iOS 中也是如此。我使用 BluetoothCore 框架来实现蓝牙外设。
下面是我应该用来设置服务数据字段值的属性:
advertisementData[CBAdvertisementDataServiceDataKey] = <somedata>
但是我收到了警告:
警告:不允许使用广告密钥“服务数据”
谁能告诉我为什么以及解决方案是什么?
【问题讨论】:
标签: ios bluetooth-lowenergy core-bluetooth ios-bluetooth