Add ability to set channels using Nexmon

Nexmon firmware
This commit is contained in:
mlinton 2020-12-22 16:30:24 -07:00 committed by GitHub
commit c7dc62e35e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,14 @@ func SetInterfaceChannel(iface string, channel int) error {
if curr == channel {
return nil
}
if core.HasBinary("nexutil") {
Debug("SetInterfaceChannel(%s, %d) nexutil based", iface, channel)
out, err := core.Exec("nexutil", []string{"-i -s 30 -v", fmt.Sprintf("%d", channel)})
if err != nil {
return err
} else if out != "" {
return fmt.Errorf("Unexpected output while setting interface %s to channel %d: %s", iface, channel, out)
}
if core.HasBinary("iw") {
Debug("SetInterfaceChannel(%s, %d) iw based", iface, channel)
out, err := core.Exec("iw", []string{"dev", iface, "set", "channel", fmt.Sprintf("%d", channel)})