4 Commits

3 changed files with 21 additions and 14 deletions

View File

@ -96,7 +96,7 @@ type EventModelGetAlarmInfoStatusResponse struct {
MotionDetectionAlarm []MotionDetectionAlarmStatus `json:"MD"` MotionDetectionAlarm []MotionDetectionAlarmStatus `json:"MD"`
IOAlarm []IOAlarmStatus `json:"IO"` IOAlarm []IOAlarmStatus `json:"IO"`
StorageAlarm []StorageAlarmStatus `json:"ST"` StorageAlarm []StorageAlarmStatus `json:"ST"`
StorageAlarmParameters []CameraCoveredAlarmStatus `json:"VS"` CameraCoveredAlarm []CameraCoveredAlarmStatus `json:"VS"`
VideoLossAlarm []VideoLossAlarmStatus `json:"VL"` VideoLossAlarm []VideoLossAlarmStatus `json:"VL"`
} }
@ -117,9 +117,8 @@ type IOAlarmStatus struct {
// 3.4.1.4.4 // 3.4.1.4.4
type CameraCoveredAlarmStatus struct { type CameraCoveredAlarmStatus struct {
ChannelMask uint `json:"CH"` Status uint `json:"ISA"`
AlarmMask uint `json:"AT"` Mask uint `json:"LCH"`
StatusMask uint `json:"AS"`
} }
// 3.4.1.4.4 // 3.4.1.4.4

View File

@ -281,12 +281,12 @@ type REDEV struct {
SW int // Источник поступаемого сигнала SW int // Источник поступаемого сигнала
REPORT int // Порт камеры REPORT int // Порт камеры
REIP string // IP камеры REIP string // IP камеры
ID int // Идентификатор камеры ID string // Идентификатор камеры
RENAME string // Название устройства RENAME string // Название устройства
USER string // Имя пользователя USER string // Имя пользователя
PWD string // Пароль PWD string // Пароль
URL string // ??? URL string // ???
CMDPORT string // ??? CMDPORT uint // ???
} }
// 7.29 // 7.29

View File

@ -6,10 +6,18 @@ import (
"encoding/hex" "encoding/hex"
) )
func GenerateVerifyKey(key string) string { func generateHMAC(key string, data string) string {
mac := hmac.New(md5.New, []byte(key)) mac := hmac.New(md5.New, []byte(key))
mac.Write([]byte(key)) mac.Write([]byte(data))
return hex.EncodeToString(mac.Sum(nil)) return hex.EncodeToString(mac.Sum(nil))
} }
func GenerateVerifyKey(key string) string {
return generateHMAC(key, key)
}
func GeneratePasswordHash(password string) string {
return generateHMAC("streaming", password)
}