Exemplo n.º 1
0
    def run(self):
        self.logger.info("Starting the script")
        smallest_bag = None
        needed_port = None
        if len(self.output_ports) == 0:
            self.logger.info("There are no ports in the ICD satisfying the " \
                             "scripts criteria")
            return
        for port in self.output_ports:
            bag = port.bag
            if smallest_bag == None:
                smallest_bag = bag

            if bag <= smallest_bag:
                smallest_bag = bag
                needed_port = port
        if needed_port == None:
            self.logger.error("The ICD has no entries")
            return

        self.sendRSET()
        self.logger.info("Smallest BAG chosen is %s" % smallest_bag)
        self.logger.info("Sending an EIPC HOLD on %s" % \
                         needed_port.tx_AFDX_port_id)
        eipc = EIPC(needed_port)
        self.send(eipc.buildCommand(command = 'HOLD', message = "SN Test"),
                  Factory.GET_TX_Port())
        pollForResponse('EIPC')

        tcrq = TCRQ()
        self.send(tcrq.buildCommand(257), Factory.GET_TX_Port())
        self.logger.info("Sending a TCRQ command.")
        pollForResponse('TCRQ')
        raw_input("Press enter/return key to continue......")
Exemplo n.º 2
0
    def run(self):
        self.logger.info("Starting sequence 1")
        if len(self.output_ports) == 0:
            self.logger.info("There are no ports in the ICD satisfying the " \
                             "scripts criteria")
            return
        self.sendRSET()
        
        for port in self.output_ports:
            eipc = EIPC(port)
            message = "PortId = %s" % port.tx_AFDX_port_id
            offset_size = eipc.command_size
            command = eipc.buildCommand(command = 'HOLD',
                                        message = buildShortMessage(port, 
                                                                message, 
                                                                offset_size))
            self.send(command, Factory.GET_TX_Port())
            if not pollForResponse('EIPC'):
                self.logger.error("The ES has not responded to EIPC")

        tcrq = TCRQ()
        self.send(tcrq.buildCommand(10), Factory.GET_TX_Port())
        if not pollForResponse('TCRQ'):
                self.logger.error("The ES has not responded to TCRQ")
        raw_input("Press any key to continue.")
Exemplo n.º 3
0
    def run(self):
        self.logger.info("Starting the sequence 1")

        if len(self.output_ports) == 0:
            self.logger.error("There are no ports which satisfy the scripts" \
                              " criteria.")
            return

        self.sendRSET()
        for port in self.output_ports:
            eipc = EIPC(port)
            message = "Port Id = %s" % port.tx_AFDX_port_id
            offset_size = eipc.command_size
            command = eipc.buildCommand(command = 'HOLD', 
                                    message = buildBigMessage(port, message,
                                                offset_size = offset_size))
            self.send(command, Factory.GET_TX_Port())
            if not pollForResponse("EIPC", timeout = 2):
                self.logger.error("The ES has not responded to EIPC")

        tcrq = TCRQ()
        self.send(tcrq.buildCommand(1), Factory.GET_TX_Port())

        if not pollForResponse("TCRQ", timeout = 10):
            self.logger.error("The ES has not responded to TCRQ")

        self.logger.info("Completed sequence 1")
        raw_input("Press any key to continue.")
Exemplo n.º 4
0
    def run(self):
        if len(self.output_ports) == 0:
            self.logger.info("There are no ports in the ICD satisfying the " \
                             "scripts criteria")
            return
        self.sendRSET()
        for port in self.output_ports:
            eipc = EIPC(port)
            self.logger.info("Sending EIPC HOLD on %s" % \
                             port.tx_AFDX_port_id)
            self.send(eipc.buildCommand(command = 'HOLD',\
                                        message = buildShortMessage(port,
                                                    "RM test",
                                                    eipc.command_size)), 
                                        Factory.GET_TX_Port())
            pollForResponse("EIPC")

        tcrq = TCRQ()
        self.logger.info("Seding a TCRQ for %d times" % 2)
        self.send(tcrq.buildCommand(2), Factory.GET_TX_Port())
        raw_input("Press enter key to continue.....")