def METHOD_NAME(self, callback, tid, error=False):
    """Process incoming packets irrespective error condition."""
    data = self._buffer if error else self.getFrame()
    if (result := self.decoder.decode(data)) is None:
        self.resetFrame()
        raise ModbusIOException("Unable to decode request")
    if error and result.function_code < 0x80:
        raise InvalidMessageReceivedException(result)
    self.populateResult(result)
    self.advanceFrame()
    if tid and tid != result.transaction_id:
        self.resetFrame()
    else:
        callback(result)  # defer or push to a thread?