'Write msg, obtain awnser and format output.'

def _write_read_format(self, msg):

    awns = self._write_read(msg)
    match = re.search('\\r(.+)\\r', awns)
    if match:
        return match.group(1)
    return STATE_UNKNOWN
