Okay, so I've looked through a thousand tutorials and other Stack Overflow threads (so please don't list as duplicate without answering the question) and I cannot work out how to use this functionality.
I have followed this tutorial: http://code.tutsplus.com/tutorials/ios-7-sdk-core-bluetooth-practical-lesson--mobile-20741
I have a system where a central can connect to a peripheral and read a characteristic from it.
I am now trying to get my central to rewrite the data within the characteristic but am finding the write line that I have called just being ignored.
I have declared my characteristic within my peripheral class as such:
self.transferCharacteristic = [[CBMutableCharacteristic alloc] initWithType:[CBUUID UUIDWithString:TRANSFER_CHARACTERISTIC_UUID] properties:CBCharacteristicPropertyNotify|CBCharacteristicPropertyWriteWithoutResponse|CBCharacteristicPropertyRead value:nil permissions:CBAttributePermissionsReadable|CBAttributePermissionsWriteable];
And in my centralManager I have called
[peripheral writeValue:[@"rewritten!" dataUsingEncoding:NSUTF8StringEncoding] forCharacteristic:characteristic type:CBCharacteristicWriteWithoutResponse];
But the line is ignored. Can anyone talk me through what might be wrong? Do I need to add a method to my peripheral class?
Also, I've tried doing it WithResponse but it still doesn't even call that method from the peripheral either.