IOS Bluetooth CBCharacteristic UUID outdated?

In recent Apple docs, the UUID CBCharacteristic property has a line drawn through it, and a designation that it is only available in 5.0 to 7.1. But the word "outdated" that you usually expect to see is nowhere to be seen.

Moreover, there are no assumptions about how else we can identify the characteristic, for example. when we pass one in the delegate method to the peripheral: didUpdateValueForCharacteristic :. In this method, it is important to decide which characteristic I am dealing with. The descriptor element of the CBCharacteristic instance is zero. What else is there? How does Apple intend to distinguish features? The whole point of the UUID is identification ...

+6
source share
2 answers

Andrei is right, the UUID in iOS8 is now becoming an inherited attribute.
Here is the data from an Apple document. CoreBluetooth changes in iOS8 API are different

CBAttribute.h (Added)

Added CBAttribute
Added CBAttribute.UUID

CBCharacteristic.h

Deleted CBCharacteristic.UUID
Modified CBCharacteristic
Superclasses:
From NSObject to CBAttribute


And many other CoreBluetooth base classes (which contain UUIDs) accept this change

However, the reference to the CBCharacteristic class still says that it inherits from NSObject.

So this is a mistake, and developers can easily understand the UUID as an obsolete attribute in IOS8

+10
source

A look at the headline for CBCharacteristic sheds some light on this. The class no longer has a UUID property, but CBCharacteristic is now a subclass of CBAttribute that has a UUID property. And this (new) parent class is marked as available, starting with iOS 8.

This may explain why the UUID member has a strikethrough, but the warning is not "outdated": you can still get the UUID, but it is inherited, and not directly related to CBAttribute.

+18
source

Source: https://habr.com/ru/post/976179/


All Articles