Git Product home page Git Product logo

Comments (4)

pschmitt avatar pschmitt commented on May 10, 2024 1

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.

kellyjonbrazil avatar kellyjonbrazil commented on May 10, 2024 1

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.

pschmitt avatar pschmitt commented on May 10, 2024 1

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.

kellyjonbrazil avatar kellyjonbrazil commented on May 10, 2024 1

Changes merged into v1.14.1, now available on pypi.

from jc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.