简体   繁体   English

iOS 7中BLE设备的读/写设备名称特征

[英]Reading/writing Device Name characteristic of BLE Device in iOS 7

I want to rename the device name of BLE Device. 我想重命名BLE设备的设备名称。 In iOS 6.1.3, I am able to write the "Device Name" Characteristic of Generic Access Profile Service. 在iOS 6.1.3中,我可以编写通用访问配置文件服务的“设备名称”特征。 But in iOS 7 and later, CBPeripheral is unable to discover the Generic Access Profile Service(1800). 但是在iOS 7及更高版本中,CBPeripheral无法发现通用访问配置文件服务(1800)。

My Question is that Is it possible to read/write Device Name characteristic of BLE Device in iOS 7? 我的问题是,可以在iOS 7中读取/写入BLE设备的设备名称特征吗? If it is possible, then how can I do that? 如果有可能,那我该怎么办? If apple has removed this support in iOS7 and greater, then what is alternate to do this? 如果Apple在iOS7及更高版本中删除了此支持,那么还有什么替代方法呢?

iOS prevents that Service from being usable by a developer. iOS禁止开发人员使用该服务。 Section 3.12 (page 24) documents the fact iOS does not let a developer use that Service (and a couple others) https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf 第3.12节(第24页)说明了iOS不允许开发人员使用该服务(及其他一些服务)的事实, https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf

I ended up making a custom Characteristic that an app could write to. 我最终制作了一个应用程序可以写入的自定义特征。 The firmware would handle that write request and then update the device name and advertising packet. 固件将处理该写请求,然后更新设备名称和广告包。 It's seems hacky, but I wasn't able to find a better solution. 似乎很骇人,但我找不到更好的解决方案。 It's unfortunate that iOS blocks this because it makes it impossible to make a device that is compatible with other apps unless someone makes a separate 'custom device name' standard or something... 不幸的是,iOS阻止了此操作,因为除非有人制定了单独的“自定义设备名称”标准或类似的标准,否则它无法制造与其他应用程序兼容的设备...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM