下获取的 “价值” ......从特征
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { print(characteristic) }
..outputs ...
<CBCharacteristic: 0x1700b8180, UUID = FFE1, properties = 0x10, value = <01>, notifying = YES>
我想要的 “值” 部分 “01”。
'characteristic.value'会给一个NSData对象''<01>,但它是由你来是十六进制转换成你想要的值(字符串编码?int值?等等)。 – Larme