From c50ebf9991f403b9cff811b7c7ab46f05343a8a7 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Mon, 26 Feb 2018 19:03:00 +0100 Subject: [PATCH] fix: fixing compilation on windows --- modules/ble_recon.go | 2 ++ modules/ble_recon_sort.go | 2 ++ modules/ble_recon_windows.go | 55 ++++++++++++++++++++++++++++++++++++ network/ble.go | 2 ++ network/ble_device.go | 2 ++ 5 files changed, 63 insertions(+) create mode 100644 modules/ble_recon_windows.go diff --git a/modules/ble_recon.go b/modules/ble_recon.go index ce895ef1..2de824cd 100644 --- a/modules/ble_recon.go +++ b/modules/ble_recon.go @@ -1,3 +1,5 @@ +// +build !windows + package modules import ( diff --git a/modules/ble_recon_sort.go b/modules/ble_recon_sort.go index 04f485a0..a8d20e08 100644 --- a/modules/ble_recon_sort.go +++ b/modules/ble_recon_sort.go @@ -1,3 +1,5 @@ +// +build !windows + package modules import ( diff --git a/modules/ble_recon_windows.go b/modules/ble_recon_windows.go new file mode 100644 index 00000000..62e21320 --- /dev/null +++ b/modules/ble_recon_windows.go @@ -0,0 +1,55 @@ +package modules + +import ( + "fmt" + + "github.com/bettercap/bettercap/session" +) + +type BLERecon struct { + session.SessionModule +} + +func NewBLERecon(s *session.Session) *BLERecon { + d := &BLERecon{ + SessionModule: session.NewSessionModule("ble.recon", s), + } + + d.AddHandler(session.NewModuleHandler("ble.recon on", "", + "Start Bluetooth Low Energy devices discovery.", + func(args []string) error { + return fmt.Errorf("ble.recon is not supported on Windows") + })) + + d.AddHandler(session.NewModuleHandler("ble.recon off", "", + "Stop Bluetooth Low Energy devices discovery.", + func(args []string) error { + return fmt.Errorf("ble.recon is not supported on Windows") + })) + + return d +} + +func (d BLERecon) Name() string { + return "ble.recon" +} + +func (d BLERecon) Description() string { + return "Bluetooth Low Energy devices discovery." +} + +func (d BLERecon) Author() string { + return "Simone Margaritelli " +} + +func (d *BLERecon) Configure() (err error) { + return fmt.Errorf("ble.recon is not supported on Windows") +} + +func (d *BLERecon) Start() error { + return fmt.Errorf("ble.recon is not supported on Windows") +} + +func (d *BLERecon) Stop() error { + return fmt.Errorf("ble.recon is not supported on Windows") +} diff --git a/network/ble.go b/network/ble.go index dce5a203..3c6d73b9 100644 --- a/network/ble.go +++ b/network/ble.go @@ -1,3 +1,5 @@ +// +build !windows + package network import ( diff --git a/network/ble_device.go b/network/ble_device.go index 2398e772..cadce4ce 100644 --- a/network/ble_device.go +++ b/network/ble_device.go @@ -1,3 +1,5 @@ +// +build !windows + package network import (