mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
2d148b2b24
commit
4eb4417c06
1 changed files with 1 additions and 23 deletions
|
@ -147,28 +147,6 @@ func (d *BLERecon) getRow(dev *network.BLEDevice) []string {
|
||||||
address = core.Dim(address)
|
address = core.Dim(address)
|
||||||
}
|
}
|
||||||
|
|
||||||
flags := make([]string, 0)
|
|
||||||
raw := uint8(0)
|
|
||||||
if len(dev.Advertisement.Flags) > 0 {
|
|
||||||
raw = uint8(dev.Advertisement.Flags[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
bits := map[uint]string{
|
|
||||||
0: "LE Limited Discoverable",
|
|
||||||
1: "LE General Discoverable",
|
|
||||||
2: "BR/EDR",
|
|
||||||
3: "LE + BR/EDR Controller Mode",
|
|
||||||
4: "LE + BR/EDR Host Mode",
|
|
||||||
}
|
|
||||||
|
|
||||||
for bit, desc := range bits {
|
|
||||||
if raw&(1<<bit) != 0 {
|
|
||||||
flags = append(flags, desc)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Strings(flags)
|
|
||||||
|
|
||||||
isConnectable := core.Red("✕")
|
isConnectable := core.Red("✕")
|
||||||
if dev.Advertisement.Connectable == true {
|
if dev.Advertisement.Connectable == true {
|
||||||
isConnectable = core.Green("✓")
|
isConnectable = core.Green("✓")
|
||||||
|
@ -179,7 +157,7 @@ func (d *BLERecon) getRow(dev *network.BLEDevice) []string {
|
||||||
address,
|
address,
|
||||||
dev.Device.Name(),
|
dev.Device.Name(),
|
||||||
vendor,
|
vendor,
|
||||||
strings.Join(flags, ", "),
|
strings.Join(dev.Advertisement.Flags, ", "),
|
||||||
isConnectable,
|
isConnectable,
|
||||||
lastSeen,
|
lastSeen,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue