mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
new: new ble.clear command to clear devices collected by ble.recon
This commit is contained in:
parent
5f462525d3
commit
223af913b8
2 changed files with 13 additions and 0 deletions
|
@ -57,6 +57,13 @@ func NewBLERecon(s *session.Session) *BLERecon {
|
||||||
return mod.Stop()
|
return mod.Stop()
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
mod.AddHandler(session.NewModuleHandler("ble.clear", "",
|
||||||
|
"Clear all devices collected by the BLE discovery module.",
|
||||||
|
func(args []string) error {
|
||||||
|
mod.Session.BLE.Clear()
|
||||||
|
return nil
|
||||||
|
}))
|
||||||
|
|
||||||
mod.AddHandler(session.NewModuleHandler("ble.show", "",
|
mod.AddHandler(session.NewModuleHandler("ble.show", "",
|
||||||
"Show discovered Bluetooth Low Energy devices.",
|
"Show discovered Bluetooth Low Energy devices.",
|
||||||
func(args []string) error {
|
func(args []string) error {
|
||||||
|
|
|
@ -104,3 +104,9 @@ func (b *BLE) EachDevice(cb func(mac string, d *BLEDevice)) {
|
||||||
cb(m, dev)
|
cb(m, dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *BLE) Clear() {
|
||||||
|
b.Lock()
|
||||||
|
defer b.Unlock()
|
||||||
|
b.devices = make(map[string]*BLEDevice)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue