'Read from the modem (blocking) one line at a time until a response
terminator ("OK", "ERROR", or "CMx ERROR...") is hit, then return
a list containing the lines.'

def read_lines(self, read_term=None, read_timeout=None):

    buffer = []
    while True:
        buf = self._read(read_term=read_term, read_timeout=read_timeout)
        buf = buf.strip()
        buffer.append(buf)
        if (buf == 'OK'):
            return buffer
        m = re.match('^\\+(CM[ES])    ERROR:    (\\d+)$', buf)
        if (m is not None):
            (type, code) = m.groups()
            raise errors.GsmModemError(type, int(code))
        if (buf == 'ERROR'):
            raise errors.GsmModemError
