mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 04:59:25 -07:00
fix: using BLE company identifier if the vendor can't be detected by MAC
This commit is contained in:
parent
272384c673
commit
1915bb565c
1 changed files with 5 additions and 1 deletions
|
@ -27,10 +27,14 @@ type bleDeviceJSON struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBLEDevice(p gatt.Peripheral, a *gatt.Advertisement, rssi int) *BLEDevice {
|
func NewBLEDevice(p gatt.Peripheral, a *gatt.Advertisement, rssi int) *BLEDevice {
|
||||||
|
vendor := ManufLookup(NormalizeMac(p.ID()))
|
||||||
|
if vendor == "" && a != nil {
|
||||||
|
vendor = a.Company
|
||||||
|
}
|
||||||
return &BLEDevice{
|
return &BLEDevice{
|
||||||
LastSeen: time.Now(),
|
LastSeen: time.Now(),
|
||||||
Device: p,
|
Device: p,
|
||||||
Vendor: ManufLookup(NormalizeMac(p.ID())),
|
Vendor: vendor,
|
||||||
Advertisement: a,
|
Advertisement: a,
|
||||||
RSSI: rssi,
|
RSSI: rssi,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue