How to correctly implement didReceiveWriteRequests? iOS6 CoreBluetooth
According to Apple's doc on CoreBluetooth, you should use:
- (void)respondToRequest:(CBATTRequest *)request withResult:(CBATTError)result;
to reply to the central.This is also a choice when you receive a reading request
To use:
- (BOOL)updateValue:(NSData *)value forCharacteristic:(CBMutableCharacteristic *)characteristic onSubscribedCentrals:(NSArray *)centrals;
you first need to subscribe to it using
- (void)setNotifyValue:(BOOL)enabled forCharacteristic:(CBCharacteristic *)characteristic;
from client side.