mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
new: parsing RSSI ( ref #53 )
This commit is contained in:
parent
35c9740537
commit
0ad426024f
6 changed files with 98 additions and 30 deletions
|
@ -44,17 +44,18 @@ func (w *WiFi) Remove(mac string) {
|
|||
}
|
||||
}
|
||||
|
||||
func (w *WiFi) AddIfNew(ssid, mac string, isAp bool, channel int) *WiFiStation {
|
||||
func (w *WiFi) AddIfNew(ssid, mac string, isAp bool, channel int, rssi int8) *WiFiStation {
|
||||
w.Lock()
|
||||
defer w.Unlock()
|
||||
|
||||
mac = network.NormalizeMac(mac)
|
||||
if station, found := w.Stations[mac]; found {
|
||||
w.Stations[mac].LastSeen = time.Now()
|
||||
station.LastSeen = time.Now()
|
||||
station.RSSI = rssi
|
||||
return station
|
||||
}
|
||||
|
||||
newStation := NewWiFiStation(ssid, mac, isAp, channel)
|
||||
newStation := NewWiFiStation(ssid, mac, isAp, channel, rssi)
|
||||
w.Stations[mac] = newStation
|
||||
|
||||
w.Session.Events.Add("wifi.station.new", newStation)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue