Layer 2 scan using wpa_supplicant cli #1337
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the continuation of the layer 2 pscheduler-tool-bssidscanner tool developed over the last summer. I have implemented the scan via wpa_supplicant cli. I would start by checking if the wpa supplicant interface has already been initiated. If not, the script would write a config file that us used to initiate the wpa supplicant interface.
After the initialization of the interface, we would expect the wpa supplicant to run in the background. The program would then invoke
wpa_cli scan
andwpa_cli scan_result
in order to retrieve the scan data. wpa_cli scans for the results intermittently in the background and stores the restore in its cache. During the scanning state, it would not return any results for the output. My program would detect such state and keep calling the cli to retrieve result. However, significant runtime improvement can be observed when the cli is not actively scanning for bssid.Ed has specified that it is desirable to leave ssid as an option. In my program, bssid corresponding to a specific ssid will be filtered. If ssid is not specified, all available entry points would be scanned. I also have to change cli_to_spec and result_format within the pscheduler-test-wifibssid package in order to change the command line validation and to load the result from the scan result I'm able to gather.
One wrinkle I noticed is that the active scanning phase of the cli can be found by running
wpa_cli scan_result
with a part of the result as FAIL_BUSY after the initial run. My while loop deals with both situations.