mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -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 {
|
||||
vendor := ManufLookup(NormalizeMac(p.ID()))
|
||||
if vendor == "" && a != nil {
|
||||
vendor = a.Company
|
||||
}
|
||||
return &BLEDevice{
|
||||
LastSeen: time.Now(),
|
||||
Device: p,
|
||||
Vendor: ManufLookup(NormalizeMac(p.ID())),
|
||||
Vendor: vendor,
|
||||
Advertisement: a,
|
||||
RSSI: rssi,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue