Closed Z3hka closed 6 months ago
Cool~ Thank you @Z3hka for PR~! @kphanipavan @petebueh Let's check this together
grep -E " 24[0-9][0-9](.0+){0,1} MHz
Shouldn't it be \.
instead of .
?
And should the same be applied to FREQ_BANK != 2.4
? (I don't have 5Ghz hardware to test that)
sed 's/\.00*//g'
We should use \b
to prevent removing .05
The change which introduced that decimal is shown below
As stated, it is for S1G (Sub 1GHz) frequencies, used with 802.11Ah protocol
The comment in the header file suggests that it is the offset frequency in KHz.
Found relevant explanation: https://lore.kernel.org/linux-wireless/20200401062150.3324-2-thomas@adapt-ip.com/T/
So, unless 11Ah support is on the roadmap for this script, the decimal and the numbers followed can be ignored.
~Pvn
Well, I shouldn't write regexes while tired :D Here are the fixes for the issues you found
It works for me. I'm using 2.4 GHz
This should fix #67 The sed command removes a dot followed by any number (greater than zero) of zeros followed by the end of the line. This way frequencies now reported with a trailing .0 will also work. Just in case it will also remove .00 and similar, but not ".", ".5" and similar because they may actually have a different meaning and thus should not be rounded away as suggested in #67 with cut but throw an error. The more complete approach would be to use software like bc to do actual non-integer comparison but as long as there are no non-integer-frequencies used i don't think adding an additional dependency is worth it just for the sake of a theoretical future wifi frequency that will require modifications to the script anyway.