mirror of
https://github.com/bettercap/bettercap
synced 2025-07-10 15:23:30 -07:00
refact: refactored module status checks in Configure methods for consistency
This commit is contained in:
parent
a8e6b497a3
commit
1e7d99433e
13 changed files with 52 additions and 53 deletions
|
@ -111,7 +111,9 @@ func (d *BLERecon) isEnumerating() bool {
|
|||
}
|
||||
|
||||
func (d *BLERecon) Configure() (err error) {
|
||||
if d.gattDevice == nil {
|
||||
if d.Running() {
|
||||
return session.ErrAlreadyStarted
|
||||
} else if d.gattDevice == nil {
|
||||
log.Info("Initializing BLE device ...")
|
||||
|
||||
// hey Paypal GATT library, could you please just STFU?!
|
||||
|
@ -147,9 +149,7 @@ func (d *BLERecon) pruner() {
|
|||
}
|
||||
|
||||
func (d *BLERecon) Start() error {
|
||||
if d.Running() {
|
||||
return session.ErrAlreadyStarted
|
||||
} else if err := d.Configure(); err != nil {
|
||||
if err := d.Configure(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue