Update getting of possible channels (darwin)

- added regex to be able to parse system_profiler format of MacOS 13+
This commit is contained in:
Jan Šrámek 2022-12-29 19:43:54 +01:00
commit 8e4a00091e

View file

@ -41,7 +41,8 @@ func getFrequenciesFromChannels(output string) ([]int, error) {
if output != "" {
if matches := WiFiChannelParser.FindStringSubmatch(output); len(matches) == 2 {
for _, channel := range str.Comma(matches[1]) {
if channel, err := strconv.Atoi(channel); err == nil {
re := regexp.MustCompile(`\d+`)
if channel, err := strconv.Atoi(re.FindString(channel)); err == nil {
freqs = append(freqs, Dot11Chan2Freq(channel))
}
}