new: implemented ble.timeout and ble.ttl parameters (ref #560)

This commit is contained in:
evilsocket 2019-09-08 16:13:46 +02:00
commit 8ec91c9206
No known key found for this signature in database
GPG key ID: 82E42E7F3B34C97E
2 changed files with 23 additions and 6 deletions

View file

@ -15,8 +15,7 @@ import (
)
var (
bleAliveInterval = time.Duration(5) * time.Second
blePresentInterval = time.Duration(30) * time.Second
bleAliveInterval = time.Duration(5) * time.Second
)
func (mod *BLERecon) getRow(dev *network.BLEDevice, withName bool) []string {
@ -27,6 +26,7 @@ func (mod *BLERecon) getRow(dev *network.BLEDevice, withName bool) []string {
sinceSeen := time.Since(dev.LastSeen)
lastSeen := dev.LastSeen.Format("15:04:05")
blePresentInterval := time.Duration(mod.devTTL) * time.Second
if sinceSeen <= bleAliveInterval {
lastSeen = tui.Bold(lastSeen)
} else if sinceSeen > blePresentInterval {