You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/10/12 21:07:59 UTC
incubator-mynewt-newt git commit: newtmgr - Indicate hex dump of
undecodable rsps.
Repository: incubator-mynewt-newt
Updated Branches:
refs/heads/develop 7b802ae47 -> 80a676e13
newtmgr - Indicate hex dump of undecodable rsps.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/80a676e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/80a676e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/80a676e1
Branch: refs/heads/develop
Commit: 80a676e13c34fb04be7e4e31bea2af14592161cf
Parents: 7b802ae
Author: Christopher Collins <cc...@apache.org>
Authored: Wed Oct 12 14:07:31 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Wed Oct 12 14:07:51 2016 -0700
----------------------------------------------------------------------
newtmgr/transport/connserial.go | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/80a676e1/newtmgr/transport/connserial.go
----------------------------------------------------------------------
diff --git a/newtmgr/transport/connserial.go b/newtmgr/transport/connserial.go
index c16c8f1..11ceadc 100644
--- a/newtmgr/transport/connserial.go
+++ b/newtmgr/transport/connserial.go
@@ -23,6 +23,7 @@ import (
"bufio"
"encoding/base64"
"encoding/binary"
+ "encoding/hex"
"fmt"
"time"
@@ -87,8 +88,9 @@ func (cs *ConnSerial) ReadPacket() (*Packet, error) {
data, err := base64.StdEncoding.DecodeString(base64Data)
if err != nil {
return nil, util.NewNewtError(
- fmt.Sprintf("Couldn't decode base64 string: %b",
- base64Data))
+ fmt.Sprintf("Couldn't decode base64 string: %s\n"+
+ "Packet hex dump:\n%s",
+ base64Data, hex.Dump(line)))
}
if line[0] == 6 && line[1] == 9 {