             operation.lastRequest = pdu
             operation.sentData += attributeValuePart
             
-            assert(inLongWrite)
             send(pdu) { [unowned self] in self.prepareWrite($0, operation: operation) }
         }
     }

     */
    private func prepareWrite(_ response: ATTResponse<ATTPrepareWriteResponse>, operation: WriteOperation) {
        
        switch response {
            
        case let .error(error):
            
            operation.error(error)
            
        case let .value(pdu):
            

                
                guard pdu.handle == operation.lastRequest.handle,
                    pdu.offset == operation.lastRequest.offset,
                    pdu.partValue == operation.lastRequest.partValue
                    else { complete { $0.completion(.error(GATTClientError.invalidResponse(pdu))) }; return }
            }
            
            let offset = operation.lastRequest.offset + UInt16(operation.lastRequest.partValue.count)
            
            // all data sent
            guard offset < operation.data.count
                else { complete { $0.success() }; return }
            
            // write next part
            let length = connection.maximumTransmissionUnit - 5
