Comments (4)
There are some special cases one needs to be aware of when implementing this.
Some access points may not broadcast any SSID. iw then displays a null character (\0
). There may be more but I personally haven't encountered any - yet ;)
from jc.
Hi @pschmitt,
I have a beta version of the iw-scan parser ready.
This parser can be tested by placing a file called iw_scan.py
under $HOME/.local/share/jc/jcparsers
with the code from here: https://github.com/kellyjonbrazil/jc/blob/dev/jc/parsers/iw_scan.py.
I have noted that this parser is 'beta' quality since I don't really have a lot of examples to test with. If you have more example output for me to test I'll put it through the paces.
This output is pretty hairy, so I sorta cheated and didn't create a schema. I did make a best-effort attempt to convert ints and floats and programmatically pull as many fields in as possible. Some fields/data will be missing - most notably multi-line fields where there are not obvious key/value pairs on each line. If there are additional fields/data that you need for your use case I can improve the parser to get more of that info like I did for the dmidecode
and sysctl
parsers.
Cheers!
from jc.
Cool, thanks!
I've been testing this for the last few minutes on my laptop and on Termux. For some reason I only get a few fields (mac_address
and interface
):
sudo iw dev wlan0 scan | jc --iw_scan | jq
[
{
"mac_address": "90:5c:44:d1:34:2f",
"interface": "wlan0"
},
{
"mac_address": "92:5c:14:d1:34:2f",
"interface": "wlan0"
}
]
As a sidenote it would make sense to rename mac_address
to bssid
- given the context (ref)
Thanks for the time and effort you put into this! Let me know if I can help you debug this further.
EDIT: I found the issue. See #97
from jc.
Changes merged into v1.14.1, now available on pypi.
from jc.
Related Issues (20)
- Prebuilt binaries for Windows weren't released at v1.23.6 HOT 3
- New parser request: Debian/Ubuntu Packages index HOT 8
- OSS-Fuzz Integration HOT 5
- Parsing "mount" fails when mount_point contains spaces HOT 5
- support iftop HOT 7
- jc in Photon HOT 2
- New parser request: Alpine Linux packages index HOT 12
- Freezing with 100% CPU when parsing Xrandr output - 1.23.6 HOT 14
- Learning / Showcase exercise HOT 2
- FR: Support for ldd HOT 2
- New parser request: cmdline HOT 12
- New parser for parsing the output of `git diff --name-status`
- tests failing in s390x HOT 16
- Bug: The magic syntax partially fails HOT 1
- Parser for Path and Pathlists HOT 11
- Generic Split Parsers HOT 10
- Add basename and extension to `--url` HOT 4
- Multiline Input HOT 22
- KV with duplicates -> create an array HOT 5
- Alias HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jc.