From b58dea42bef23eda274800f5361bc770a2911eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20K=C3=B6ritz?= Date: Thu, 29 Aug 2019 10:24:02 +0200 Subject: [PATCH] Fixed cmd subcommand, cleaned up debug output --- actioncam.go | 2 +- libipcamera/protocol.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actioncam.go b/actioncam.go index 2987169..6260582 100644 --- a/actioncam.go +++ b/actioncam.go @@ -163,7 +163,7 @@ func main() { bufio.NewReader(os.Stdin).ReadBytes('\n') }, PreRun: func(cmd *cobra.Command, args []string) { - camera = connectAndLogin(net.ParseIP(args[0]), int(port), username, password, verbose) + camera = connectAndLogin(net.ParseIP(args[1]), int(port), username, password, verbose) }, PostRun: func(cmd *cobra.Command, args []string) { camera.Disconnect() diff --git a/libipcamera/protocol.go b/libipcamera/protocol.go index 1eafdff..5d467f7 100644 --- a/libipcamera/protocol.go +++ b/libipcamera/protocol.go @@ -26,7 +26,7 @@ type Message struct { } func (m *Message) String() string { - return fmt.Sprintf("{ Message Header=%s, Payload=\n%s\n }", m.Header.String(), hex.Dump(m.Payload)) + return fmt.Sprintf("{ Message\n\tHeader=%s,\n\tPayload=\n%s\n}", m.Header.String(), hex.Dump(m.Payload)) } // StreamHeader is a live preview message header