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.")
评论列表
文章目录