Win32NativeWifiApiTests.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:win32wifi 作者: kedos 项目源码 文件源码
def testWlanRegisterNotification(self):
        handle = WlanOpenHandle()
        wlan_ifaces = WlanEnumInterfaces(handle)
        data_type = wlan_ifaces.contents.InterfaceInfo._type_
        num = wlan_ifaces.contents.NumberOfItems
        ifaces_pointer = addressof(wlan_ifaces.contents.InterfaceInfo)
        wlan_iface_info_list = (data_type * num).from_address(ifaces_pointer)
        msg = "We expect at least one wireless interface."
        self.assertGreaterEqual(len(wlan_iface_info_list), 1, msg)

        import threading
        ev = threading.Event()

        def callback(wnd, p):
            ev.set()

        cb = WlanRegisterNotification(handle, callback)
        ev.wait(5)

        if not ev.is_set():
            self.fail("Didn't receive any notification.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号