Exemplo n.º 1
0
    def setNetworkKey(self, number, key=None):
        if key:
            self.networks[number] = key

        msg = message.NetworkKeyMessage()
        msg.setNumber(number)
        msg.setKey(self.networks[number].key)
        self.driver.write(msg.encode())
        self.evm.waitForAck(msg)
        self.networks[number].number = number
Exemplo n.º 2
0
    def setNetworkKey(self, number, key=None):
        if not key:
            return
        self.networks[number] = key

        msg = message.NetworkKeyMessage()
        msg.setNumber(number)
        msg.setKey(self.networks[number].key)
        self.write(msg)
        self.evm.waitForAck(msg)
        self.networks[number].number = number
Exemplo n.º 3
0
    def setNetworkKey(self, number, network=None):
        networks = self.networks
        if network is None:
            network = networks[number]
        else:
            networks[number] = network

        msg = message.NetworkKeyMessage(number, network.key)
        response = self.evm.writeMessage(msg).waitForAck(msg)
        if response != RESPONSE_NO_ERROR:
            raise NodeError("Could not set network key '%d' (0x%.2x)." % (number, response))

        network.number = number
Exemplo n.º 4
0
 def setUp(self):
     self.message = MSG.NetworkKeyMessage()