From 0cbd6d7a9d02bc257261619d04da4ab1b9289d6b Mon Sep 17 00:00:00 2001 From: evilsocket Date: Fri, 22 Feb 2019 14:19:25 +0100 Subject: [PATCH] misc: small fix or general refactoring i did not bother commenting --- modules/ble/ble_recon.go | 2 +- modules/ble/ble_recon_events.go | 2 +- modules/ble/ble_show_services.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ble/ble_recon.go b/modules/ble/ble_recon.go index 88594866..1c54bff5 100644 --- a/modules/ble/ble_recon.go +++ b/modules/ble/ble_recon.go @@ -130,7 +130,7 @@ func (mod *BLERecon) Configure() (err error) { if mod.Running() { return session.ErrAlreadyStarted } else if mod.gattDevice == nil { - mod.Info("initializing device ...") + mod.Debug("initializing device ...") // hey Paypal GATT library, could you please just STFU?! golog.SetOutput(ioutil.Discard) diff --git a/modules/ble/ble_recon_events.go b/modules/ble/ble_recon_events.go index c3948f72..883527c8 100644 --- a/modules/ble/ble_recon_events.go +++ b/modules/ble/ble_recon_events.go @@ -8,7 +8,7 @@ import ( ) 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 { case gatt.StatePoweredOn: diff --git a/modules/ble/ble_show_services.go b/modules/ble/ble_show_services.go index 37c3ca7d..74caf79a 100644 --- a/modules/ble/ble_show_services.go +++ b/modules/ble/ble_show_services.go @@ -326,10 +326,8 @@ func (mod *BLERecon) showServices(p gatt.Peripheral, services []*gatt.Service) { } } - data := "" - raw := ([]byte)(nil) - multi := ([]string)(nil) sz := 0 + raw := ([]byte)(nil) err := error(nil) if isReadable { 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 { data = tui.Red(err.Error()) } else if ch.Name() == "Appearance" && sz >= 2 {