Source code for spinnman.messages.scp.impl.dpri_set_router_emergency_timeout

from spinnman.messages.scp import SCPRequestHeader
from spinnman.messages.scp.abstract_messages import AbstractSCPRequest
from spinnman.messages.scp.enums import SCPCommand, DPRICommand
from spinnman.messages.sdp import SDPFlag, SDPHeader
from .check_ok_response import CheckOKResponse


[docs]class DPRISetRouterEmergencyTimeout(AbstractSCPRequest): """ An SCP Request to set the router emergency timeout for dropped packet\ reinjection """ def __init__(self, x, y, p, timeout_mantissa, timeout_exponent): """ :param x: The x-coordinate of a chip, between 0 and 255 :type x: int :param y: The y-coordinate of a chip, between 0 and 255 :type y: int :param p: The processor running the dropped packet reinjector, between\ 0 and 17 :type p: int :param timeout_mantissa: The mantissa of the timeout value, \ between 0 and 15 :type timeout_mantissa: int :param timeout_exponent: The exponent of the timeout value, \ between 0 and 15 """ AbstractSCPRequest.__init__( self, SDPHeader( flags=SDPFlag.REPLY_EXPECTED, destination_port=0, destination_cpu=p, destination_chip_x=x, destination_chip_y=y), SCPRequestHeader(command=SCPCommand.CMD_DPRI), argument_1=(DPRICommand.SET_ROUTER_EMERGENCY_TIMEOUT.value), argument_2=(timeout_mantissa & 0xF) | ((timeout_exponent & 0xF) << 4))
[docs] def get_scp_response(self): return CheckOKResponse( "Set router emergency timeout", SCPCommand.CMD_DPRI)