Ejemplo n.º 1
0
 def send_nonce(self):
     """
     Transmit server's current nonce
     """
     # Convert nonce to SWAP value
     value = SwapValue(self.nonce)
     # Status packet to be sent
     status = SwapStatusPacket(self._xmlnetwork.devaddress, SwapRegId.ID_SECU_NONCE, value)
     self.nonce += 1
     if self.nonce > 0xFF:
         self.nonce = 0
     status.nonce = self.nonce
     status.send(self)
Ejemplo n.º 2
0
 def send_nonce(self):
     """
     Transmit server's current nonce
     """
     # Convert nonce to SWAP value
     value = SwapValue(self.nonce)
     # Status packet to be sent
     status = SwapStatusPacket(self._xmlnetwork.devaddress, SwapRegId.ID_SECU_NONCE, value)
     self.nonce += 1
     if self.nonce > 0xFF:
         self.nonce = 0
     status.nonce = self.nonce
     status.send(self)
Ejemplo n.º 3
0
    def send_status(self, mote, regid):
        """
        Send status message informing about a register

        @param mote: Mote containing the register
        @param regid: Register ID
        """
        # Get register
        reg = mote.getRegister(regid)
        if reg is not None:
            # Status packet to be sent
            status = SwapStatusPacket(mote.address, regid, reg.value)
            status.srcAddress = self._xmlnetwork.devaddress
            self.nonce += 1
            if self.nonce > 0xFF:
                self.nonce = 0
            status.nonce = self.nonce
            status.send(self)    
Ejemplo n.º 4
0
    def send_status(self, mote, regid):
        """
        Send status message informing about a register

        @param mote: Mote containing the register
        @param regid: Register ID
        """
        # Get register
        reg = mote.getRegister(regid)
        if reg is not None:
            # Status packet to be sent
            status = SwapStatusPacket(mote.address, regid, reg.value)
            status.srcAddress = self._xmlnetwork.devaddress
            self.nonce += 1
            if self.nonce > 0xFF:
                self.nonce = 0
            status.nonce = self.nonce
            status.send(self)