bettercap/network/ble_device.go
2018-02-26 19:03:00 +01:00

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,
}
}