Beispiel #1
0
    def send_del_lvap(self, lvap, target_block=None):
        """Send a DEL_LVAP message.
        Args:
            lvap: an LVAP object
        Returns:
            None
        Raises:
            TypeError: if lvap is not an LVAP object.
        """

        if target_block:
            target_hwaddr = target_block.hwaddr
            target_channel = target_block.channel
            target_band = target_block.band
        else:
            target_hwaddr = EtherAddress.bcast()
            target_channel = 0
            target_band = 0

        del_lvap = Container(version=PT_VERSION,
                             type=PT_DEL_LVAP,
                             length=30,
                             seq=self.wtp.seq,
                             module_id=lvap.module_id,
                             sta=lvap.addr.to_raw(),
                             target_hwaddr=target_hwaddr.to_raw(),
                             target_channel=target_channel,
                             tagert_band=target_band,
                             csa_switch_mode=0,
                             csa_switch_count=3)

        print(del_lvap)

        self.send_message(del_lvap, DEL_LVAP)
Beispiel #2
0
    def send_del_lvap(self, lvap):
        """Send a DEL_LVAP message.
        Args:
            lvap: an LVAP object
        Returns:
            None
        Raises:
            TypeError: if lvap is not an LVAP object.
        """

        target_block = lvap.target_block

        target_hwaddr = EtherAddress.bcast()
        target_channel = 0
        target_band = 0

        if target_block:
            target_hwaddr = target_block.hwaddr
            target_channel = target_block.channel
            target_band = target_block.band

        del_lvap = Container(version=PT_VERSION,
                             type=PT_DEL_LVAP,
                             length=30,
                             seq=self.wtp.seq,
                             module_id=lvap.module_id,
                             sta=lvap.addr.to_raw(),
                             target_hwaddr=target_hwaddr.to_raw(),
                             target_channel=target_channel,
                             tagert_band=target_band,
                             csa_switch_mode=0,
                             csa_switch_count=3)

        LOG.info("Del lvap %s", lvap)

        msg = DEL_LVAP.build(del_lvap)
        self.stream.write(msg)