I\'m experiencing an issue where the time between writing a value to a characteristic using the
[peripheral writeValue:dataPacket forCharacteristic:writeChar ty
First of all check what you get in:
-(void) peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic
error:(NSError *)error {
}
if the error code is 0 that means you are sending value to peripheral WITHOUT confirming it. Check if your periheral implements this method:
//assuming
@property (strong, nonatomic) CBPeripheralManager *peripheralManager;
- (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveWriteRequests:(NSArray *)requests
{
NSLog(@"WRITE REQUEST!!! %lu",(unsigned long)requests.count);
//check if there are data
for (CBATTRequest * req in requests) {
//send reposnse to Central that you recivied write value and eg / accept / reject the write request
[self.peripheralManager respondToRequest:req
withResult:CBATTErrorSuccess];
}
}