【问题标题】:iOS- BLE <CBCharacteristic: does not specify the "Write Without Response" property - ignoring response-less writeiOS-BLE <CBCharacteristic:未指定“无响应写入”属性 - 忽略无响应写入
【发布时间】:2018-06-13 08:55:49
【问题描述】:

当我当时加载任何方法时,它会向我显示此警告,因为我正在使用从方法中检索的特征

var cbChar :  CBCharacteristic
 func bleManagerPeripheral(_ peripheral: CBPeripheral!, didUpdateValueFor characteristic: CBCharacteristic!, error: Error!) {
   cbChar = characteristic
}

我在尝试编写以下行时收到警告

[self.cb  writeValue:aData forCharacteristic:cbChar type:1];

我正在变暖

[CoreBluetooth] WARNING: Characteristic,notifying = NO> 没有指定“Write without Response”属性 - 忽略无响应写入

谁能帮帮我?

【问题讨论】:

  • 该特性似乎不支持书写。你检查了[characteristic properties] 的值来检查吗?
  • 让我检查一下兄弟

标签: ios objective-c bluetooth bluetooth-lowenergy


【解决方案1】:

您正在写入的特征不支持无响应写入,但是当您调用 writeData 时,您将 1 传递给 type 参数。 1 对应于CBCharacteristicWriteWithoutResponse。该警告告诉您 Core Bluetooth 无法执行您所要求的操作。

您需要指定CBCharacteristicWriteWithResponse

[self.cb  writeValue:aData forCharacteristic:cbChar type: CBCharacteristicWriteWithResponse];

【讨论】:

    猜你喜欢
    • 2014-10-29
    • 1970-01-01
    • 1970-01-01
    • 2023-03-12
    • 1970-01-01
    • 2013-09-18
    • 1970-01-01
    • 1970-01-01
    • 2021-01-14
    相关资源
    最近更新 更多