Added LOGIN constant
This commit is contained in:
parent
13d8ad5b0a
commit
2fa6afbfbd
2 changed files with 2 additions and 1 deletions
|
|
@ -30,6 +30,7 @@ type Camera struct {
|
||||||
type MessageHandler func(camera *Camera, message *Message) (bool, error)
|
type MessageHandler func(camera *Camera, message *Message) (bool, error)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
LOGIN = 0x0110
|
||||||
LOGIN_ACCEPT = 0x0111
|
LOGIN_ACCEPT = 0x0111
|
||||||
START_PREVIEW = 0x01FF
|
START_PREVIEW = 0x01FF
|
||||||
REQUEST_FILE_LIST = 0xA025
|
REQUEST_FILE_LIST = 0xA025
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ func CreateCommandHeader(command uint32) Header {
|
||||||
|
|
||||||
// CreateLoginPacket creates a Login packet to be sent to the camera
|
// CreateLoginPacket creates a Login packet to be sent to the camera
|
||||||
func CreateLoginPacket(username, password string) []byte {
|
func CreateLoginPacket(username, password string) []byte {
|
||||||
header := CreateCommandHeader(0x00000110) // Login
|
header := CreateCommandHeader(LOGIN) // Login
|
||||||
payload := make([]byte, 128)
|
payload := make([]byte, 128)
|
||||||
copy(payload, []byte(username))
|
copy(payload, []byte(username))
|
||||||
copy(payload[64:], []byte(password))
|
copy(payload[64:], []byte(password))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue