def METHOD_NAME(self):
    logging.info("Begin collecting data from serial port")
    while True:
        # Read one line from the spectrum device
        line = self.port.readline().rstrip()
        pkt_data = re.match(
            r"\[([-+]?\d+),\s*([-+]?\d+),\s*([-+]?\d+)\]\s*(.*)",
            line.decode(errors="replace"),
        )
        if pkt_data:
            ed = {}
            try:
                iface_id = int(pkt_data.group(1))
                timestamp = int(pkt_data.group(2))
                count = int(pkt_data.group(3))
            except ValueError:
                # Incorrect data received, probably UART noise or debugging
                # messages from the device, not much else we can do other
                # than try again with the next line
                continue
            logging.debug("data: if=%d cnt=%d t=%d", iface_id, count, timestamp)
            raw = pkt_data.group(4)
            for ch_ed in raw.split(","):
                try:
                    pair = ch_ed.split(":")
                    ch = int(pair[0])
                    ed[ch] = float(pair[1])
                except (ValueError, IndexError):
                    continue
            yield ed