我正在尝试将一些数据从 iOS 设备发送到连接到 arduino 的 HM-10 蓝牙 LE 模块。问题是连接到模块后discoverServices
没有返回服务的特征。
func peripheral(peripheral: CBPeripheral, didDiscoverServices error: NSError?) {
if(error != nil) {
print(error?.description)
}
for service in peripheral.services! {
let thisService = service as CBService
print("Service: \(thisService.description)")
print("Characteristic: \(thisService.characteristics)")
}
}
这输出:
Service: <CBService: 0x137e84ea0, isPrimary = YES, UUID = FFE0>
Characteristic: nil
我是这个 arduino 和 iOS 的初学者。所以任何建议都会受到欢迎。也许有一种方法可以在不知道特性的情况下写入蓝牙模块......我不知道。