Jegus
Jegus

Reputation: 165

Core Bluetooth deprecations for iOS 7

In iOS 7, some Core Bluetooth things are now deprecated like CBUUIDGenericAccessProfileString and CBUUIDDeviceNameString. The apple docs state

"(Deprecated. There are no replacements for these constants.)"

I am wondering what we are supposed to do to replace these GAP things, as the apple docs and examples are of no help. The entire internet also seems to be silent about this. My code is pretty much just like the Heart Rate Monitor example which still has the deprecated code

/* GAP (Generic Access Profile) for Device Name */
if ( [aService.UUID isEqual:[CBUUID UUIDWithString:CBUUIDGenericAccessProfileString]] )
{
    [aPeripheral discoverCharacteristics:nil forService:aService];
}

Upvotes: 3

Views: 1539

Answers (1)

Tommy Devoy
Tommy Devoy

Reputation: 13549

How about you just use the Generic Access service UUID directly?

if ( [aService.UUID isEqual:[CBUUID UUIDWithString:@"1800"]] )//0x1800 is the Generic Access Service Identifier
{
    [aPeripheral discoverCharacteristics:nil forService:aService];
}

Check here for details on the Generic Access Service.

Upvotes: 9

Related Questions