code: def __exchange(self, output, timeout=None):
          
          self.__writeln(output)
          self._port.flush()
          return self.__expect(timeout=timeout or self._timeout)
docs: Write output to the port and wait for response