mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
fix: flagging as unsupported the BLE module on macOS as the GATT library support is not complete.
This commit is contained in:
parent
ee59fefbcd
commit
fe00cc707f
9 changed files with 34 additions and 34 deletions
|
@ -1,11 +0,0 @@
|
||||||
package modules
|
|
||||||
|
|
||||||
import "github.com/bettercap/gatt"
|
|
||||||
|
|
||||||
var defaultBLEClientOptions = []gatt.Option{
|
|
||||||
gatt.MacDeviceRole(gatt.CentralManager),
|
|
||||||
}
|
|
||||||
|
|
||||||
var defaultBLEServerOptions = []gatt.Option{
|
|
||||||
gatt.MacDeviceRole(gatt.PeripheralManager),
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !windows
|
// +build !windows !darwin
|
||||||
|
|
||||||
package modules
|
package modules
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !windows
|
// +build !windows !darwin
|
||||||
|
|
||||||
package modules
|
package modules
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !windows
|
// +build !windows !darwin
|
||||||
|
|
||||||
package modules
|
package modules
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// +build windows darwin
|
||||||
|
|
||||||
package modules
|
package modules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -10,6 +12,17 @@ type BLERecon struct {
|
||||||
session.SessionModule
|
session.SessionModule
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// darwin
|
||||||
|
|
||||||
|
var defaultBLEClientOptions = []gatt.Option{
|
||||||
|
gatt.MacDeviceRole(gatt.CentralManager),
|
||||||
|
}
|
||||||
|
|
||||||
|
var defaultBLEServerOptions = []gatt.Option{
|
||||||
|
gatt.MacDeviceRole(gatt.PeripheralManager),
|
||||||
|
}
|
||||||
|
*/
|
||||||
func NewBLERecon(s *session.Session) *BLERecon {
|
func NewBLERecon(s *session.Session) *BLERecon {
|
||||||
d := &BLERecon{
|
d := &BLERecon{
|
||||||
SessionModule: session.NewSessionModule("ble.recon", s),
|
SessionModule: session.NewSessionModule("ble.recon", s),
|
||||||
|
@ -43,13 +56,13 @@ func (d BLERecon) Author() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *BLERecon) Configure() (err error) {
|
func (d *BLERecon) Configure() (err error) {
|
||||||
return fmt.Errorf("ble.recon is not supported on Windows")
|
return fmt.Errorf("ble.recon is not supported on Windows and macOS")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *BLERecon) Start() error {
|
func (d *BLERecon) Start() error {
|
||||||
return fmt.Errorf("ble.recon is not supported on Windows")
|
return fmt.Errorf("ble.recon is not supported on Windows and macOS")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *BLERecon) Stop() error {
|
func (d *BLERecon) Stop() error {
|
||||||
return fmt.Errorf("ble.recon is not supported on Windows")
|
return fmt.Errorf("ble.recon is not supported on Windows and macOS")
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !windows
|
// +build !windows !darwin
|
||||||
|
|
||||||
package network
|
package network
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !windows
|
// +build !windows !darwin
|
||||||
|
|
||||||
package network
|
package network
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
package network
|
|
||||||
|
|
||||||
import (
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
type BLEDevice struct {
|
|
||||||
LastSeen time.Time
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewBLEDevice() *BLEDevice {
|
|
||||||
return &BLEDevice{
|
|
||||||
LastSeen: time.Now(),
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +1,22 @@
|
||||||
|
// +build windows darwin
|
||||||
|
|
||||||
package network
|
package network
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type BLEDevice struct {
|
||||||
|
LastSeen time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewBLEDevice() *BLEDevice {
|
||||||
|
return &BLEDevice{
|
||||||
|
LastSeen: time.Now(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type BLEDevNewCallback func(dev *BLEDevice)
|
type BLEDevNewCallback func(dev *BLEDevice)
|
||||||
type BLEDevLostCallback func(dev *BLEDevice)
|
type BLEDevLostCallback func(dev *BLEDevice)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue