mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 04:52:10 -07:00
new: wifi module reports current channel in state
This commit is contained in:
parent
7a2ecb15f6
commit
3a360e4622
2 changed files with 6 additions and 0 deletions
|
@ -104,7 +104,10 @@ func NewWiFiModule(s *session.Session) *WiFiModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod.InitState("channels")
|
mod.InitState("channels")
|
||||||
|
mod.InitState("channel")
|
||||||
|
|
||||||
mod.State.Store("channels", []int{})
|
mod.State.Store("channels", []int{})
|
||||||
|
mod.State.Store("channel", 0)
|
||||||
|
|
||||||
mod.AddParam(session.NewStringParameter("wifi.interface",
|
mod.AddParam(session.NewStringParameter("wifi.interface",
|
||||||
"",
|
"",
|
||||||
|
@ -661,6 +664,7 @@ func (mod *WiFiModule) Configure() error {
|
||||||
if err = network.SetInterfaceChannel(ifName, 1); err != nil {
|
if err = network.SetInterfaceChannel(ifName, 1); err != nil {
|
||||||
return fmt.Errorf("error while initializing %s to channel 1: %s", ifName, err)
|
return fmt.Errorf("error while initializing %s to channel 1: %s", ifName, err)
|
||||||
}
|
}
|
||||||
|
mod.State.Store("channel", 1)
|
||||||
|
|
||||||
mod.Info("started (min rssi: %d dBm)", mod.minRSSI)
|
mod.Info("started (min rssi: %d dBm)", mod.minRSSI)
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,8 @@ func (mod *WiFiModule) hopUnlocked(channel int) (mustStop bool) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod.State.Store("channel", channel)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue