我正在尝试从中心向外围发送响应。该代码两次运行良好。突然didReceiveWriteRequest
不叫了。我什至没有做任何更改。外围给出的属性是 CBCharacteristicsPropertyNotify | CBCharacteristicsPropertyWriteWithResponse and CBCharacteristicPropertyWrite
. 给定的权限是CBAttributePermissionsWriteable | CBAttributePermissionsReadable
. 在中心,我在didDiscoverCharacteristicsForService
方法中给出了 setNotifyValue=YES。这就是我尝试从中心写作的方式:
[peripheral writeValue:data forCharacteristic:self.peripheralCharacteristicn type:CBCharacteristicWriteWithResponse];
我在我所做的事情中找不到任何错误。出于某种原因,没有在外围设备调用 didReceiveWriteRequest。请指教。