Esempio n. 1
0
    def buildCommand(self, command = 'SEND', messagetype = 'U', message = ""):
        command = "%(tesn)sEIPC%(comport)s%(command)s"\
                    "%(messagetype)s%(message)s" % \
                    {'tesn' : i2h("%04X" % self.getTESN()),
                     'comport' : i2h("%04X" % self.port.tx_AFDX_port_id),
                     'command' : command,
                     'messagetype' : messagetype,
                     'message' : message}

        return command.decode('string_escape')
Esempio n. 2
0
 def buildCommand(self, command = 'SEND', messagetype = 'U',  message = ""):
     port = self.port
     command = "%(tesn)sESAP%(sapsrcport)s%(command)s%(commandtype)s"\
                     "%(message)s%(teip)s%(udpdst)s" % \
                     {'tesn' : i2h("%04X" %self.getTESN()),
                      'sapsrcport' : i2h("%04X" % port.udp_src),
                      'command' : command,
                      'commandtype' : messagetype,
                      'message' : message,
                      'teip' : iptoHexarray(port.ip_dst),
                      'udpdst' : i2h("%04X" % port.udp_dst)}
     return command.decode('string_escape')
Esempio n. 3
0
 def buildCommand(self):
     command = "%(tesn)sERPQ%(port)s" % \
     {'tesn' : i2h("%04X" % self.getTESN()),
      'port' : i2h("%04X" % self.port.RX_AFDX_port_id)
      }
     return command.decode('string_escape')
Esempio n. 4
0
    def buildCommand(self):
        command = "%(tesn)sRSET" % {'tesn' : i2h("%04X" % self.getTESN())}

        return command.decode('string_escape')
Esempio n. 5
0
 def buildCommand(self, loop_count = 1):
     command = "%(tesn)sTCRQ%(count)s" % \
     {'tesn' : i2h("%04X" % self.getTESN()),
      'count' : i2h("%04X" % loop_count)}
     return command.decode('string_escape')