canSendWriteWithoutResponse always returns false

Anyone managed to get this to work yet? Running a simple project on the dev betas of macOS High Sierra and iOS 11, characteristic is set to be writeable without a response, but `canSendWriteWithoutResponse` always returns `false`.

Replies

Had the simillar issue. It defaults to false and keeps that way if you do nothing but only read this varaible. It may change to true somehow when you start sending WriteWithoutResponse commands. HOWEVER, this is NOT reliable and even worse is that the peripheralIsReady delegate is NOT guarenteed to be called. I hope this is the bug in beta releases only, otherwise these two new changes are worthless.


Test on iOS beta 2, iPhone SE

Still failing on iOS 11 beta 3 -- canSendWriteWithoutResponse continues to always return NO.



Also, peripheralIsReadyToSendWriteWithoutResponse seems to fire after every writeWithoutResponse, even though the WWDC 2017 "What's New in Core Bluetooth" talk seems to imply that it should only fire after you call canSendWriteWithoutResponse and get NO back. It's possible that I'm misinterpreting the talk, since no documentation has been posted yet for canSendWriteWithoutResponse nor peripheralIsReadyToSendWriteWithoutResponse.



From the transcript:

"For this year, we've enhanced CBPeripheral with a new property called canSendWriteWithoutResponse. So if you call this before you do a write and it and it returns yes, that's our promise to you that your data will not be dropped in software before we get a chance to send it to the remote peripheral. If that returns no, you'll also get a delegate callback when we're ready and we'll call back peripheralIsReadyToSendWriteWithoutResponse."


(this is on iPhone 7 plus)

Still failing in iOS 11 beta 4.

Fixed in 11.2, still broken in macOS.

Is it really fixed in iOS 11.2 ? How did you use it ? For me, it seems to be still broken

I have experienced this when I get CBPeripherals from willRestoreState, i.e., retrieved from CoreBluetooth's state restoration. I have found a workaround; when peripheral is connected I check if canSendWriteWithoutResponse is false. If this is the case then I throw the connection (cancel) and reconnect and then it is true.

Same issue here on iOS 11.4.1.


When the restored peripheral's state is 'connected', canSendWriteWithoutResponse always returns false.


One workaround is, as you suggested, to reconnect to that peripheral. Another workaround that I am currently using is to ignore the initial state of canSendWriteWithoutResponse and simply write the data. peripheralIsReady(toSendWriteWithoutResponse:) will then be called and canSendWriteWithoutResponse starts to behave correctly again.


This should be filed as a bug report.