2 Commits

Author SHA1 Message Date
4c631db418 Добавен новый раздел настроек и добавлены комментарии к некоторым другим разделам 2025-05-17 19:10:22 +03:00
26f354d82d Remove unused counter logic in live source callback
The incrementing counter and related condition were unnecessary and have been removed. This simplifies the callback function and improves code clarity without altering functionality.
2025-05-16 17:43:51 +03:00
2 changed files with 45 additions and 16 deletions

View File

@ -116,16 +116,8 @@ func handleLogin(sPack *smart.SmartPackage, pack protocol.Package) (err error) {
go videoPack.Run() go videoPack.Run()
i := 0
videoPack.AddLiveSource(2, func(data []byte) error { videoPack.AddLiveSource(2, func(data []byte) error {
fmt.Println("Есть контакт!") fmt.Println("Есть контакт!")
i++
if i > 10 {
return errors.New("я устал")
}
return nil return nil
}) })

View File

@ -152,6 +152,8 @@ type SAP struct {
UN int UN int
} }
// 7.24.3
// Alarm processing parameters
type APR struct { type APR struct {
AR ARR AR ARR
SS SS SS SS
@ -167,13 +169,6 @@ type SS struct {
EN int EN int
} }
type UAP struct {
EN int
AS int
VT int
SDT int
}
type PVLAS struct { type PVLAS struct {
EN int EN int
AS int AS int
@ -257,8 +252,10 @@ type MCMS struct {
SP []SP // Параметры сервера SP []SP // Параметры сервера
} }
// 7.12.1
// Central server configuration
type SP struct { type SP struct {
EN int // Статус сервера EN int // Флаг включения
CP int // Протокол подключения CP int // Протокол подключения
NWT int // Способ подключения NWT int // Способ подключения
CS string // Адрес сервера CS string // Адрес сервера
@ -269,7 +266,45 @@ type SP struct {
MUPORT int // UDP-порт медиасервера MUPORT int // UDP-порт медиасервера
} }
// 7.28
// NVR remote device parameters
type REDEV struct {
EN int // Флаг включения
LOCK int // ???
CHL int // Номер канала на устройстве
RECHL int // ???
ONLINE int // Доступно ли сейчас устройство
RETYPE int // Тип устройства
PROTYPE int // Тип протокола
IPTYPE int // Тип IP-адреса (IPv4/IPv6)
CONTYPE int // ???
SW int // Источник поступаемого сигнала
REPORT int // Порт камеры
REIP int // IP камеры
ID int // Идентификатор камеры
RENAME string // Название устройства
USER string // Имя пользователя
PWD string // Пароль
URL string // ???
CMDPORT string // ???
}
// 7.29
// Panel emergency alarm
type UAP struct {
EN int // Флаг включения
AS int // Уровень тревоги
T int // ???
VT int // ???
UN string // Имя тревоги
UO string // Имя тривоги на экране водителя
APR APR // Параметры обработки тревоги
// AP AP // Параметры тревоги
SDT int // ???
}
// 7.30 // 7.30
// Network monitoring status parameters
type PGDSM struct { type PGDSM struct {
PGPS PGPS `json:"PGPS,omitempty"` PGPS PGPS `json:"PGPS,omitempty"`
PDSM PDSM `json:"PDSM,omitempty"` PDSM PDSM `json:"PDSM,omitempty"`
@ -286,6 +321,7 @@ type PGPS struct {
} }
// 7.30.2 // 7.30.2
// Device status parameter
type PDSM struct { type PDSM struct {
} }
@ -323,6 +359,7 @@ type Setting struct {
EOSD []EOSD `json:"EOSD,omitempty"` EOSD []EOSD `json:"EOSD,omitempty"`
IOP []IOP `json:"IOP,omitempty"` IOP []IOP `json:"IOP,omitempty"`
SAP SAP `json:"SAP,omitempty"` SAP SAP `json:"SAP,omitempty"`
REDEV []REDEV `json:"REDEV,omitempty"`
UAP UAP `json:"UAP,omitempty"` UAP UAP `json:"UAP,omitempty"`
PGDSM PGDSM `json:"PGDSM,omitempty"` PGDSM PGDSM `json:"PGDSM,omitempty"`
PVLAS PVLAS `json:"PVLAS,omitempty"` PVLAS PVLAS `json:"PVLAS,omitempty"`