Requirement: iwevent
from the wireless_tools
linux package
Enables event driven code based on occurrences from wireless network interfaces
- Create a
IweventMonitor
object - this will spawn a separate monitor thread based oniwevent
- Link methods to supported events using predefined decorators or manually
association_new_event()
- triggers whenever a WiFi connection is establishedassociation_lost_event()
- triggers whenever a WiFi connection is lostregister_method_for_event(event, method)
- manually register a method
Linked methods will automatically be executed whenever their corresponding wireless interface event is detected. Currently supported events: connection established, connection lost
IweventMonitor contains two parameters which decide how linked methods are executed:
use_threading
(defaultTrue
) - Uses threads to call each method; specifying this asFalse
will execute all linked methods consecutively in order of linkingdaemonized_threads
(defaultFalse
) - Spawns threads as daemons
See example.py
.