pyedbglib/protocols/avrcmsisdap.py
def avr_command_response(self, command):
        """
        Sends an AVR command and receives a response

        :param command: Command bytes to send
        :return: Response bytes received
        """
        fragments = self._fragment_command_packet(command)
        self.logger.debug("Sending AVR command")
        for fragment in fragments:
            self.logger.debug("Sending AVR command 0x{:02X}".format(fragment[self.AVR_CMD_COMMAND_HEADER_CMD]))
            resp = self.dap_command_response(fragment)
            if resp[self.AVR_CMD_RESPONSE_HEADER_CMD] != self.AVR_COMMAND:
                raise AvrCommandError("AVR command DAP command failed; invalid token: 0x{:02X}"
                                      .format(resp[self.AVR_CMD_RESPONSE_HEADER_CMD]))
            if fragment == fragments[-1]:
                if resp[self.AVR_CMD_RESPONSE_FRAGMENT_CODE] != self.AVR_FINAL_FRAGMENT:
                    raise AvrCommandError("AVR command DAP command failed; invalid final fragment ack: 0x{:02X}"
                                          .format(resp[self.AVR_CMD_RESPONSE_FRAGMENT_CODE]))
            else:
                if resp[self.AVR_CMD_RESPONSE_FRAGMENT_CODE] != self.AVR_MORE_FRAGMENTS:
                    raise AvrCommandError("AVR command DAP command failed; invalid non-final fragment ack: 0x{:02X}"
                                          .format(resp[self.AVR_CMD_RESPONSE_FRAGMENT_CODE]))

        # Receive response
        fragment_info, _, response = self._avr_response_receive_fragment()
        packets_remaining = (fragment_info & 0xF) - 1
        for _ in range(0, packets_remaining):
            fragment_info, _, data = self._avr_response_receive_fragment()
            response.extend(data)
        return response

        Sends an AVR command and receives a response

        :param command: Command bytes to send
        :return: Response bytes received
        
Sends an AVR command and receives a response
Sends an AVR command and receives a response
def avr_command_response(self, command):
        fragments = self._fragment_command_packet(command)
        self.logger.debug("Sending AVR command")
        for fragment in fragments:
            self.logger.debug("Sending AVR command 0x{:02X}".format(fragment[self.AVR_CMD_COMMAND_HEADER_CMD]))
            resp = self.dap_command_response(fragment)
            if resp[self.AVR_CMD_RESPONSE_HEADER_CMD] != self.AVR_COMMAND:
                raise AvrCommandError("AVR command DAP command failed; invalid token: 0x{:02X}"
                                      .format(resp[self.AVR_CMD_RESPONSE_HEADER_CMD]))
            if fragment == fragments[-1]:
                if resp[self.AVR_CMD_RESPONSE_FRAGMENT_CODE] != self.AVR_FINAL_FRAGMENT:
                    raise AvrCommandError("AVR command DAP command failed; invalid final fragment ack: 0x{:02X}"
                                          .format(resp[self.AVR_CMD_RESPONSE_FRAGMENT_CODE]))
            else:
                if resp[self.AVR_CMD_RESPONSE_FRAGMENT_CODE] != self.AVR_MORE_FRAGMENTS:
                    raise AvrCommandError("AVR command DAP command failed; invalid non-final fragment ack: 0x{:02X}"
                                          .format(resp[self.AVR_CMD_RESPONSE_FRAGMENT_CODE]))
        fragment_info, _, response = self._avr_response_receive_fragment()
        packets_remaining = (fragment_info & 0xF) - 1
        for _ in range(0, packets_remaining):
            fragment_info, _, data = self._avr_response_receive_fragment()
            response.extend(data)
        return response
def avr_command_response ( self , command ) : fragments = self . _fragment_command_packet ( command ) self . logger . debug ( "Sending AVR command" ) for fragment in fragments : self . logger . debug ( "Sending AVR command 0x{:02X}" . format ( fragment [ self . AVR_CMD_COMMAND_HEADER_CMD ] ) ) resp = self . dap_command_response ( fragment ) if resp [ self . AVR_CMD_RESPONSE_HEADER_CMD ] != self . AVR_COMMAND : raise AvrCommandError ( "AVR command DAP command failed; invalid token: 0x{:02X}" . format ( resp [ self . AVR_CMD_RESPONSE_HEADER_CMD ] ) ) if fragment == fragments [ - 1 ] : if resp [ self . AVR_CMD_RESPONSE_FRAGMENT_CODE ] != self . AVR_FINAL_FRAGMENT : raise AvrCommandError ( "AVR command DAP command failed; invalid final fragment ack: 0x{:02X}" . format ( resp [ self . AVR_CMD_RESPONSE_FRAGMENT_CODE ] ) ) else : if resp [ self . AVR_CMD_RESPONSE_FRAGMENT_CODE ] != self . AVR_MORE_FRAGMENTS : raise AvrCommandError ( "AVR command DAP command failed; invalid non-final fragment ack: 0x{:02X}" . format ( resp [ self . AVR_CMD_RESPONSE_FRAGMENT_CODE ] ) ) fragment_info , _ , response = self . _avr_response_receive_fragment ( ) packets_remaining = ( fragment_info & 0xF ) - 1 for _ in range ( 0 , packets_remaining ) : fragment_info , _ , data = self . _avr_response_receive_fragment ( ) response . extend ( data ) return response
Sends an AVR command and receives a response
Sends an AVR command and receives a response
"""
        Sends an AVR command and receives a response

        :param command: Command bytes to send
        :return: Response bytes received
        """ # Receive response
Response bytes received
Response bytes received
self
command
Command bytes to send
Command bytes to send