5

I want to read information of an accessory, typed HMAccessory, such as Serial number (HMCharacteristicTypeSerialNumber), manufacturer (HMCharacteristicTypeManufacturer), model (HMCharacteristicTypeModel) but they all are deprecated in iOS11, according to this Apple doc here.

I know I can instead use the characteristicType string directly, like below:

HMCharacteristicTypeSerialNumber -> 00000030-0000-1000-8000-0026BB765291

HMCharacteristicTypeManufacturer -> 00000020-0000-1000-8000-0026BB765291

HMCharacteristicTypeModel-> 00000021-0000-1000-8000-0026BB765291

But that just makes my code "unconventional", ugly.

Do you know the replacements for the characteristic types of serial number, manufacturer and model? I have searched for hours but still no clues.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
quanguyen
  • 1,443
  • 3
  • 17
  • 29
  • My assumption on these being deprecated is not just that the Characteristic -> UUID mapping will disappear in the future, but that asking for those UUIDs would no longer return valid results. I don't have any answer yet, unfortunately. – escrafford Apr 05 '18 at 18:46

1 Answers1

0

As you noted, as of iOS 11.0, those characteristicTypeconstants have been deprecated. Access to manufacturer, model, and firmware version info is now obtained through the newer HMAccessory properties manufacturer, model, and firmwareVersion.

For example:

print("Manufacturer: \(accessory.manufacturer)")
print("Model: \(accessory.model)")
print("Firmware Version: \(accessory.firmwareVersion)")

However, as far as I can see, while HMCharacteristicTypeSerialNumber has also been deprecated, there isn't any property on HMAccessory to access this info so far.

Ashwin
  • 2,317
  • 1
  • 15
  • 5
  • Any Apple documentation or links available as to why no properties have been added to access "HMCharacteristicTypeSerialNumber" ? – subin272 Oct 25 '19 at 18:38