在iOS 7中,一些核心蓝牙设备现在被废弃了,比如CBUUIDGenericAccessProfileString和CBUUIDDeviceNameString。苹果文档状态
"(Deprecated. There are no replacements for these constants.)"我想知道我们应该做什么来取代这些空白的东西,因为苹果的文档和例子是没有帮助的。整个互联网似乎也对此保持沉默。我的代码很像心率监测实例,它仍然有不推荐的代码。
/* GAP (Generic Access Profile) for Device Name */
if ( [aService.UUID isEqual:[CBUUID UUIDWithString:CBUUIDGenericAccessProfileString]] )
{
[aPeripheral discoverCharacteristics:nil forService:aService];
}发布于 2013-11-14 21:49:06
直接使用通用访问服务UUID如何?
if ( [aService.UUID isEqual:[CBUUID UUIDWithString:@"1800"]] )//0x1800 is the Generic Access Service Identifier
{
[aPeripheral discoverCharacteristics:nil forService:aService];
}有关通用接入服务的详细信息,请查看这里。
https://stackoverflow.com/questions/19984314
复制相似问题