From 2fa6afbfbdb8d47a95294e9626292fff47e8f9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20K=C3=B6ritz?= Date: Wed, 11 Sep 2019 18:15:01 +0200 Subject: [PATCH] Added LOGIN constant --- libipcamera/Camera.go | 1 + libipcamera/protocol.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libipcamera/Camera.go b/libipcamera/Camera.go index 7aafa7f..f16cd33 100644 --- a/libipcamera/Camera.go +++ b/libipcamera/Camera.go @@ -30,6 +30,7 @@ type Camera struct { type MessageHandler func(camera *Camera, message *Message) (bool, error) const ( + LOGIN = 0x0110 LOGIN_ACCEPT = 0x0111 START_PREVIEW = 0x01FF REQUEST_FILE_LIST = 0xA025 diff --git a/libipcamera/protocol.go b/libipcamera/protocol.go index 5d467f7..8a52db9 100644 --- a/libipcamera/protocol.go +++ b/libipcamera/protocol.go @@ -61,7 +61,7 @@ func CreateCommandHeader(command uint32) Header { // CreateLoginPacket creates a Login packet to be sent to the camera func CreateLoginPacket(username, password string) []byte { - header := CreateCommandHeader(0x00000110) // Login + header := CreateCommandHeader(LOGIN) // Login payload := make([]byte, 128) copy(payload, []byte(username)) copy(payload[64:], []byte(password))