mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
4d60494bfb
commit
0cbd6d7a9d
3 changed files with 5 additions and 5 deletions
|
@ -130,7 +130,7 @@ func (mod *BLERecon) Configure() (err error) {
|
||||||
if mod.Running() {
|
if mod.Running() {
|
||||||
return session.ErrAlreadyStarted
|
return session.ErrAlreadyStarted
|
||||||
} else if mod.gattDevice == nil {
|
} else if mod.gattDevice == nil {
|
||||||
mod.Info("initializing device ...")
|
mod.Debug("initializing device ...")
|
||||||
|
|
||||||
// hey Paypal GATT library, could you please just STFU?!
|
// hey Paypal GATT library, could you please just STFU?!
|
||||||
golog.SetOutput(ioutil.Discard)
|
golog.SetOutput(ioutil.Discard)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (mod *BLERecon) onStateChanged(dev gatt.Device, s gatt.State) {
|
func (mod *BLERecon) onStateChanged(dev gatt.Device, s gatt.State) {
|
||||||
mod.Info("state changed to %v", s)
|
mod.Debug("state changed to %v", s)
|
||||||
|
|
||||||
switch s {
|
switch s {
|
||||||
case gatt.StatePoweredOn:
|
case gatt.StatePoweredOn:
|
||||||
|
|
|
@ -326,10 +326,8 @@ func (mod *BLERecon) showServices(p gatt.Peripheral, services []*gatt.Service) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data := ""
|
|
||||||
raw := ([]byte)(nil)
|
|
||||||
multi := ([]string)(nil)
|
|
||||||
sz := 0
|
sz := 0
|
||||||
|
raw := ([]byte)(nil)
|
||||||
err := error(nil)
|
err := error(nil)
|
||||||
if isReadable {
|
if isReadable {
|
||||||
raw, err = p.ReadCharacteristic(ch)
|
raw, err = p.ReadCharacteristic(ch)
|
||||||
|
@ -338,6 +336,8 @@ func (mod *BLERecon) showServices(p gatt.Peripheral, services []*gatt.Service) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data := ""
|
||||||
|
multi := ([]string)(nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
data = tui.Red(err.Error())
|
data = tui.Red(err.Error())
|
||||||
} else if ch.Name() == "Appearance" && sz >= 2 {
|
} else if ch.Name() == "Appearance" && sz >= 2 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue