mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
new: module can now export a State map with specific information
This commit is contained in:
parent
b7c6e61428
commit
756c04fd95
3 changed files with 63 additions and 8 deletions
|
@ -42,6 +42,8 @@ func NewBLERecon(s *session.Session) *BLERecon {
|
|||
connected: false,
|
||||
}
|
||||
|
||||
mod.InitState("scanning")
|
||||
|
||||
mod.selector = utils.ViewSelectorFor(&mod.SessionModule,
|
||||
"ble.show",
|
||||
[]string{"rssi", "mac", "seen"}, "rssi asc")
|
||||
|
@ -196,6 +198,7 @@ func (mod *BLERecon) Stop() error {
|
|||
mod.Debug("module stopped, cleaning state")
|
||||
mod.gattDevice = nil
|
||||
mod.setCurrentDevice(nil)
|
||||
mod.ResetState()
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -216,6 +219,7 @@ func (mod *BLERecon) pruner() {
|
|||
func (mod *BLERecon) setCurrentDevice(dev *network.BLEDevice) {
|
||||
mod.connected = false
|
||||
mod.currDevice = dev
|
||||
mod.State.Store("scanning", dev)
|
||||
}
|
||||
|
||||
func (mod *BLERecon) writeBuffer(mac string, uuid gatt.UUID, data []byte) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue