iOS 7中,一些Core Bluetooth事物现已过时,例如CBUUIDGenericAccessProfileString和CBUUIDDeviceNameString。 苹果文档指出
"(Deprecated. There are no replacements for these constants.)"
我想知道我们应该做什么来替换这些GAP东西,因为苹果的文档和示例没有帮助。整个互联网似乎也对此保持沉默。我的代码基本上就像心率监测器示例一样,还是使用了已被弃用的代码。
/* GAP (Generic Access Profile) for Device Name */
if ( [aService.UUID isEqual:[CBUUID UUIDWithString:CBUUIDGenericAccessProfileString]] )
{
[aPeripheral discoverCharacteristics:nil forService:aService];
}