     }
 
     public func readString() -> String? {
-        var buf = readData()
+        var buf = readChars()
         if buf == nil {
             return nil
         }

        return Array(buf[0..<n])
    }

    public func writeString(_ value: String) {
        let chars = Array(value.utf8CString)

        writeData(chars)
    }

    public func writeData(_ value: [CChar]) {
        var value = value

        _ = write(fd, &value, value.count)
        tcdrain(fd)
    }

    private func applyConfiguration() {

    func configureInterface(speed: UARTSpeed, bitsPerChar: CharSize, stopBits: StopBits, parity: ParityType)
    func readString() -> String?
    func readLine() -> String?
    func readChars() -> [CChar]?
    func readByte() -> UInt8?
    func write(string value: String)
    func write(chars values: [CChar])
    func write(data values: Data)
}

public enum ParityType {
