Leaving this here for other people, but the OP answer is wrong.
The error that was made here is that he did not update his attribute in this function:
- (void)peripheralManager:(CBPeripheralManager *)iPeripheral didReceiveWriteRequests:(NSArray *)iRequests { CBATTRequest *aRequest = iRequests[0]; NSData *aData = aRequest.value; NSDictionary *aResponse = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:aData options:NSJSONReadingMutableContainers error:nil]; NSLog(@"Received Data = %@", aResponse); }
Since no sign is updated, the OS assumes that something went wrong and generates an error.
CBMutableCharacteristic *characteristic = [[CBMutableCharacteristic alloc] initWithType:iCID properties:CBCharacteristicPropertyWrite value:nil permissions:CBAttributePermissionsWriteable];
This code is actually configured to have a characteristic written with the answer, an enumeration that does not define the answer:
CBCharacteristicPropertyWriteWithoutResponse
Hope this helps others who stumble upon this.
source share