diff --git a/modules/graph/create.go b/modules/graph/create.go index 0accf6a7..31f752cf 100644 --- a/modules/graph/create.go +++ b/modules/graph/create.go @@ -148,22 +148,6 @@ func (mod *Module) createDot11ProbeGraph(ssid string, station *network.Station) return ssidNode, ssidIsNew, staNode, staIsNew, nil } -func (mod *Module) createBLEServerGraph(dev *network.BLEDevice) (*Node, bool, error) { - mac := network.NormalizeMac(dev.Device.ID()) - node, err := mod.db.FindNode(BLEServer, mac) - isNew := node == nil - if err != nil { - return nil, false, err - } else if isNew { - if node, err = mod.db.CreateNode(BLEServer, mac, dev, ""); err != nil { - return nil, false, err - } - } else if err = mod.db.UpdateNode(node); err != nil { - return nil, false, err - } - return node, isNew, nil -} - func (mod *Module) connectAsSame(a, b *Node) error { if aIsB, err := mod.db.FindLastEdgeOfType(a, b, Is); err != nil { return err diff --git a/modules/graph/create_ble.go b/modules/graph/create_ble.go new file mode 100644 index 00000000..dc71fb8b --- /dev/null +++ b/modules/graph/create_ble.go @@ -0,0 +1,22 @@ +//go:build !windows +// +build !windows + +package graph + +import "github.com/bettercap/bettercap/v2/network" + +func (mod *Module) createBLEServerGraph(dev *network.BLEDevice) (*Node, bool, error) { + mac := network.NormalizeMac(dev.Device.ID()) + node, err := mod.db.FindNode(BLEServer, mac) + isNew := node == nil + if err != nil { + return nil, false, err + } else if isNew { + if node, err = mod.db.CreateNode(BLEServer, mac, dev, ""); err != nil { + return nil, false, err + } + } else if err = mod.db.UpdateNode(node); err != nil { + return nil, false, err + } + return node, isNew, nil +} diff --git a/modules/graph/create_ble_unsupported.go b/modules/graph/create_ble_unsupported.go new file mode 100644 index 00000000..bf413cae --- /dev/null +++ b/modules/graph/create_ble_unsupported.go @@ -0,0 +1,10 @@ +//go:build windows +// +build windows + +package graph + +import "github.com/bettercap/bettercap/v2/network" + +func (mod *Module) createBLEServerGraph(dev *network.BLEDevice) (*Node, bool, error) { + return nil, false, nil +}