'Read from the modem (blocking) until _terminator_ is hit,
(defaults to
, which reads a single "line"), and return.'

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

    buffer = []
    if (read_timeout is not None):
        old_timeout = self.device.timeout
        self.device.timeout = read_timeout
    def __reset_timeout():
        "restore    the    device's    previous    timeout\n                                                            setting,    if    we    overrode    it    earlier."
        if (read_timeout is not None):
            self.device.timeout = old_timeout
    if (read_term is None):
        read_term = '\r\n'
    while True:
        buf = self.device.read()
        buffer.append(buf)
        if (buf == ''):
            __reset_timeout()
            raise errors.GsmReadTimeoutError(buffer)
        if (''.join(buffer[(- len(read_term)):]) == read_term):
            buf_str = ''.join(buffer)
            __reset_timeout()
            self._log(repr(buf_str), 'read')
            return buf_str
