dsmr_parser/clients/serial_.py
def read(self, queue):
        """
        Read complete DSMR telegram's from the serial interface and parse it
        into CosemObject's and MbusObject's.

        Instead of being a generator, values are pushed to provided queue for
        asynchronous processing.

        :rtype: None
        """
        # create Serial StreamReader
        conn = serial_asyncio.open_serial_connection(**self.serial_settings)
        reader, _ = yield from conn

        while True:
            # Read line if available or give control back to loop until new
            # data has arrived.
            data = yield from reader.readline()
            self.telegram_buffer.append(data.decode('ascii'))

            for telegram in self.telegram_buffer.get_all():
                try:
                    # Push new parsed telegram onto queue.
                    queue.put_nowait(
                        self.telegram_parser.parse(telegram)
                    )
                except ParseError as e:
                    logger.warning('Failed to parse telegram: %s', e)
def read(self, queue):
        # create Serial StreamReader
        conn = serial_asyncio.open_serial_connection(**self.serial_settings)
        reader, _ = yield from conn

        while True:
            # Read line if available or give control back to loop until new
            # data has arrived.
            data = yield from reader.readline()
            self.telegram_buffer.append(data.decode('ascii'))

            for telegram in self.telegram_buffer.get_all():
                try:
                    # Push new parsed telegram onto queue.
                    queue.put_nowait(
                        self.telegram_parser.parse(telegram)
                    )
                except ParseError as e:
                    logger.warning('Failed to parse telegram: %s', e)
def read ( self , queue ) : # create Serial StreamReader conn = serial_asyncio . open_serial_connection ( * * self . serial_settings ) reader , _ = yield from conn while True : # Read line if available or give control back to loop until new # data has arrived. data = yield from reader . readline ( ) self . telegram_buffer . append ( data . decode ( 'ascii' ) ) for telegram in self . telegram_buffer . get_all ( ) : try : # Push new parsed telegram onto queue. queue . put_nowait ( self . telegram_parser . parse ( telegram ) ) except ParseError as e : logger . warning ( 'Failed to parse telegram: %s' , e )
Read complete DSMR telegram's from the serial interface and parse it
        into CosemObject's and MbusObject's.

        Instead of being a generator, values are pushed to provided queue for
        asynchronous processing.

        :rtype: None
Read complete DSMR telegram s from the serial interface and parse it into CosemObject s and MbusObject s .