[英]How can i get Characteristic value in bluetooth peripheral in swift4?
<CBCharacteristic: 0x281bc6100, UUID = FFF1, properties = 0x10, value = <500c0b62 00008f2c 10223344 55660000 00000000>, notifying = NO>
i want this value " <500c0b62 00008f2c 10223344 55660000 00000000>" 我想要这个值“ <500c0b62 00008f2c 10223344 55660000 00000000>”
can any one help me ? 谁能帮我 ?
Try this 尝试这个
if(characteristic.value != nil){
if let ASCIIstring = NSString(data: characteristic.value!, encoding: String.Encoding.utf8.rawValue) {
characteristicASCIIValue = ASCIIstring
print("Value Recieved: \((characteristicASCIIValue as String))")
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.