mirror of
https://github.com/bettercap/bettercap
synced 2025-07-11 07:37:00 -07:00
27 lines
496 B
Go
27 lines
496 B
Go
// +build !windows
|
|
|
|
package network
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/bettercap/gatt"
|
|
)
|
|
|
|
type BLEDevice struct {
|
|
LastSeen time.Time
|
|
Device gatt.Peripheral
|
|
Vendor string
|
|
Advertisement *gatt.Advertisement
|
|
RSSI int
|
|
}
|
|
|
|
func NewBLEDevice(p gatt.Peripheral, a *gatt.Advertisement, rssi int) *BLEDevice {
|
|
return &BLEDevice{
|
|
LastSeen: time.Now(),
|
|
Device: p,
|
|
Vendor: OuiLookup(NormalizeMac(p.ID())),
|
|
Advertisement: a,
|
|
RSSI: rssi,
|
|
}
|
|
}
|