use*_*603 1 ios core-bluetooth bluetooth-lowenergy
在iOS7.1.1上,以下BLE操作成功 - 它假设我有一个BLE连接设置等...
[[self peripheral]writeValue:dataToWrite forCharacteristic:nextCharacteristic type:CBCharacteristicWriteWithResponse];
Run Code Online (Sandbox Code Playgroud)
但如果我切换"类型" CBCharacteristicWriteWithoutResponse,我得到以下警告,外围设备没有收到命令:(
[[self peripheral]writeValue:dataToWrite forCharacteristic:nextCharacteristic type:CBCharacteristicWriteWithoutResponse];
Run Code Online (Sandbox Code Playgroud)
错误:
CoreBluetooth[WARNING] Characteristic <CBCharacteristic: 0x178081f90 UUID = 249C2001-00D7-4D91-AC75-22D57AE2FFB8, Value = (null), Properties = 0x28, Notifying = YES, Broadcasting = NO> does not specify the "Write Without Response" property - ignoring response-less write**
Run Code Online (Sandbox Code Playgroud)
任何线索都赞赏!
当BLE外围设备宣传特征时,广告包括那些特征的属性.其中包括该特性支持的操作 - 无响应读取,通知,写入和响应写入.
在这种情况下,似乎该特性支持写入响应但不支持写入而没有响应,因此当您尝试写入而没有响应时,您会收到警告并且写入操作无法完成
| 归档时间: |
|
| 查看次数: |
5128 次 |
| 最近记录: |