Skip to content

Is PIM ACK/NAK not evaluated? #17

@ludvikjerabek

Description

@ludvikjerabek

Is it correct to assume the PIM's ACK/NAK response if being ignored instead of triggering a retry? Since an outgoing UPB packet determines the PIM response ACK/NAK behavior it appears that these responses are not taken into account? Just wanted to validate, but it would be nice to issue a retry in the event that an ACK was expected but a NAK was received.

async def _handle_pim_command(self, pim_command: str, pim_data: str) -> None:
        def _handled_response(done_with_message=True):
            if done_with_message:
                self._write_queue.popleft()
            self._handled_response_event.set()  # enables write stream to start again

        # Ignore PimResponse ACK and NACK
        if pim_command == PimResponse.UPDATE.value:
            reply_from, msg = decode(pim_data)
            if self._is_repeated_message(msg):
                LOG.debug("Repeated message; discarded.")
            else:
                if reply_from == self._awaiting_response_command:
                    _handled_response()
                self._notifier.notify(msg.msg_id, {"msg": msg})
        elif pim_command == PimResponse.ACCEPT.value:
            if not self._awaiting_response_command:
                _handled_response()
        elif pim_command == PimResponse.REGISTER_REPORT.value:
            _handled_response()
        elif pim_command == PimResponse.BUSY.value:
            await asyncio.sleep(PIM_BUSY_TIMEOUT)
            _handled_response(False)
        elif pim_command == PimResponse.ERROR.value:
            _handled_response()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions