misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2019-02-22 14:19:25 +01:00
commit 0cbd6d7a9d
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 5 additions and 5 deletions

View file

@ -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)

View file

@ -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:

View file

@ -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 {