从外围设备更改CBAdvertisementDataManufacturerDataKey [英] Changing CBAdvertisementDataManufacturerDataKey from peripheral

查看:412
本文介绍了从外围设备更改CBAdvertisementDataManufacturerDataKey的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从 CBPeripheralManager 修改 CBAdvertisementDataManufacturerDataKey ?我知道我可以从 CBCentralManager 获取 CBAdvertisementDataManufacturerDataKey

Is there any way to modify CBAdvertisementDataManufacturerDataKey from CBPeripheralManager? I understand I can get the CBAdvertisementDataManufacturerDataKey from CBCentralManager.

之所以这样做,是因为我希望外围设备在不求助于中央连接的情况下公布10字节的值,发现服务,然后读取包含10字节值的特征。

The reason I want to do this is because I want the peripheral to advertise a 10-byte value without resorting to having the central connect to it, discover services, and then reading a characteristic which would contain the 10-byte value.

推荐答案

否,从iOS 7开始目前无法实现。制造商数据由Apple保留且不可修改(至少在非-越狱设备)。如果您要为自己的外围设备编写固件,这将不是问题。但是,由于CoreBluetooth API位于Apple实际实施的iOS ble固件之上,因此我们面临它们实际公开内容的限制。不过,您可以考虑宣传自己的定制服务,并显示与制造商数据相同的价值。

No, this is currently not possible as of iOS 7. The Manufacturer Data is reserved by Apple and is unmodifiable (at least on non-jailbroken devices). If you were writing the firmware for your own peripheral, this would not be a problem. But since the CoreBluetooth api is a layer above Apple's actual implementation of the iOS ble firmware, we face the limitations of what they actually expose. You may consider advertising you own custom service and displaying the same value you would have put in the manufacturer data, however.

这篇关于从外围设备更改CBAdvertisementDataManufacturerDataKey的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆