new: parsing BLE flags and company identifiers from advertisements

This commit is contained in:
evilsocket 2019-02-14 12:26:28 +01:00
parent 7f68d0d82c
commit f72dac0c95
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
253 changed files with 37143 additions and 487 deletions

View file

@ -11,6 +11,7 @@ import (
"github.com/evilsocket/islazy/data"
"github.com/evilsocket/islazy/str"
"github.com/evilsocket/islazy/tui"
"github.com/malfunkt/iprange"
)
@ -286,3 +287,18 @@ func GatewayProvidedByUser(iface *Endpoint, gateway string) (*Endpoint, error) {
}
return nil, fmt.Errorf("Provided gateway %s not a valid IPv4 address! Revert to find default gateway.", gateway)
}
func ColorRSSI(n int) string {
// ref. https://www.metageek.com/training/resources/understanding-rssi-2.html
rssi := fmt.Sprintf("%d dBm", n)
if n >= -67 {
rssi = tui.Green(rssi)
} else if n >= -70 {
rssi = tui.Dim(tui.Green(rssi))
} else if n >= -80 {
rssi = tui.Yellow(rssi)
} else {
rssi = tui.Dim(tui.Red(rssi))
}
return rssi
}