Ejemplo n.º 1
0
    def getResponse(self):
        response = "%(trsn)s%(tesn)sOK   ERPQ%(comport)s" % \
        {'trsn' : i2h("%04X" % testresponder_sequencer.getTRSN()),
         'tesn' : i2h("%04X" % self.getTESN()),
         'comport' : i2h(self.getComport())}

        return response.decode('string_escape')
Ejemplo n.º 2
0
 def getResponse(self):
     response = "%(trsn)s%(tesn)s%(response)sTCRQ%(repeat)s" % \
     {'trsn' : i2h("%04X" % testresponder_sequencer.getTRSN()),
      'tesn' : i2h("%04X" % self.getTESN()),
      'response' : 'OK   ',
      'repeat' : i2h(self.__repeatCount)}
     return response.decode('string_escape')
Ejemplo n.º 3
0
 def getResponse(self):
     response = "%(trsn)s%(tesn)s%(response)sESAP%(sapsrcport)s" % \
     {'trsn' : i2h("%04X" % testresponder_sequencer.getTRSN()),
      'tesn' : i2h("%04X" % self.getTESN()),
      'response' : self.__response,
      'sapsrcport' : i2h(self.getSapSrcport())}
     return response.decode('string_escape')
Ejemplo n.º 4
0
 def __sendOnPort(self):
         portId = self.getComport()
         response = "%(tesn)s%(trsn)sEIPC%(comport)s%(type)s%(text)s" % \
         {'tesn' : i2h("%04X" % self.getTESN()),
          'trsn' : i2h("%04X" % testresponder_sequencer.getTRSN()),
          'comport' : i2h(self.getComport()),
          'type' : self.__messageType,
          'text' : self.__text}
         port = WRITE(portId, response.decode('string_escape'))
         self.__application.transmit(port)
         return True
Ejemplo n.º 5
0
 def __sendOnPort(self):
     try:
         response = "%(trsn)s%(tesn)sESAP%(sapsrcport)s%(type)s%(text)s" % \
         {'trsn' : i2h("%04X" % testresponder_sequencer.getTRSN()),
          'tesn' : i2h("%04X" % self.getTESN()),
          'sapsrcport' : i2h(self.getSapSrcport()),
          'type' : self.__messageType,
          'text' : self.__text}
 
         port = WRITE_Sap(self.getSapSrcport(), response.decode('string_escape'),
                          self.__teipaddress, self.__udpdstport)
         self.__application.transmit(port)
         return True
     except Exception, ex:
         print 'Exception at esap', str(ex)
         return False
Ejemplo n.º 6
0
    def execute(self):
        port_data = READ(self.getComport())

        if port_data == None:
            self.__response = "ERR  "
            return

        port = GET_Port_Input(self.getComport())

        if port.port_characteristic == PORT_SAMPLING:
            timestamp = i2h(str((int)(time.time()))[-4:])
        else:
            timestamp = ""
        if port_data != None:
            response = "%(trsn)s%(tesn)sRRPC%(comport)s%(timestamp)s%(data)s" %\
            {'trsn' : i2h("%04X" % testresponder_sequencer.getTRSN()),
             'tesn' : i2h("%04X" % self.getTESN()),
             'comport' : i2h(self.getComport()),
             'timestamp' : timestamp,
             'data' : port_data}
            port = WRITE(self.__parent_portId, response.decode('string_escape'))
            self.__application.transmit(port)
Ejemplo n.º 7
0
    def getResponse(self):
        response = "%(trsn)s%(tesn)sOK\0\0\0KAILASH" % \
        {'trsn' : i2h("%04X" % testresponder_sequencer.getTRSN()),
         'tesn' : i2h("%04X" % self.getTESN())}

        return response.decode('string_escape')