【发布时间】:2023-12-13 04:31:01
【问题描述】:
我的应用程序目前工作正常,因为我能够从解码 location_and_speed 特征中检索值。但是,我在从蓝牙读取文档以解码/提取设备中的值时遇到困难。
下面是我的代码:
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor
characteristic: CBCharacteristic, error: Error?) {
print(#function)
print(characteristic.value?.count ?? 0)
guard let data = characteristic.value else {return}
let byteArray = [UInt8](data)
// TODO: decode the value to available gps data???
}
任何帮助将不胜感激,谢谢!
【问题讨论】:
-
您要解码哪个蓝牙特性?你能链接到蓝牙网站上的文档吗?
标签: ios swift gps bluetooth-lowenergy cbperipheral