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