BLE Characteristic Write does not work on Mavericks.
| Originator: | ceruleansparks | ||
| Number: | rdar://15334869 | Date Originated: | 2013-10-28 |
| Status: | Closed | Resolved: | Duplicate of 14904220 |
| Product: | OS X | Product Version: | 10.9.0 (13A603) |
| Classification: | Reproducible: | Always |
BLE characteristic writes no longer seem to work under Mavericks 10.9.0. You can connect, discover, subscribe and read just fine, but every write fails with "Error Domain=CBATTErrorDomain Code=8 "Writing is not permitted." UserInfo=0x1006020d0 {NSLocalizedDescription=Writing is not permitted.}"
This seems to be true whether connecting to virtual hardware (CBPeripheralManager-created peripherals) or real hardware. I've tested on five machines (two Mountain Lion, three Mavericks), with three devices (one iPhone CBPeripheral, two real BLE devices with write-no-reply characteristics).
It *is* worth noting that all of these machines were upgraded from Mountain Lion to Mavericks, not wiped clean and reinstalled. However, this is a fairly common situation.
Steps to Reproduce:
1. Use anything that allows you to perform a BLE write. I'm using my own command-line tool, but I can reproduce this issue with LightBlue from the AppStore as well.
2. Connect to a device that has a writeable BLE characteristic.
3. Attempt to write to the characteristic.
Expected Results:
The value given is written to the characteristic, and the expected result happens. (Turn on an LED with some Arduino device, receive back a reply from a BLE-based GPS device, you see the value show up in the debugger on an iOS software BLE CBPeripheral, etc.) On Mountain Lion, this is what happens.
Actual Results:
On Mavericks, the write will fail. For some programs (LightBlue) this will fail silently, in other cases (my command line tool, etc.) it will show the NSError I described above (CBATTErrorDomain 8, "Writing is not permitted.") In no case does the device show any sign of receiving the value.
I thought this must be something about my own machine at first, but I have now reproduced this on several machines beyond my own, and in situations both saturated with BLE traffic *and* in an environment with only one or two BLE devices. I'm thus concerned that this is endemic to Mavericks.
Version:
10.9.0 (13A603)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Further addendum: this only seems to be the case with CBCharacteristicWriteWithoutResponse write operations. (Or rather, to write-no-reply characteristics.)
Either way, as the same code works under Mountain Lion, it seems not to be by design.