Ejemplo n.º 1
0
class xAALProxy:

    def __init__(self):

        self.uuid = tools.getRandomUUID()
        print("My UUID is : %s" % self.uuid)
        
        self.app = Engine()


    def sendmsg(self, target, action, key=None, value=None):
        
        addr = config.getConfigInfo(target, "xaaladdr")

        msg = Message()
        msg.setTargets([addr])
        msg.setDevtype('cli.experimental')
        msg.setMsgtype('request')
        msg.setAction(action)
        if(key != None and value != None) :
            body = {key:value}
            msg.setBody(body)
        msg.setSource(self.uuid)
        msg.setCipher("")
        msg.setSignature()
        txt = {"header":msg.getHeader(), "body":msg.getBody()}
        data = json.encode(txt)
        self.app.getNetworkConnector().send(data)

    def recvmsg(self):

        data = self.app.getNetworkConnector().getData()
        return data
Ejemplo n.º 2
0
class xAALProxy:

    def __init__(self):

        self.uuid = tools.get_random_uuid()
        print("My UUID is : %s" % self.uuid)
        
        self.app = Engine()


    def sendmsg(self, target, action, key=None, value=None):
    
        addr = config.getConfigInfo(target, "xaaladdr") #hdrware addr of the equpmt
        
        msg = Message()
        msg.set_targets([addr])
        msg.set_devtype('cli.experimental')
        msg.set_msgtype('request')
        msg.set_action(action)
        if(key != None and value != None) :
            body = {key:value}
            msg.set_body(body)
        msg.set_source(self.uuid)
        #msg.set_cipher_key("")
        #msg.set_signature()
        txt = {"header":msg.get_header(), "body":msg.get_body()}
        data = json.encode(txt)
        #addr 224.0.29.200, port 1235
        self.app.get_network_connector().send(data)

    def recvmsg(self):

        data = self.app.get_network_connector().get_data()
        return data
Ejemplo n.º 3
0
    def __init__(self):

        self.uuid = tools.get_random_uuid()
        print("My UUID is : %s" % self.uuid)
        
        self.app = Engine()
Ejemplo n.º 4
0
    def __init__(self):

        self.uuid = tools.getRandomUUID()
        print("My UUID is : %s" % self.uuid)
        
        self.app = Engine()