diff --git a/.gitmodules b/.gitmodules
index c2afc4d..877efd4 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -6,10 +6,6 @@
path = src/uClibc/uClibc
url = https://github.com/kraj/uClibc.git
ignore = dirty
-[submodule "src/busybox/busybox"]
- path = src/busybox/busybox
- url = https://github.com/mirror/busybox.git
- ignore = dirty
[submodule "src/proxychains-ng/proxychains-ng"]
path = src/proxychains-ng/proxychains-ng
url = https://github.com/rofl0r/proxychains-ng.git
@@ -26,10 +22,6 @@
path = src/mosquitto/mosquitto
url = https://github.com/eclipse/mosquitto.git
ignore = dirty
-[submodule "src/wsdd/wsdd"]
- path = src/wsdd/wsdd
- url = https://github.com/KoynovStas/wsdd.git
- ignore = dirty
[submodule "src/libfuse/libfuse"]
path = src/libfuse/libfuse
url = https://github.com/libfuse/libfuse.git
@@ -42,3 +34,6 @@
path = src/curl/curl
url = https://github.com/curl/curl
ignore = dirty
+[submodule "src/onvif_simple_server/onvif_simple_server"]
+ path = src/onvif_simple_server/onvif_simple_server
+ url = https://github.com/roleoroleo/onvif_simple_server
diff --git a/README.md b/README.md
index 52a7448..bac96ab 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
The answer is simple: missing updates, RTSP, and not based on the latest stock firmware (which features improvements and new cool stuff).
Besides, there were no updates to `yi-hack-v4`, and I am against that RTSP licensing model. I have contributed enough and will continue my work separately.
-I am slowly releasing beta versions, and I can see lots of downloads, testing and contributions. A big thank you to the community.
+I am slowly working on pre-release versions, and I can see lots of downloads, testing and contributions. A big thank you to the community.
## Table of Contents
@@ -109,7 +109,7 @@ Alternative way:
-3. Get the correct firmware files for your camera from the latest baseline release link: https://github.com/alienatedsec/yi-hack-v5/releases/tag/0.3.8
+3. Get the correct firmware files for your camera from the latest baseline release link: https://github.com/alienatedsec/yi-hack-v5/releases/tag/0.4.1
| Camera | rootfs partition | home partition | Remarks |
| --- | --- | --- | --- |
@@ -138,7 +138,7 @@ Depending upon your network setup, accessing the web interface with the hostname
This can be done from the App. Please open the app, and go to the Camera Settings --> Network Info --> IP Address.
-Access the web interface by entering the IP address of the camera in a web browser. e.g. `http://192.168.1.5:8080`
+Access the web interface by entering the IP address of the camera in a web browser. e.g. `http://192.168.1.5`
**_IMPORTANT: If you have multiple cameras. It is important to configure each camera with a unique hostname. Otherwise, the web interface will only be accessible by IP address._**
diff --git a/VERSION b/VERSION
index 1d0ba9e..bbf7b85 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.4.0
+0.4.1g
diff --git a/scripts/compile.sh b/scripts/compile.sh
index 6c7972d..5e6fb2c 100755
--- a/scripts/compile.sh
+++ b/scripts/compile.sh
@@ -39,6 +39,7 @@ compile_module()
printf "MOD_COMPILE: %s\n" "$MOD_COMPILE"
printf "MOD_INSTALL: %s\n" "$MOD_INSTALL"
+ echo "Compile $MOD_NAME"
cd "$MOD_DIR"
if [ ! -f $MOD_INIT ]; then
@@ -89,10 +90,22 @@ mkdir -p "$(get_script_dir)/../build/home"
mkdir -p "$(get_script_dir)/../build/rootfs"
SRC_DIR=$(get_script_dir)/../src
+SELECTED_MODULE=$1
+if [ -n ${SELECTED_MODULE} ]; then
+ echo "SELECTED_MODULE: $SELECTED_MODULE"
+fi
for SUB_DIR in $SRC_DIR/* ; do
if [ -d ${SUB_DIR} ]; then # Will not run if no directories are available
- compile_module $(normalize_path "$SUB_DIR") || exit 1
+ if [ -n ${SELECTED_MODULE} ]; then
+ if [[ $SUB_DIR == *"$SELECTED_MODULE"* ]]; then
+ compile_module $(normalize_path "$SUB_DIR") || exit 1
+ else
+ echo "Skip $SUB_DIR"
+ fi
+ else
+ compile_module $(normalize_path "$SUB_DIR") || exit 1
+ fi
fi
done
diff --git a/scripts/pack_fw.sh b/scripts/pack_fw.sh
index 6b25b43..d88d3d7 100755
--- a/scripts/pack_fw.sh
+++ b/scripts/pack_fw.sh
@@ -3,7 +3,7 @@
#
# This file is part of yi-hack-v5 (https://github.com/alienatedsec/yi-hack-v5).
# Copyright (c) 2018-2019 Davide Maggioni - v4 specific
-# Copyright (c) 2021-2023 alienatedsec - v5 specific
+# Copyright (c) 2021-2024 alienatedsec - v5 specific
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -206,6 +206,10 @@ compress_file "$TMP_DIR/home/app" cloudAPI
compress_file "$TMP_DIR/home/app" oss
compress_file "$TMP_DIR/home/app" p2p_tnp
compress_file "$TMP_DIR/home/app" rmm
+compress_file "$TMP_DIR/home/base/tools" wpa_supplicant
+compress_file "$TMP_DIR/home/base/tools" wpa_passphrase
+compress_file "$TMP_DIR/home/base/tools" wpa_cli
+compress_file "$TMP_DIR/home/lib" libcrypto.so.1.1
# Compress the yi-hack-v5 folder
printf "Compressing yi-hack-v5... "
@@ -223,18 +227,24 @@ rm $TMP_DIR/home/yi-hack-v5/yi-hack-v5.7z
echo "Deleteing of yi-hack-v5.7z - done!"
# Delete all the compressed files except system_init.sh and yi-hack-v5.7z
+#find $TMP_DIR/home/yi-hack-v5/* -maxdepth 0 -type d ! -name 'script' -exec rm -rf {} +
find $TMP_DIR/home/yi-hack-v5/script/ -maxdepth 0 ! -name 'system_init.sh' -type f -exec rm -f {} +
-find $TMP_DIR/home/yi-hack-v5/* -maxdepth 0 -type d ! -name 'script' -exec rm -rf {} +
+find $TMP_DIR/home/yi-hack-v5/* -maxdepth 0 -type d ! \( -name 'script' -o -name 'etc' -o -name 'lib' \) -exec rm -rf {} \;
+find $TMP_DIR/home/yi-hack-v5/lib/ -type f ! -name 'ipc_multiplex.so' -exec rm -f {} \;
find $TMP_DIR/home/yi-hack-v5/* -maxdepth 0 -type f ! -name 'version' -exec rm {} +
+
+# Delete the old wpa_supplicant upgrade file from the image so it wont override the release version
+find $TMP_DIR/home/app/ -type f -name 'wpa_supplicant' -exec rm -f {} \;
+
printf "done!\n\n"
# home
# Disabled after 0.3.8
-#pack_image "home" $CAMERA_ID $TMP_DIR $OUT_DIR
+pack_image "home" $CAMERA_ID $TMP_DIR $OUT_DIR
# rootfs
# Disabled after 0.3.8
-#pack_image "rootfs" $CAMERA_ID $TMP_DIR $OUT_DIR
+pack_image "rootfs" $CAMERA_ID $TMP_DIR $OUT_DIR
# pack files for release
pack_files $WORK_DIR $CAMERA_NAME $VERSION_ID
@@ -247,4 +257,3 @@ printf "done!\n\n"
echo "------------------------------------------------------------------------"
echo " Finished!"
echo "------------------------------------------------------------------------"
-
diff --git a/src/busybox/.config b/src/busybox/.config
old mode 100644
new mode 100755
index dbf9c0a..9643fb4
--- a/src/busybox/.config
+++ b/src/busybox/.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Busybox version: 1.31.1
-# Thu Apr 29 20:02:02 2021
+# Busybox version: 1.36.1
+# Tue Jan 30 21:11:49 2024
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -36,7 +36,6 @@ CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
# CONFIG_FEATURE_CLEAN_UP is not set
CONFIG_FEATURE_SYSLOG_INFO=y
CONFIG_FEATURE_SYSLOG=y
-CONFIG_PLATFORM_LINUX=y
#
# Build Options
@@ -55,6 +54,7 @@ CONFIG_EXTRA_LDFLAGS=""
CONFIG_EXTRA_LDLIBS=""
# CONFIG_USE_PORTABLE_CODE is not set
# CONFIG_STACK_OPTIMIZATION_386 is not set
+# CONFIG_STATIC_LIBGCC is not set
#
# Installation Options ("make install" behavior)
@@ -76,6 +76,7 @@ CONFIG_PREFIX="../_install"
# CONFIG_DEBUG_SANITIZE is not set
# CONFIG_UNIT_TEST is not set
# CONFIG_WERROR is not set
+# CONFIG_WARN_SIMPLE_MSG is not set
CONFIG_NO_DEBUG_LIB=y
# CONFIG_DMALLOC is not set
# CONFIG_EFENCE is not set
@@ -92,10 +93,16 @@ CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
CONFIG_PASSWORD_MINLEN=6
CONFIG_MD5_SMALL=1
+CONFIG_SHA1_SMALL=3
+CONFIG_SHA1_HWACCEL=y
+CONFIG_SHA256_HWACCEL=y
CONFIG_SHA3_SMALL=1
-CONFIG_FEATURE_FAST_TOP=y
-# CONFIG_FEATURE_ETC_NETWORKS is not set
-# CONFIG_FEATURE_ETC_SERVICES is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
+# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
+CONFIG_FEATURE_USE_SENDFILE=y
+CONFIG_FEATURE_COPYBUF_KB=4
+# CONFIG_MONOTONIC_SYSCALL is not set
+CONFIG_IOCTL_HEX2STR_ERROR=y
CONFIG_FEATURE_EDITING=y
CONFIG_FEATURE_EDITING_MAX_LEN=1024
# CONFIG_FEATURE_EDITING_VI is not set
@@ -119,14 +126,9 @@ CONFIG_LAST_SUPPORTED_WCHAR=767
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
# CONFIG_UNICODE_PRESERVE_BROKEN is not set
-CONFIG_FEATURE_NON_POSIX_CP=y
-# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
-CONFIG_FEATURE_USE_SENDFILE=y
-CONFIG_FEATURE_COPYBUF_KB=4
-CONFIG_FEATURE_SKIP_ROOTFS=y
-# CONFIG_MONOTONIC_SYSCALL is not set
-CONFIG_IOCTL_HEX2STR_ERROR=y
-CONFIG_FEATURE_HWIB=y
+# CONFIG_LOOP_CONFIGURE is not set
+# CONFIG_NO_LOOP_CONFIGURE is not set
+CONFIG_TRY_LOOP_CONFIGURE=y
#
# Applets
@@ -161,6 +163,8 @@ CONFIG_FEATURE_BZIP2_DECOMPRESS=y
# CONFIG_CPIO is not set
# CONFIG_FEATURE_CPIO_O is not set
# CONFIG_FEATURE_CPIO_P is not set
+# CONFIG_FEATURE_CPIO_IGNORE_DEVNO is not set
+# CONFIG_FEATURE_CPIO_RENUMBER_INODES is not set
# CONFIG_DPKG is not set
# CONFIG_DPKG_DEB is not set
CONFIG_GZIP=y
@@ -196,6 +200,22 @@ CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
#
# Coreutils
#
+CONFIG_FEATURE_VERBOSE=y
+
+#
+# Common options for date and touch
+#
+CONFIG_FEATURE_TIMEZONE=y
+
+#
+# Common options for cp and mv
+#
+CONFIG_FEATURE_PRESERVE_HARDLINKS=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
CONFIG_BASENAME=y
CONFIG_CAT=y
CONFIG_FEATURE_CATN=y
@@ -206,11 +226,13 @@ CONFIG_CHOWN=y
CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y
# CONFIG_CHROOT is not set
# CONFIG_CKSUM is not set
+# CONFIG_CRC32 is not set
# CONFIG_COMM is not set
CONFIG_CP=y
CONFIG_FEATURE_CP_LONG_OPTIONS=y
CONFIG_FEATURE_CP_REFLINK=y
CONFIG_CUT=y
+CONFIG_FEATURE_CUT_REGEX=y
CONFIG_DATE=y
CONFIG_FEATURE_DATE_ISOFMT=y
# CONFIG_FEATURE_DATE_NANO is not set
@@ -222,6 +244,7 @@ CONFIG_FEATURE_DD_IBS_OBS=y
CONFIG_FEATURE_DD_STATUS=y
CONFIG_DF=y
CONFIG_FEATURE_DF_FANCY=y
+CONFIG_FEATURE_SKIP_ROOTFS=y
CONFIG_DIRNAME=y
# CONFIG_DOS2UNIX is not set
# CONFIG_UNIX2DOS is not set
@@ -315,13 +338,13 @@ CONFIG_TEST2=y
# CONFIG_FEATURE_TEST_64 is not set
# CONFIG_TIMEOUT is not set
CONFIG_TOUCH=y
-# CONFIG_FEATURE_TOUCH_NODEREF is not set
# CONFIG_FEATURE_TOUCH_SUSV3 is not set
CONFIG_TR=y
CONFIG_FEATURE_TR_CLASSES=y
CONFIG_FEATURE_TR_EQUIV=y
# CONFIG_TRUE is not set
# CONFIG_TRUNCATE is not set
+# CONFIG_TSORT is not set
# CONFIG_TTY is not set
# CONFIG_UNAME is not set
CONFIG_UNAME_OSNAME=""
@@ -330,31 +353,17 @@ CONFIG_BB_ARCH=y
# CONFIG_UNLINK is not set
CONFIG_USLEEP=y
# CONFIG_UUDECODE is not set
+# CONFIG_BASE32 is not set
CONFIG_BASE64=y
# CONFIG_UUENCODE is not set
# CONFIG_WC is not set
# CONFIG_FEATURE_WC_LARGE is not set
-# CONFIG_WHOAMI is not set
# CONFIG_WHO is not set
# CONFIG_W is not set
# CONFIG_USERS is not set
+# CONFIG_WHOAMI is not set
# CONFIG_YES is not set
-#
-# Common options
-#
-CONFIG_FEATURE_VERBOSE=y
-
-#
-# Common options for cp and mv
-#
-CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-
-#
-# Common options for df, du, ls
-#
-CONFIG_FEATURE_HUMAN_READABLE=y
-
#
# Console Utilities
#
@@ -418,6 +427,7 @@ CONFIG_VI=y
CONFIG_FEATURE_VI_MAX_LEN=4096
# CONFIG_FEATURE_VI_8BIT is not set
CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_COLON_EXPAND=y
CONFIG_FEATURE_VI_YANKMARK=y
CONFIG_FEATURE_VI_SEARCH=y
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
@@ -431,6 +441,7 @@ CONFIG_FEATURE_VI_ASK_TERMINAL=y
CONFIG_FEATURE_VI_UNDO=y
CONFIG_FEATURE_VI_UNDO_QUEUE=y
CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256
+CONFIG_FEATURE_VI_VERBOSE_STATUS=y
CONFIG_FEATURE_ALLOW_EXEC=y
#
@@ -439,7 +450,11 @@ CONFIG_FEATURE_ALLOW_EXEC=y
CONFIG_FIND=y
CONFIG_FEATURE_FIND_PRINT0=y
CONFIG_FEATURE_FIND_MTIME=y
+CONFIG_FEATURE_FIND_ATIME=y
+CONFIG_FEATURE_FIND_CTIME=y
CONFIG_FEATURE_FIND_MMIN=y
+CONFIG_FEATURE_FIND_AMIN=y
+CONFIG_FEATURE_FIND_CMIN=y
CONFIG_FEATURE_FIND_PERM=y
CONFIG_FEATURE_FIND_TYPE=y
CONFIG_FEATURE_FIND_EXECUTABLE=y
@@ -447,6 +462,7 @@ CONFIG_FEATURE_FIND_XDEV=y
CONFIG_FEATURE_FIND_MAXDEPTH=y
CONFIG_FEATURE_FIND_NEWER=y
CONFIG_FEATURE_FIND_INUM=y
+CONFIG_FEATURE_FIND_SAMEFILE=y
CONFIG_FEATURE_FIND_EXEC=y
CONFIG_FEATURE_FIND_EXEC_PLUS=y
CONFIG_FEATURE_FIND_USER=y
@@ -458,6 +474,7 @@ CONFIG_FEATURE_FIND_SIZE=y
CONFIG_FEATURE_FIND_PRUNE=y
CONFIG_FEATURE_FIND_QUIT=y
CONFIG_FEATURE_FIND_DELETE=y
+CONFIG_FEATURE_FIND_EMPTY=y
CONFIG_FEATURE_FIND_PATH=y
CONFIG_FEATURE_FIND_REGEX=y
# CONFIG_FEATURE_FIND_CONTEXT is not set
@@ -507,10 +524,10 @@ CONFIG_USE_BB_PWD_GRP=y
CONFIG_USE_BB_SHADOW=y
CONFIG_USE_BB_CRYPT=y
CONFIG_USE_BB_CRYPT_SHA=y
-CONFIG_ADDGROUP=y
-CONFIG_FEATURE_ADDUSER_TO_GROUP=y
CONFIG_ADD_SHELL=y
CONFIG_REMOVE_SHELL=y
+CONFIG_ADDGROUP=y
+CONFIG_FEATURE_ADDUSER_TO_GROUP=y
CONFIG_ADDUSER=y
# CONFIG_FEATURE_CHECK_NAMES is not set
CONFIG_LAST_ID=60000
@@ -617,7 +634,6 @@ CONFIG_FLOCK=y
# CONFIG_GETOPT is not set
# CONFIG_FEATURE_GETOPT_LONG is not set
CONFIG_HEXDUMP=y
-CONFIG_FEATURE_HEXDUMP_REVERSE=y
CONFIG_HD=y
# CONFIG_XXD is not set
# CONFIG_HWCLOCK is not set
@@ -688,6 +704,7 @@ CONFIG_SWAPON=y
# CONFIG_SWITCH_ROOT is not set
# CONFIG_TASKSET is not set
# CONFIG_FEATURE_TASKSET_FANCY is not set
+# CONFIG_FEATURE_TASKSET_CPULIST is not set
# CONFIG_UEVENT is not set
CONFIG_UMOUNT=y
CONFIG_FEATURE_UMOUNT_ALL=y
@@ -708,6 +725,7 @@ CONFIG_VOLUMEID=y
# CONFIG_FEATURE_VOLUMEID_BCACHE is not set
CONFIG_FEATURE_VOLUMEID_BTRFS=y
CONFIG_FEATURE_VOLUMEID_CRAMFS=y
+CONFIG_FEATURE_VOLUMEID_EROFS=y
CONFIG_FEATURE_VOLUMEID_EXFAT=y
CONFIG_FEATURE_VOLUMEID_EXT=y
# CONFIG_FEATURE_VOLUMEID_F2FS is not set
@@ -735,6 +753,7 @@ CONFIG_FEATURE_VOLUMEID_XFS=y
# Miscellaneous Utilities
#
# CONFIG_ADJTIMEX is not set
+CONFIG_ASCII=y
# CONFIG_BBCONFIG is not set
# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
CONFIG_BC=y
@@ -768,10 +787,10 @@ CONFIG_CRONTAB=y
# CONFIG_FEATURE_DEVFS is not set
# CONFIG_DEVMEM is not set
# CONFIG_FBSPLASH is not set
-CONFIG_FLASHCP=y
CONFIG_FLASH_ERASEALL=y
# CONFIG_FLASH_LOCK is not set
# CONFIG_FLASH_UNLOCK is not set
+CONFIG_FLASHCP=y
CONFIG_HDPARM=y
CONFIG_FEATURE_HDPARM_GET_IDENTITY=y
CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y
@@ -805,6 +824,7 @@ CONFIG_FEATURE_LESS_MAXLINES=0
# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
# CONFIG_MAN is not set
# CONFIG_MICROCOM is not set
+# CONFIG_MIM is not set
# CONFIG_MT is not set
# CONFIG_NANDWRITE is not set
# CONFIG_NANDDUMP is not set
@@ -814,21 +834,24 @@ CONFIG_FEATURE_LESS_MAXLINES=0
# CONFIG_RFKILL is not set
# CONFIG_RUNLEVEL is not set
# CONFIG_RX is not set
+# CONFIG_SEEDRNG is not set
CONFIG_SETFATTR=y
# CONFIG_SETSERIAL is not set
# CONFIG_STRINGS is not set
# CONFIG_TIME is not set
+# CONFIG_TREE is not set
CONFIG_TS=y
# CONFIG_TTYSIZE is not set
-# CONFIG_UBIRENAME is not set
# CONFIG_UBIATTACH is not set
# CONFIG_UBIDETACH is not set
# CONFIG_UBIMKVOL is not set
# CONFIG_UBIRMVOL is not set
# CONFIG_UBIRSVOL is not set
# CONFIG_UBIUPDATEVOL is not set
+# CONFIG_UBIRENAME is not set
# CONFIG_VOLNAME is not set
# CONFIG_WATCHDOG is not set
+# CONFIG_FEATURE_WATCHDOG_OPEN_TWICE is not set
#
# Networking Utilities
@@ -837,6 +860,9 @@ CONFIG_FEATURE_IPV6=y
# CONFIG_FEATURE_UNIX_LOCAL is not set
CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
+# CONFIG_FEATURE_ETC_NETWORKS is not set
+# CONFIG_FEATURE_ETC_SERVICES is not set
+CONFIG_FEATURE_HWIB=y
# CONFIG_FEATURE_TLS_SHA1 is not set
CONFIG_ARP=y
CONFIG_ARPING=y
@@ -855,6 +881,7 @@ CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y
CONFIG_HOSTNAME=y
# CONFIG_DNSDOMAINNAME is not set
CONFIG_HTTPD=y
+CONFIG_FEATURE_HTTPD_PORT_DEFAULT=80
CONFIG_FEATURE_HTTPD_RANGES=y
# CONFIG_FEATURE_HTTPD_SETUID is not set
CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
@@ -866,6 +893,10 @@ CONFIG_FEATURE_HTTPD_CGI=y
# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
# CONFIG_FEATURE_HTTPD_PROXY is not set
CONFIG_FEATURE_HTTPD_GZIP=y
+CONFIG_FEATURE_HTTPD_ETAG=y
+CONFIG_FEATURE_HTTPD_LAST_MODIFIED=y
+CONFIG_FEATURE_HTTPD_DATE=y
+CONFIG_FEATURE_HTTPD_ACL_IP=y
CONFIG_IFCONFIG=y
CONFIG_FEATURE_IFCONFIG_STATUS=y
CONFIG_FEATURE_IFCONFIG_SLIP=y
@@ -943,6 +974,7 @@ CONFIG_TCPSVD=y
# CONFIG_FEATURE_TELNET_WIDTH is not set
CONFIG_TELNETD=y
CONFIG_FEATURE_TELNETD_STANDALONE=y
+CONFIG_FEATURE_TELNETD_PORT_DEFAULT=23
CONFIG_FEATURE_TELNETD_INETD_WAIT=y
# CONFIG_TFTP is not set
# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
@@ -963,6 +995,7 @@ CONFIG_TLS=y
CONFIG_WGET=y
CONFIG_FEATURE_WGET_LONG_OPTIONS=y
CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_FTP=y
CONFIG_FEATURE_WGET_AUTHENTICATION=y
CONFIG_FEATURE_WGET_TIMEOUT=y
CONFIG_FEATURE_WGET_HTTPS=y
@@ -979,6 +1012,7 @@ CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
+CONFIG_UDHCPC6_DEFAULT_SCRIPT=""
# CONFIG_UDHCPC6 is not set
# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set
# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set
@@ -988,6 +1022,7 @@ CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
#
# Common options for DHCP applets
#
+CONFIG_UDHCPC_DEFAULT_INTERFACE="eth0"
# CONFIG_FEATURE_UDHCP_PORT is not set
CONFIG_UDHCP_DEBUG=9
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
@@ -1005,17 +1040,19 @@ CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
#
# Mail Utilities
#
+CONFIG_FEATURE_MIME_CHARSET="us-ascii"
# CONFIG_MAKEMIME is not set
# CONFIG_POPMAILDIR is not set
# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
# CONFIG_REFORMIME is not set
# CONFIG_FEATURE_REFORMIME_COMPAT is not set
CONFIG_SENDMAIL=y
-CONFIG_FEATURE_MIME_CHARSET="us-ascii"
#
# Process Utilities
#
+CONFIG_FEATURE_FAST_TOP=y
+CONFIG_FEATURE_SHOW_THREADS=y
CONFIG_FREE=y
# CONFIG_FUSER is not set
CONFIG_IOSTAT=y
@@ -1054,7 +1091,6 @@ CONFIG_FEATURE_TOPMEM=y
CONFIG_UPTIME=y
# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
# CONFIG_WATCH is not set
-CONFIG_FEATURE_SHOW_THREADS=y
#
# Runit Utilities
@@ -1095,6 +1131,7 @@ CONFIG_SH_IS_ASH=y
# CONFIG_BASH_IS_ASH is not set
# CONFIG_BASH_IS_HUSH is not set
CONFIG_BASH_IS_NONE=y
+CONFIG_SHELL_ASH=y
CONFIG_ASH=y
CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
CONFIG_ASH_INTERNAL_GLOB=y
@@ -1110,15 +1147,17 @@ CONFIG_ASH_EXPAND_PRMT=y
CONFIG_ASH_ECHO=y
CONFIG_ASH_PRINTF=y
CONFIG_ASH_TEST=y
+CONFIG_ASH_SLEEP=y
CONFIG_ASH_HELP=y
CONFIG_ASH_GETOPTS=y
CONFIG_ASH_CMDCMD=y
CONFIG_CTTYHACK=y
# CONFIG_HUSH is not set
+# CONFIG_SHELL_HUSH is not set
# CONFIG_HUSH_BASH_COMPAT is not set
# CONFIG_HUSH_BRACE_EXPANSION is not set
-# CONFIG_HUSH_LINENO_VAR is not set
# CONFIG_HUSH_BASH_SOURCE_CURDIR is not set
+# CONFIG_HUSH_LINENO_VAR is not set
# CONFIG_HUSH_INTERACTIVE is not set
# CONFIG_HUSH_SAVEHISTORY is not set
# CONFIG_HUSH_JOB is not set
@@ -1177,6 +1216,7 @@ CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS=y
# CONFIG_FEATURE_REMOTE_LOG is not set
# CONFIG_FEATURE_SYSLOGD_DUP is not set
# CONFIG_FEATURE_SYSLOGD_CFG is not set
+# CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS is not set
CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0
# CONFIG_FEATURE_IPC_SYSLOG is not set
CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
diff --git a/src/busybox/auth.patch b/src/busybox/auth.patch
new file mode 100644
index 0000000..b30dc3d
--- /dev/null
+++ b/src/busybox/auth.patch
@@ -0,0 +1,18 @@
+diff -Naur busybox-1.36.1.ori/networking/httpd.c busybox-1.36.1/networking/httpd.c
+--- busybox-1.36.1.ori/networking/httpd.c 2024-01-08 16:52:14.701167800 +0100
++++ busybox-1.36.1/networking/httpd.c 2024-01-08 16:53:21.413344344 +0100
+@@ -2136,8 +2136,12 @@
+ goto end_check_passwd;
+ }
+ bad_input:
+- /* Comparing plaintext "user:pass" in one go */
+- r = strcmp(cur->after_colon, user_and_passwd);
++ /* Check if auth is disabled for this path */
++ r = strcmp(cur->after_colon, ":");
++ if (r != 0) {
++ /* Comparing plaintext "user:pass" in one go */
++ r = strcmp(cur->after_colon, user_and_passwd);
++ }
+ end_check_passwd:
+ if (r == 0) {
+ remoteuser = xstrndup(user_and_passwd,
diff --git a/src/busybox/busybox b/src/busybox/busybox
deleted file mode 160000
index bd75474..0000000
--- a/src/busybox/busybox
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit bd754746394a382e04d116df02547f61b2026da9
diff --git a/src/wsdd/cleanup.wsdd b/src/busybox/cleanup.busybox
similarity index 61%
rename from src/wsdd/cleanup.wsdd
rename to src/busybox/cleanup.busybox
index 216b675..9301cbb 100755
--- a/src/wsdd/cleanup.wsdd
+++ b/src/busybox/cleanup.busybox
@@ -3,8 +3,8 @@
SCRIPT_DIR=$(cd `dirname $0` && pwd)
cd $SCRIPT_DIR
-cd wsdd
+source config.busybox
+
+rm -rf "${BUILD_FOLDER}"
make clean
-rm -rf SDK
-rm -rf gsoap-2.8
diff --git a/src/busybox/compile.busybox b/src/busybox/compile.busybox
index 6cd2340..807beaa 100755
--- a/src/busybox/compile.busybox
+++ b/src/busybox/compile.busybox
@@ -3,8 +3,9 @@
SCRIPT_DIR=$(cd `dirname $0` && pwd)
cd $SCRIPT_DIR
-cd busybox
+source config.busybox
+
+cd "${BUILD_FOLDER}"
make -j$(nproc) ARCH=arm || exit 1
make install || exit 1
-
diff --git a/src/busybox/config.busybox b/src/busybox/config.busybox
new file mode 100755
index 0000000..d7d3d88
--- /dev/null
+++ b/src/busybox/config.busybox
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+VERSION="1.36.1"
+MAIN_URL=https://busybox.net/downloads/busybox-${VERSION}.tar.bz2
+PACKAGE="busybox-${VERSION}"
+ARCHIVE="${PACKAGE}.tar.bz2"
+BUILD_FOLDER="busybox-${VERSION}"
diff --git a/src/busybox/gzdef.patch b/src/busybox/gzdef.patch
new file mode 100644
index 0000000..b3a083f
--- /dev/null
+++ b/src/busybox/gzdef.patch
@@ -0,0 +1,53 @@
+diff -Naur busybox-1.36.1.ori/networking/httpd.c busybox-1.36.1/networking/httpd.c
+--- busybox-1.36.1.ori/networking/httpd.c 2023-01-03 15:14:43.000000000 +0100
++++ busybox-1.36.1/networking/httpd.c 2024-01-08 16:45:49.504118695 +0100
+@@ -2182,7 +2182,7 @@
+ struct stat sb;
+ char *urlcopy;
+ char *urlp;
+- char *tptr;
++ char *tptr, *gztptr;
+ #if ENABLE_FEATURE_HTTPD_ACL_IP
+ unsigned remote_ip;
+ #endif
+@@ -2418,7 +2418,32 @@
+ g_query = xstrdup(g_query); /* ok for NULL too */
+ strcpy(urlp, index_page);
+ }
++ gztptr = xasprintf("%s.gz", tptr);
+ if (stat(tptr, &sb) == 0) {
++ free(gztptr);
++ /* If URL is a directory with no slash, set up
++ * "HTTP/1.1 302 Found" "Location: /dir/" reply */
++ if (urlp[-1] != '/' && S_ISDIR(sb.st_mode)) {
++ found_moved_temporarily = urlcopy;
++ } else {
++#if ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
++ char *suffix = strrchr(tptr, '.');
++ if (suffix) {
++ Htaccess *cur;
++ for (cur = script_i; cur; cur = cur->next) {
++ if (strcmp(cur->before_colon + 1, suffix) == 0) {
++ cgi_type = CGI_INTERPRETER;
++ break;
++ }
++ }
++ }
++#endif
++ file_size = sb.st_size;
++ last_mod = sb.st_mtime;
++ }
++ }
++ else if (stat(gztptr, &sb) == 0) {
++ free(gztptr);
+ /* If URL is a directory with no slash, set up
+ * "HTTP/1.1 302 Found" "Location: /dir/" reply */
+ if (urlp[-1] != '/' && S_ISDIR(sb.st_mode)) {
+@@ -2442,6 +2467,7 @@
+ }
+ #if ENABLE_FEATURE_HTTPD_CGI
+ else if (urlp[-1] == '/') {
++ free(gztptr);
+ /* It's a dir URL and there is no index.html */
+ /* Is there cgi-bin/index.cgi? */
+ if (access("/cgi-bin/index.cgi"+1, X_OK) != 0)
diff --git a/src/busybox/init.busybox b/src/busybox/init.busybox
index 5d8fe89..5f1a810 100755
--- a/src/busybox/init.busybox
+++ b/src/busybox/init.busybox
@@ -3,10 +3,20 @@
SCRIPT_DIR=$(cd `dirname $0` && pwd)
cd $SCRIPT_DIR
+source config.busybox
+
rm -rf ./_install
-cd busybox
-git reset --hard || exit 1
+if [ ! -f "${ARCHIVE}" ]; then
+ wget "${MAIN_URL}"
+fi
-cp ../.config ./ || exit 1
+tar xvf "${ARCHIVE}"
+
+cd "${BUILD_FOLDER}"
+patch -p1 < ../gzdef.patch
+patch -p1 < ../onvif.patch
+patch -p1 < ../auth.patch
+
+cp ../.config ./ || exit 1
diff --git a/src/busybox/onvif.patch b/src/busybox/onvif.patch
new file mode 100644
index 0000000..6507ba2
--- /dev/null
+++ b/src/busybox/onvif.patch
@@ -0,0 +1,17 @@
+diff -Naur busybox-1.36.1.ori/networking/httpd.c busybox-1.36.1/networking/httpd.c
+--- busybox-1.36.1.ori/networking/httpd.c 2024-01-08 16:45:49.504118695 +0100
++++ busybox-1.36.1/networking/httpd.c 2024-01-08 16:52:14.701167800 +0100
+@@ -2406,6 +2406,13 @@
+ }
+ cgi_type = CGI_NORMAL;
+ }
++ else if (is_prefixed_with(tptr, "onvif/")) {
++ if (tptr[6] == '\0') {
++ /* protect listing "cgi-bin/" */
++ send_headers_and_exit(HTTP_FORBIDDEN);
++ }
++ cgi_type = CGI_NORMAL;
++ }
+ #endif
+
+ if (urlp[-1] == '/') {
diff --git a/src/curl/.gitignore b/src/curl/.gitignore
index e014e8e..cc1f9db 100755
--- a/src/curl/.gitignore
+++ b/src/curl/.gitignore
@@ -1,3 +1,3 @@
# Ignore the install dir
_install/
-
+openssl*
diff --git a/src/curl/compile.curl b/src/curl/compile.curl
index d82dab8..4fd3103 100755
--- a/src/curl/compile.curl
+++ b/src/curl/compile.curl
@@ -1,16 +1,19 @@
#!/bin/bash
SCRIPT_DIR=$(cd `dirname $0` && pwd)
+PREFIX=$(pwd)/sysroot
cd $SCRIPT_DIR
cd curl || exit 1
./buildconf || exit 1
-./configure --host=arm-hisiv300-linux --without-ssl --disable-shared --disable-libcurl-option \
- --prefix=$SCRIPT_DIR/_install \
- DESTDIR="$SCRIPT_DIR/_install/" && make install-strip \
- install \
- || exit 1
+./configure --with-openssl=${PREFIX} --host=arm-hisiv300-linux-uclibcgnueabi --prefix=$SCRIPT_DIR/_install --disable-shared DESTDIR="$SCRIPT_DIR/_install/" && make install-strip install || exit 1
+
+#./configure --host=arm-hisiv300-linux --with-openssl --disable-shared --disable-libcurl-option \
+# --prefix=$SCRIPT_DIR/_install \
+# DESTDIR="$SCRIPT_DIR/_install/" && make install-strip \
+# install \
+# || exit 1
diff --git a/src/curl/init.curl b/src/curl/init.curl
index ec0c524..3360284 100755
--- a/src/curl/init.curl
+++ b/src/curl/init.curl
@@ -10,10 +10,11 @@ rm -rf ./openssl*
#git reset --hard || exit 1
-wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
-tar zxf openssl-1.1.1q.tar.gz
-pushd openssl-1.1.1q
-./Configure linux-generic32 shared -DL_ENDIAN --prefix=${PREFIX} --openssldir=${PREFIX} shared
+wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
+tar zxf openssl-1.1.1w.tar.gz
+pushd openssl-1.1.1w
+./Configure linux-generic32 no-async -DL_ENDIAN --prefix=${PREFIX} --openssldir=${PREFIX} shared
make CROSS_COMPILE=arm-hisiv300-linux- LD=arm-hisiv300-linux-ld AR=arm-hisiv300-linux-ar NM=arm-hisiv300-linux-nm AS=arm-hisiv300-linux-as install
-
popd
+
+
diff --git a/src/h264grabber/h264grabber/h264grabber.c b/src/h264grabber/h264grabber/h264grabber.c
index c8815bc..57c4443 100644
--- a/src/h264grabber/h264grabber/h264grabber.c
+++ b/src/h264grabber/h264grabber/h264grabber.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022 roleo.
+ * Copyright (c) 2023 roleo.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -140,6 +140,10 @@
#define FIFO_NAME_HIGH "/tmp/h264_high_fifo"
#define FIFO_NAME_AAC "/tmp/aac_audio_fifo"
+#define F_LINUX_SPECIFIC_BASE 1024
+#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
+#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
+
// Unused vars
unsigned char IDR[] = {0x65, 0xB8};
unsigned char NAL_START[] = {0x00, 0x00, 0x00, 0x01};
@@ -214,7 +218,7 @@ int main(int argc, char **argv) {
FILE *fFid = NULL;
FILE *fOut = NULL;
- int current_frame, frame_counter, frame_counter_tmp, next_frame_counter;
+ int current_frame, frame_counter, frame_counter_tmp, next_frame_counter, frame_start, next_frame_start;
int table_offset, stream_offset;
unsigned int frame_ts = 0;
unsigned int frame_ts_tmp, next_frame_ts, frame_ts_diff;
@@ -530,6 +534,10 @@ int main(int argc, char **argv) {
fprintf(stderr, "Error opening fifo %s\n", FIFO_NAME_LOW);
return -1;
}
+ if (fcntl(fileno(fOut), F_SETPIPE_SZ, 65536) != 65536) {
+ fprintf(stderr, "Cannot set size of fifo\n");
+ return -1;
+ };
} else if (resolution == RESOLUTION_HIGH) {
unlink(FIFO_NAME_HIGH);
if (mkfifo(FIFO_NAME_HIGH, mode) < 0) {
@@ -546,6 +554,10 @@ int main(int argc, char **argv) {
fprintf(stderr, "Error opening fifo %s\n", FIFO_NAME_HIGH);
return -1;
}
+ if (fcntl(fileno(fOut), F_SETPIPE_SZ, 262144) != 262144) {
+ fprintf(stderr, "Cannot set size of fifo\n");
+ return -1;
+ };
} else if (resolution == RESOLUTION_AUDIO) {
unlink(FIFO_NAME_AAC);
if (mkfifo(FIFO_NAME_AAC, mode) < 0) {
@@ -562,6 +574,10 @@ int main(int argc, char **argv) {
fprintf(stderr, "Error opening fifo %s\n", FIFO_NAME_AAC);
return -1;
}
+ if (fcntl(fileno(fOut), F_SETPIPE_SZ, 8192) != 8192) {
+ fprintf(stderr, "Cannot set size of fifo\n");
+ return -1;
+ };
}
}
@@ -573,17 +589,24 @@ int main(int argc, char **argv) {
for (i = 0; i < table_record_num; i++) {
// Get pointer to the record
record_ptr = addr + table_offset + (i * table_record_size);
+ // Get the frame start and check if '01'
+ frame_start = (int) *(record_ptr);
+ if (frame_start != 1) continue;
// Get the frame counter
frame_counter_tmp = (((int) *(record_ptr + frame_counter_offset + 1)) << 8) +
((int) *(record_ptr + frame_counter_offset));
// Check if it is the largest frame_counter
if (frame_counter_tmp > frame_counter) {
frame_counter = frame_counter_tmp;
- } else {
current_frame = i;
+ } else {
break;
}
}
+ if (current_frame == -1) {
+ usleep(MILLIS_10);
+ continue;
+ }
if (debug) fprintf(stderr, "%lld - found latest frame: id %d, frame_counter %d\n", current_timestamp(), current_frame, frame_counter);
// Wait 10 milliseconds
@@ -601,6 +624,12 @@ int main(int argc, char **argv) {
} else {
next_record_ptr = record_ptr + table_record_size;
}
+ // Get the frame start and check if '01'
+ next_frame_start = (int) *(next_record_ptr);
+ if (next_frame_start != 1) {
+ usleep(MILLIS_10);
+ continue;
+ }
// Get the frame counter of the next record
next_frame_counter = ((int) *(next_record_ptr + frame_counter_offset + 1)) * 256 + ((int) *(next_record_ptr + frame_counter_offset));
if (debug) fprintf(stderr, "%lld - current frame counter is %d, next frame counter is %d\n", current_timestamp(), frame_counter, next_frame_counter);
@@ -635,7 +664,7 @@ int main(int argc, char **argv) {
} else {
frame_counter_invalid++;
if (frame_counter_invalid < 10) {
- if (debug) fprintf(stderr, "%lld - frame counter invalid %d\n", current_timestamp(), frame_counter_invalid);
+ if (debug) fprintf(stderr, "%lld - frame counter invalid %d, wait for the next frame\n", current_timestamp(), frame_counter_invalid);
} else {
if (debug) fprintf(stderr, "%lld - frame counter invalid %d, sync lost\n", current_timestamp(), frame_counter_invalid);
break;
@@ -650,10 +679,13 @@ int main(int argc, char **argv) {
for(;;) {
// Find the record with the largest timestamp
current_frame = -1;
- frame_counter = -1;
+ frame_ts = 0;
for (i = 0; i < table_record_num; i++) {
// Get pointer to the record
record_ptr = addr + table_offset + (i * table_record_size);
+ // Get the frame start and check if '01'
+ frame_start = (int) *(record_ptr);
+ if (frame_start != 1) continue;
// Get the frame timestamp
frame_ts_tmp = (((int) *(record_ptr + frame_ts_offset + 3)) << 24) +
(((int) *(record_ptr + frame_ts_offset + 2)) << 16) +
@@ -662,11 +694,15 @@ int main(int argc, char **argv) {
// Check if it is the largest timestamp
if (frame_ts_tmp > frame_ts) {
frame_ts = frame_ts_tmp;
- } else {
current_frame = i;
+ } else {
break;
}
}
+ if (current_frame == -1) {
+ usleep(MILLIS_10);
+ continue;
+ }
if (debug) fprintf(stderr, "%lld - found latest frame: id %d, frame_ts %u\n", current_timestamp(), current_frame, frame_ts);
// Wait 10 milliseconds
@@ -684,18 +720,24 @@ int main(int argc, char **argv) {
} else {
next_record_ptr = record_ptr + table_record_size;
}
+ // Get the frame start and check if '01'
+ next_frame_start = (int) *(next_record_ptr);
+ if (next_frame_start != 1) {
+ usleep(MILLIS_10);
+ continue;
+ }
// Get the frame timestamp of the next record
next_frame_ts = (((int) *(next_record_ptr + frame_ts_offset + 3)) << 24) +
(((int) *(next_record_ptr + frame_ts_offset + 2)) << 16) +
(((int) *(next_record_ptr + frame_ts_offset + 1)) << 8) +
((int) *(next_record_ptr + frame_ts_offset));
- if (debug) fprintf(stderr, "%lld - current frame timestamp is %u, next frame timestamp is %u\n", current_timestamp(), frame_ts, next_frame_ts);
+ if (debug) fprintf(stderr, "%lld - current frame timestamp is %u, next frame timestamp is %u, duration is %u\n", current_timestamp(), frame_ts, next_frame_ts, next_frame_ts - frame_ts);
// Check if the frame timestamp is valid
if (next_frame_ts >= frame_ts)
frame_ts_diff = next_frame_ts - frame_ts;
else
frame_ts_diff = next_frame_ts + (0xffffffff - frame_ts + 1);
- if ((frame_ts_diff >= 0) && (frame_ts_diff <= 10 * 64)) { // 1 packet with 1024 samples every 64 ms
+ if ((frame_ts_diff >= 0) && (frame_ts_diff <= 2 * 128)) { // 1 packet with 1024 samples every 128 ms
// Get the offset of the stream
frame_offset = (((int) *(record_ptr + frame_offset_offset + 3)) << 24) +
(((int) *(record_ptr + frame_offset_offset + 2)) << 16) +
@@ -724,9 +766,9 @@ int main(int argc, char **argv) {
} else {
frame_counter_invalid++;
if (frame_counter_invalid < 10) {
- if (debug) fprintf(stderr, "%lld - frame counter invalid %d\n", current_timestamp(), frame_counter_invalid);
+ if (debug) fprintf(stderr, "%lld - frame timestamp invalid %d, wait for the next frame\n", current_timestamp(), frame_counter_invalid);
} else {
- if (debug) fprintf(stderr, "%lld - frame counter invalid %d, sync lost\n", current_timestamp(), frame_counter_invalid);
+ if (debug) fprintf(stderr, "%lld - frame timestamp invalid %d, sync lost\n", current_timestamp(), frame_counter_invalid);
break;
}
}
diff --git a/src/ipc_cmd/compile.ipc_cmd b/src/ipc_cmd/compile.ipc_cmd
index 4bfcfe2..d65801e 100755
--- a/src/ipc_cmd/compile.ipc_cmd
+++ b/src/ipc_cmd/compile.ipc_cmd
@@ -30,6 +30,7 @@ mkdir -p ../_install/lib || exit 1
cp ./ipc_cmd ../_install/bin || exit 1
cp ./ipc_read ../_install/bin || exit 1
cp ./ipc_notify ../_install/bin || exit 1
+cp ./ipc2file ../_install/bin || exit 1
cp ./ipc_multiplex.so ../_install/lib || exit 1
${STRIP} ../_install/bin/* || exit 1
diff --git a/src/ipc_cmd/ipc_cmd/Makefile b/src/ipc_cmd/ipc_cmd/Makefile
index 7740402..fa53782 100644
--- a/src/ipc_cmd/ipc_cmd/Makefile
+++ b/src/ipc_cmd/ipc_cmd/Makefile
@@ -1,17 +1,13 @@
-OBJECTS_C = ipc_cmd.o
+OBJECTS_C = ipc_cmd.o ptz.o
OBJECTS_R = ipc_read.o
OBJECTS_N = ipc_notify.o
-LIBS = -lpthread -lrt
+OBJECTS_2 = ipc2file.o
+LIBS = -lpthread -lrt -lm
+LIBS_2 = -lrt -lpthread
-all: ipc_cmd ipc_read ipc_notify ipc_multiplex.so
+all: ipc_cmd ipc_read ipc_notify ipc2file ipc_multiplex.so
-ipc_cmd.o: ipc_cmd.c $(HEADERS)
- $(CC) -c $< -D_GNU_SOURCE -std=c99 -fPIC -O2 -o $@
-
-ipc_read.o: ipc_read.c $(HEADERS)
- $(CC) -c $< -D_GNU_SOURCE -std=c99 -fPIC -O2 -o $@
-
-ipc_notify.o: ipc_notify.c $(HEADERS)
+%.o: %.c $(HEADERS)
$(CC) -c $< -D_GNU_SOURCE -std=c99 -fPIC -O2 -o $@
ipc_multiplex.so: ipc_multiplex.c $(HEADERS)
@@ -29,13 +25,19 @@ ipc_notify: $(OBJECTS_N)
$(CC) $(OBJECTS_N) $(LIBS) -fPIC -O2 -o $@
$(STRIP) $@
+ipc2file: $(OBJECTS_2)
+ $(CC) $(OBJECTS_2) $(LIBS_2) -fPIC -Os -o $@
+ $(STRIP) $@
+
.PHONY: clean
clean:
rm -f ipc_cmd
rm -f ipc_read
rm -f ipc_notify
+ rm -f ipc2file
rm -f ipc_multiplex.so
rm -f $(OBJECTS_C)
rm -f $(OBJECTS_R)
rm -f $(OBJECTS_N)
+ rm -f $(OBJECTS_2)
diff --git a/src/ipc_cmd/ipc_cmd/ipc2file.c b/src/ipc_cmd/ipc_cmd/ipc2file.c
new file mode 100644
index 0000000..de28148
--- /dev/null
+++ b/src/ipc_cmd/ipc_cmd/ipc2file.c
@@ -0,0 +1,589 @@
+/*
+ * Copyright (c) 2023 roleo.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/*
+ * Convert events received via IPC queue to tmp files.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "ipc2file.h"
+
+#define DEFAULT_PID_FILE "/var/run/ipc2file.pid"
+
+#define DEFAULT_QUEUE_NUMBER 2
+
+#define BD_NO_CHDIR 01
+#define BD_NO_CLOSE_FILES 02
+#define BD_NO_REOPEN_STD_FDS 04
+
+#define BD_NO_UMASK0 010
+#define BD_MAX_CLOSE 8192
+
+#define PID_SIZE 32
+
+mqd_t ipc_mq;
+int queue_number;
+int debug;
+
+static int open_queue();
+static int clear_queue();
+static void call_callback(IPC_MESSAGE_TYPE type);
+
+typedef void(*func_ptr_t)(void* arg);
+func_ptr_t *ipc_callbacks;
+
+int exit_main = 0;
+int last_alarm = -1;
+
+int ipc_init()
+{
+ int ret;
+
+ ret = open_queue();
+ if(ret != 0)
+ return -1;
+
+ ret = clear_queue();
+ if(ret != 0)
+ return -2;
+
+ ipc_callbacks = malloc((sizeof(func_ptr_t)) * IPC_MSG_LAST);
+
+ return 0;
+}
+
+void ipc_stop()
+{
+ free(ipc_callbacks);
+
+ if(ipc_mq > 0)
+ mq_close(ipc_mq);
+}
+
+static int open_queue()
+{
+ char queue_name[256];
+
+ sprintf(queue_name, "%s_%d", IPC_QUEUE_NAME, queue_number);
+ ipc_mq = mq_open(queue_name, O_RDONLY);
+ if(ipc_mq == -1) {
+ fprintf(stderr, "Can't open mqueue %s. Error: %s\n", queue_name, strerror(errno));
+ return -1;
+ }
+ return 0;
+}
+
+static int clear_queue()
+{
+ struct mq_attr attr;
+ char buffer[IPC_MESSAGE_MAX_SIZE + 1];
+
+ if (mq_getattr(ipc_mq, &attr) == -1) {
+ fprintf(stderr, "Can't get queue attributes\n");
+ return -1;
+ }
+
+ while (attr.mq_curmsgs > 0) {
+ if (debug) fprintf(stderr, "Clear message in queue...\n");
+ mq_receive(ipc_mq, buffer, IPC_MESSAGE_MAX_SIZE, NULL);
+ if (debug) fprintf(stderr, "...done.\n");
+ if (mq_getattr(ipc_mq, &attr) == -1) {
+ fprintf(stderr, "Can't get queue attributes\n");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static void handle_ipc_unrecognized()
+{
+ if (debug) fprintf(stderr, "GOT UNRECOGNIZED MESSAGE\n");
+// call_callback(IPC_MSG_UNRECOGNIZED);
+}
+
+static void handle_ipc_motion_generic(int detect)
+{
+ fprintf(stderr, "GOT GENERIC MOTION\n");
+ call_callback(detect);
+}
+
+int ipc_set_callback(IPC_MESSAGE_TYPE type, void (*f)())
+{
+ if(type>=IPC_MSG_LAST)
+ return -1;
+
+ ipc_callbacks[(int)type]=f;
+
+ return 0;
+}
+
+static void call_callback(IPC_MESSAGE_TYPE type)
+{
+ func_ptr_t f;
+ f=ipc_callbacks[(int)type];
+ if(f!=NULL)
+ (*f)(&type);
+}
+
+int parse_message(char *msg, ssize_t len)
+{
+ int i;
+
+ if (debug) fprintf(stderr, "Parsing message\n");
+
+ for (i = 0; i < len; i++)
+ if (debug) fprintf(stderr, "%02x ", msg[i]);
+ if (debug) fprintf(stderr, "Parsing message completed\n");
+
+ if((len >= sizeof(IPC_MOTION_START) - 1) && (memcmp(msg, IPC_MOTION_START, sizeof(IPC_MOTION_START) - 1)==0))
+ {
+ handle_ipc_motion_generic(IPC_MSG_MOTION_START);
+ return 0;
+ }
+ if((len >= sizeof(IPC_MOTION_START_C) - 1) && (memcmp(msg, IPC_MOTION_START_C, sizeof(IPC_MOTION_START_C) - 1)==0))
+ {
+ handle_ipc_motion_generic(IPC_MSG_MOTION_START);
+ return 0;
+ }
+ else if((len >= sizeof(IPC_MOTION_STOP) - 1) && (memcmp(msg, IPC_MOTION_STOP, sizeof(IPC_MOTION_STOP) - 1)==0))
+ {
+ handle_ipc_motion_generic(IPC_MSG_MOTION_STOP);
+ return 0;
+ }
+ else if((len >= sizeof(IPC_AI_HUMAN_DETECTION) - 1) && (memcmp(msg, IPC_AI_HUMAN_DETECTION, sizeof(IPC_AI_HUMAN_DETECTION) - 1)==0))
+ {
+ handle_ipc_motion_generic(IPC_MSG_AI_HUMAN_DETECTION);
+ return 0;
+ }
+ else if((len >= sizeof(IPC_AI_BODY_DETECTION_C) - 1) && (memcmp(msg, IPC_AI_BODY_DETECTION_C, sizeof(IPC_AI_BODY_DETECTION_C) - 1)==0))
+ {
+ handle_ipc_motion_generic(IPC_MSG_AI_HUMAN_DETECTION);
+ return 0;
+ }
+ else if((len >= sizeof(IPC_AI_VEHICLE_DETECTION_C) - 1) && (memcmp(msg, IPC_AI_VEHICLE_DETECTION_C, sizeof(IPC_AI_VEHICLE_DETECTION_C) - 1)==0))
+ {
+ handle_ipc_motion_generic(IPC_MSG_AI_VEHICLE_DETECTION);
+ return 0;
+ }
+ else if((len >= sizeof(IPC_AI_ANIMAL_DETECTION_C) - 1) && (memcmp(msg, IPC_AI_ANIMAL_DETECTION_C, sizeof(IPC_AI_ANIMAL_DETECTION_C) - 1)==0))
+ {
+ handle_ipc_motion_generic(IPC_MSG_AI_ANIMAL_DETECTION);
+ return 0;
+ }
+ else if((len >= sizeof(IPC_BABY_CRYING) - 1) && (memcmp(msg, IPC_BABY_CRYING, sizeof(IPC_BABY_CRYING) - 1)==0))
+ {
+ handle_ipc_motion_generic(IPC_MSG_BABY_CRYING);
+ return 0;
+ }
+ else if((len >= sizeof(IPC_SOUND_DETECTION) - 1) && (memcmp(msg, IPC_SOUND_DETECTION, sizeof(IPC_SOUND_DETECTION) - 1)==0))
+ {
+ handle_ipc_motion_generic(IPC_MSG_SOUND_DETECTION);
+ return 0;
+ }
+ handle_ipc_unrecognized();
+
+ return 0;
+}
+
+int daemonize(int flags)
+{
+ int maxfd, fd;
+
+ switch(fork()) {
+ case -1: return -1;
+ case 0: break;
+ default: _exit(EXIT_SUCCESS);
+ }
+
+ if(setsid() == -1)
+ return -1;
+
+ switch(fork()) {
+ case -1: return -1;
+ case 0: break;
+ default: _exit(EXIT_SUCCESS);
+ }
+
+ if(!(flags & BD_NO_UMASK0))
+ umask(0);
+
+ if(!(flags & BD_NO_CHDIR))
+ chdir("/");
+
+ if(!(flags & BD_NO_CLOSE_FILES)) {
+ maxfd = sysconf(_SC_OPEN_MAX);
+ if(maxfd == -1)
+ maxfd = BD_MAX_CLOSE;
+ for(fd = 0; fd < maxfd; fd++)
+ close(fd);
+ }
+
+ if(!(flags & BD_NO_REOPEN_STD_FDS)) {
+ close(STDIN_FILENO);
+
+ fd = open("/dev/null", O_RDWR);
+ if(fd != STDIN_FILENO)
+ return -1;
+ if(dup2(STDIN_FILENO, STDOUT_FILENO) != STDOUT_FILENO)
+ return -2;
+ if(dup2(STDIN_FILENO, STDERR_FILENO) != STDERR_FILENO)
+ return -3;
+ }
+
+ return 0;
+}
+
+int check_pid(char *file_name)
+{
+ FILE *f;
+ long pid;
+ char pid_buffer[PID_SIZE];
+
+ f = fopen(file_name, "r");
+ if(f == NULL)
+ return 0;
+
+ if (fgets(pid_buffer, PID_SIZE, f) == NULL) {
+ fclose(f);
+ return 0;
+ }
+ fclose(f);
+
+ if (sscanf(pid_buffer, "%ld", &pid) != 1) {
+ return 0;
+ }
+
+ if (kill(pid, 0) == 0) {
+ return 1;
+ }
+
+ return 0;
+}
+
+int create_pid(char *file_name)
+{
+ FILE *f;
+ char pid_buffer[PID_SIZE];
+
+ f = fopen(file_name, "w");
+ if (f == NULL)
+ return -1;
+
+ memset(pid_buffer, '\0', PID_SIZE);
+ sprintf(pid_buffer, "%ld\n", (long) getpid());
+ if (fwrite(pid_buffer, strlen(pid_buffer), 1, f) != 1) {
+ fclose(f);
+ return -2;
+ }
+ fclose(f);
+
+ return 0;
+}
+
+void signal_handler(int signal)
+{
+ // Exit from main loop
+ exit_main = 1;
+}
+
+void *sound_stop_thread(void *arg)
+{
+ int i;
+
+ sleep(60);
+ remove(FILE_SOUND_DETECTION);
+
+ return NULL;
+}
+
+void process_event(int *alarm)
+{
+ FILE *fp;
+ int i;
+ int alarm_index = -1;
+ char value[8];
+
+ time_t now;
+
+ switch (*alarm) {
+ case IPC_MSG_MOTION_START:
+ fp = fopen(FILE_MOTION_START, "w");
+ if (fp == NULL) {
+ fprintf(stderr, "Couldn't open file\n");
+ return;
+ }
+ fclose(fp);
+ break;
+ case IPC_MSG_AI_HUMAN_DETECTION:
+ fp = fopen(FILE_AI_HUMAN_DETECTION, "w");
+ if (fp == NULL) {
+ fprintf(stderr, "Couldn't open file\n");
+ return;
+ }
+ fclose(fp);
+ break;
+ case IPC_MSG_AI_VEHICLE_DETECTION:
+ fp = fopen(FILE_AI_VEHICLE_DETECTION, "w");
+ if (fp == NULL) {
+ fprintf(stderr, "Couldn't open file\n");
+ return;
+ }
+ fclose(fp);
+ break;
+ case IPC_MSG_AI_ANIMAL_DETECTION:
+ fp = fopen(FILE_AI_ANIMAL_DETECTION, "w");
+ if (fp == NULL) {
+ fprintf(stderr, "Couldn't open file\n");
+ return;
+ }
+ fclose(fp);
+ break;
+ case IPC_MSG_BABY_CRYING:
+ fp = fopen(FILE_BABY_CRYING, "w");
+ if (fp == NULL) {
+ fprintf(stderr, "Couldn't open file\n");
+ return;
+ }
+ fclose(fp);
+ break;
+ case IPC_MSG_SOUND_DETECTION:
+ fp = fopen(FILE_SOUND_DETECTION, "w");
+ if (fp == NULL) {
+ fprintf(stderr, "Couldn't open file\n");
+ return;
+ }
+ fclose(fp);
+
+ pthread_t sound_stop_pthread;
+ pthread_create(&sound_stop_pthread, NULL, sound_stop_thread, NULL);
+ pthread_detach(sound_stop_pthread);
+ break;
+ case IPC_MSG_MOTION_STOP:
+ switch (last_alarm) {
+ case IPC_MSG_MOTION_START:
+ remove(FILE_MOTION_START);
+ break;
+ case IPC_MSG_AI_HUMAN_DETECTION:
+ remove(FILE_AI_HUMAN_DETECTION);
+ break;
+ case IPC_MSG_AI_VEHICLE_DETECTION:
+ remove(FILE_AI_VEHICLE_DETECTION);
+ break;
+ case IPC_MSG_AI_ANIMAL_DETECTION:
+ remove(FILE_AI_ANIMAL_DETECTION);
+ break;
+ case IPC_MSG_BABY_CRYING:
+ remove(FILE_BABY_CRYING);
+ break;
+ }
+ break;
+ }
+
+ if (*alarm != IPC_MSG_SOUND_DETECTION)
+ last_alarm = *alarm;
+
+ if (*alarm == IPC_MSG_MOTION_STOP) {
+ fprintf(stderr, "CALLBACK MOTION %d STOP\n", *alarm);
+ } else {
+ fprintf(stderr, "CALLBACK MOTION %d\n", *alarm);
+ }
+}
+
+void callback_motion_generic(void *arg)
+{
+ process_event((int *) arg);
+}
+
+void print_usage(char *progname)
+{
+ fprintf(stderr, "\nUsage: %s [-p PID_FILE] [-q NUM] [-f] [-d LEVEL]\n\n", progname);
+ fprintf(stderr, "\t-p PID_FILE, --pid_file PID_FILE\n");
+ fprintf(stderr, "\t\tpid file\n");
+ fprintf(stderr, "\t-q NUM, --queue_number NUM\n");
+ fprintf(stderr, "\t\tid of the ipc queue\n");
+ fprintf(stderr, "\t-f, --foreground\n");
+ fprintf(stderr, "\t\tdon't daemonize\n");
+ fprintf(stderr, "\t-d, --debug\n");
+ fprintf(stderr, "\t\tenable debug\n");
+ fprintf(stderr, "\t-h, --help\n");
+ fprintf(stderr, "\t\tprint this help\n");
+}
+
+int main(int argc, char **argv)
+{
+ int errno;
+ char *endptr;
+ int c, ret;
+ char pid_file[1024];
+ int foreground;
+
+ ssize_t bytes_read;
+ char buffer[IPC_MESSAGE_MAX_SIZE + 1];
+ long size;
+
+ strcpy(pid_file, DEFAULT_PID_FILE);
+ queue_number = DEFAULT_QUEUE_NUMBER;
+ foreground = 0;
+ debug = 0;
+
+ while (1) {
+ static struct option long_options[] =
+ {
+ {"pid_file", required_argument, 0, 'p'},
+ {"queue_number", required_argument, 0, 'q'},
+ {"foreground", no_argument, 0, 'f'},
+ {"debug", no_argument, 0, 'd'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+ /* getopt_long stores the option index here. */
+ int option_index = 0;
+
+ c = getopt_long (argc, argv, "p:q:fdh",
+ long_options, &option_index);
+
+ /* Detect the end of the options. */
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'p':
+ if (strlen(optarg) < 1024)
+ strcpy(pid_file, optarg);
+ break;
+
+ case 'q':
+ errno = 0; /* To distinguish success/failure after call */
+ queue_number = strtol(optarg, &endptr, 10);
+
+ /* Check for various possible errors */
+ if ((errno == ERANGE && (queue_number == LONG_MAX || queue_number == LONG_MIN)) || (errno != 0 && queue_number == 0)) {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ if (queue_number <= 0 || queue_number >= 10) {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ if (endptr == optarg) {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 'f':
+ foreground = 1;
+ break;
+
+ case 'd':
+ debug = 1;
+ break;
+
+ case 'h':
+ print_usage(argv[0]);
+ exit(EXIT_SUCCESS);
+ break;
+
+ case '?':
+ /* getopt_long already printed an error message. */
+ break;
+
+ default:
+ print_usage(argv[0]);
+ exit(EXIT_SUCCESS);
+ }
+ }
+
+ // Set signal handler
+ signal(SIGTERM, signal_handler);
+ signal(SIGINT, signal_handler);
+
+ if (foreground == 0) {
+ ret = daemonize(0);
+ if (ret) {
+ fprintf(stderr, "Error starting daemon.\n");
+ exit(EXIT_FAILURE);
+ }
+ } else {
+ fprintf(stderr, "Don't daemonize\n");
+ }
+
+ fprintf(stderr, "Starting program.\n");
+
+ if (debug) fprintf(stderr, "pid_file = %s\n", pid_file);
+ if (debug) fprintf(stderr, "queue_number = %d\n", queue_number);
+
+ // Checking pid file
+ if (check_pid(pid_file) == 1) {
+ fprintf(stderr, "Program is already running.\n");
+ exit(EXIT_FAILURE);
+ }
+ if (create_pid(pid_file) < 0) {
+ fprintf(stderr, "Error creating pid file %s\n", pid_file);
+ exit(EXIT_FAILURE);
+ }
+
+ struct stat st = {0};
+ if (stat(PARENT_DIR, &st) == -1) {
+ mkdir(PARENT_DIR, 0755);
+ }
+
+ ret = ipc_init();
+ if(ret != 0) {
+ ipc_stop();
+ exit(EXIT_FAILURE);
+ }
+
+ ipc_set_callback(IPC_MSG_MOTION_START, &callback_motion_generic);
+ ipc_set_callback(IPC_MSG_MOTION_STOP, &callback_motion_generic);
+ ipc_set_callback(IPC_MSG_AI_HUMAN_DETECTION, &callback_motion_generic);
+ ipc_set_callback(IPC_MSG_AI_VEHICLE_DETECTION, &callback_motion_generic);
+ ipc_set_callback(IPC_MSG_AI_ANIMAL_DETECTION, &callback_motion_generic);
+ ipc_set_callback(IPC_MSG_BABY_CRYING, &callback_motion_generic);
+ ipc_set_callback(IPC_MSG_SOUND_DETECTION, &callback_motion_generic);
+
+ int i;
+ while(exit_main != 1) {
+ bytes_read = mq_receive(ipc_mq, buffer, IPC_MESSAGE_MAX_SIZE, NULL);
+
+ if (debug) fprintf(stderr, "IPC message. Len: %d. Status: %s!\n", bytes_read, strerror(errno));
+
+ if(bytes_read >= 0) {
+ parse_message(buffer, bytes_read);
+ }
+
+ usleep(500 * 1000);
+ }
+
+ ipc_stop();
+
+ unlink(pid_file);
+ fprintf(stderr, "Terminating program.\n");
+
+ return 0;
+}
diff --git a/src/ipc_cmd/ipc_cmd/ipc2file.h b/src/ipc_cmd/ipc_cmd/ipc2file.h
new file mode 100644
index 0000000..00e1951
--- /dev/null
+++ b/src/ipc_cmd/ipc_cmd/ipc2file.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2023 roleo.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#ifndef IPC2FILE_H
+#define IPC2FILE_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define IPC_QUEUE_NAME "/ipc_dispatch"
+#define IPC_MESSAGE_MAX_SIZE 512
+
+// IPC events
+#define IPC_MOTION_START "\x01\x00\x00\x00\x02\x00\x00\x00\x7c\x00\x7c\x00\x00\x00\x00\x00"
+#define IPC_MOTION_START_C "\x04\x00\x00\x00\x02\x00\x00\x00\x09\x70\x09\x70\x00\x00\x00\x00"
+#define IPC_MOTION_STOP "\x01\x00\x00\x00\x02\x00\x00\x00\x7d\x00\x7d\x00\x00\x00\x00\x00"
+#define IPC_AI_HUMAN_DETECTION "\x01\x00\x00\x00\x02\x00\x00\x00\xed\x00\xed\x00\x00\x00\x00\x00"
+#define IPC_AI_BODY_DETECTION_C "\x04\x00\x00\x00\x02\x00\x00\x00\x06\x70\x06\x70\x00\x00\x00\x00"
+#define IPC_AI_VEHICLE_DETECTION_C "\x04\x00\x00\x00\x02\x00\x00\x00\x07\x70\x07\x70\x00\x00\x00\x00"
+#define IPC_AI_ANIMAL_DETECTION_C "\x04\x00\x00\x00\x02\x00\x00\x00\x08\x70\x08\x70\x00\x00\x00\x00"
+#define IPC_BABY_CRYING "\x04\x00\x00\x00\x02\x00\x00\x00\x02\x60\x02\x60\x00\x00\x00\x00"
+#define IPC_SOUND_DETECTION "\x04\x00\x00\x00\x02\x00\x00\x00\x04\x60\x04\x60\x00\x00\x00\x00"
+
+#define PARENT_DIR "/tmp/onvif_notify_server"
+#define FILE_MOTION_START "/tmp/onvif_notify_server/motion_alarm"
+#define FILE_AI_HUMAN_DETECTION "/tmp/onvif_notify_server/human_detection"
+#define FILE_AI_VEHICLE_DETECTION "/tmp/onvif_notify_server/vehicle_detection"
+#define FILE_AI_ANIMAL_DETECTION "/tmp/onvif_notify_server/animal_detection"
+#define FILE_BABY_CRYING "/tmp/onvif_notify_server/baby_crying"
+#define FILE_SOUND_DETECTION "/tmp/onvif_notify_server/sound_detection"
+
+typedef enum
+{
+ IPC_MSG_UNRECOGNIZED,
+ IPC_MSG_MOTION_START,
+ IPC_MSG_MOTION_START_C,
+ IPC_MSG_MOTION_STOP,
+ IPC_MSG_AI_HUMAN_DETECTION,
+ IPC_MSG_AI_VEHICLE_DETECTION,
+ IPC_MSG_AI_ANIMAL_DETECTION,
+ IPC_MSG_BABY_CRYING,
+ IPC_MSG_SOUND_DETECTION,
+ IPC_MSG_COMMAND,
+ IPC_MSG_LAST
+} IPC_MESSAGE_TYPE;
+
+int ipc_init();
+void ipc_stop();
+static int open_queue();
+static int clear_queue();
+static void handle_ipc_unrecognized();
+static void handle_ipc_motion_generic(int detect);
+int ipc_set_callback(IPC_MESSAGE_TYPE type, void (*f)());
+static void call_callback(IPC_MESSAGE_TYPE type);
+int parse_message(char *msg, ssize_t len);
+int daemonize(int flags);
+int check_pid(char *file_name);
+int create_pid(char *file_name);
+void signal_handler(int signal);
+void *sound_stop_thread(void *arg);
+void process_event(int *alarm);
+void callback_motion_generic(void *arg);
+void print_usage(char *progname);
+
+#endif //IPC2FILE_H
diff --git a/src/ipc_cmd/ipc_cmd/ipc_cmd.c b/src/ipc_cmd/ipc_cmd/ipc_cmd.c
index 9072bf8..3d23c01 100644
--- a/src/ipc_cmd/ipc_cmd/ipc_cmd.c
+++ b/src/ipc_cmd/ipc_cmd/ipc_cmd.c
@@ -20,8 +20,10 @@
*/
#include "ipc_cmd.h"
+#include "ptz.h"
#include "getopt.h"
#include "signal.h"
+#include "math.h"
mqd_t ipc_mq;
@@ -56,7 +58,7 @@ void ipc_stop()
void print_usage(char *progname)
{
- fprintf(stderr, "\nUsage: %s [t ON/OFF] [-s SENS] [-l LED] [-v WHEN] [-i IR] [-r ROTATE] [-1] [-a AIHUMANDETECTION] [-E AIVEHICLEDETECTION] [-N AIANIMALDETECTION] [-O AIMOTIONDETECTION] [-c FACEDETECTION] [-o MOTIONTRACKING] [-I MIC] [-b SOUNDDETECTION] [-B BABYCRYING] [-n SOUNDSENSITIVITY] [-m MOVE] [-p NUM] [-P] [-R NUM] [-C MODE] [-f FILE] [-S] [-T] [-d]\n\n", progname);
+ fprintf(stderr, "\nUsage: %s [t ON/OFF] [-s SENS] [-l LED] [-v WHEN] [-i IR] [-r ROTATE] [-1] [-a AIHUMANDETECTION] [-E AIVEHICLEDETECTION] [-N AIANIMALDETECTION] [-O AIMOTIONDETECTION] [-c FACEDETECTION] [-o MOTIONTRACKING] [-I MIC] [-b SOUNDDETECTION] [-B BABYCRYING] [-n SOUNDSENSITIVITY] [-m MOVE] [-g] [-j ABS_POSITION] [-J REL_POSITION] [-p NUM] [-P NAME] [-R NUM] [-C MODE] [-f FILE] [-S TIME] [-T] [-d]\n\n", progname);
fprintf(stderr, "\t-t ON/OFF, --switch ON/OFF\n");
fprintf(stderr, "\t\tswitch ON or OFF the cam\n");
fprintf(stderr, "\t-s SENS, --sensitivity SENS\n");
@@ -93,10 +95,18 @@ void print_usage(char *progname)
fprintf(stderr, "\t\tset Sound Detection Sensitivity: 30 - 90\n");
fprintf(stderr, "\t-m MOVE, --move MOVE\n");
fprintf(stderr, "\t\tsend PTZ command: RIGHT, LEFT, DOWN, UP or STOP\n");
+ fprintf(stderr, "\t-g, --get-ptz\n");
+ fprintf(stderr, "\t\tget PTZ position\n");
+ fprintf(stderr, "\t-j ABS_POSITION, --jump-abs ABS_POSITION\n");
+ fprintf(stderr, "\t\tmove PTZ to ABS_POSITION (x,y) in degrees (example -j 500,500)\n");
+ fprintf(stderr, "\t-J REL_POSITION, --jump-rel REL_POSITION\n");
+ fprintf(stderr, "\t\tmove PTZ to REL_POSITION (x,y) in degrees (example -J 500,500)\n");
fprintf(stderr, "\t-p NUM, --preset NUM\n");
- fprintf(stderr, "\t\tsend PTZ go to preset command: NUM = [0..7]\n");
- fprintf(stderr, "\t-P, --add_preset\n");
- fprintf(stderr, "\t\tadd PTZ preset in the first available position\n");
+ fprintf(stderr, "\t\tsend PTZ go to preset command: TOKEN = [0..7]\n");
+ fprintf(stderr, "\t-P NAME, --add_preset NAME\n");
+ fprintf(stderr, "\t\tadd PTZ preset with name NAME in the first available position\n");
+ fprintf(stderr, "\t-H, --set_home_position\n");
+ fprintf(stderr, "\t\tset home position (preset 0 for Yi cam)\n");
fprintf(stderr, "\t-R NUM, --remove_preset NUM\n");
fprintf(stderr, "\t\tremove PTZ preset: NUM = [0..7] or \"all\"\n");
fprintf(stderr, "\t-C MODE, --cruise MODE\n");
@@ -137,8 +147,14 @@ int main(int argc, char ** argv)
int babycrying = NONE;
int soundsensitivity = NONE;
int move = NONE;
+ int get_pos = NONE;
+ int jump_abs = NONE;
+ int jump_rel = NONE;
+ char jump_msg[24];
+ double x, y;
int preset = NONE;
int add_preset = NONE;
+ int set_home_position = NONE;
int remove_preset = NONE;
int cruise = NONE;
int debug = 0;
@@ -176,8 +192,12 @@ int main(int argc, char ** argv)
{"soundsensitivity", required_argument, 0, 'n'},
{"move", required_argument, 0, 'm'},
{"move-reverse", required_argument, 0, 'M'},
+ {"get-pos", no_argument, 0, 'g'},
+ {"jump-abs", required_argument, 0, 'j'},
+ {"jump-rel", required_argument, 0, 'J'},
{"preset", required_argument, 0, 'p'},
- {"add_preset", no_argument, 0, 'P'},
+ {"add_preset", required_argument, 0, 'P'},
+ {"set_home_position", no_argument, 0, 'H'},
{"remove_preset", required_argument, 0, 'R'},
{"cruise", required_argument, 0, 'C'},
{"file", required_argument, 0, 'f'},
@@ -191,7 +211,7 @@ int main(int argc, char ** argv)
/* getopt_long stores the option index here. */
int option_index = 0;
- c = getopt_long (argc, argv, "t:s:l:v:i:r:a:E:N:O:c:o:I:b:B:n:m:M:p:PR:C:f:S:TxXdh",
+ c = getopt_long (argc, argv, "t:s:l:v:i:r:a:E:N:O:c:o:I:b:B:n:m:M:gj:J:p:P:HR:C:f:S:Txdh",
long_options, &option_index);
/* Detect the end of the options. */
@@ -426,6 +446,42 @@ int main(int argc, char ** argv)
}
break;
+ case 'g':
+ get_pos = 1;
+ break;
+
+ case 'j':
+ jump_abs = 1;
+ if (sscanf(optarg, "%lf,%lf", &x, &y) != 2) {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ if ((x < 0.0) || (x > 360.0)) {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ if ((y < 0.0) || (y > 180.0)) {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 'J':
+ jump_rel = 1;
+ if (sscanf(optarg, "%lf,%lf", &x, &y) != 2) {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ if ((x < -360.0) || (x > 360.0)) {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ if ((y < -180.0) || (y > 180.0)) {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
case 'p':
errno = 0; /* To distinguish success/failure after call */
preset = strtol(optarg, &endptr, 10);
@@ -442,9 +498,14 @@ int main(int argc, char ** argv)
break;
case 'P':
+ // Ignore argument
add_preset = 1;
break;
+ case 'H':
+ set_home_position = 1;
+ break;
+
case 'R':
errno = 0; /* To distinguish success/failure after call */
if (strcasecmp("all", optarg) == 0) {
@@ -667,16 +728,104 @@ int main(int argc, char ** argv)
mq_send(ipc_mq, IPC_SOUND_SENS_90, sizeof(IPC_SOUND_SENS_90) - 1, 0);
}
- if (move == MOVE_RIGHT) {
- mq_send(ipc_mq, IPC_MOVE_RIGHT, sizeof(IPC_MOVE_RIGHT) - 1, 0);
- } else if (move == MOVE_LEFT) {
- mq_send(ipc_mq, IPC_MOVE_LEFT, sizeof(IPC_MOVE_LEFT) - 1, 0);
- } else if (move == MOVE_DOWN) {
- mq_send(ipc_mq, IPC_MOVE_DOWN, sizeof(IPC_MOVE_DOWN) - 1, 0);
- } else if (move == MOVE_UP) {
- mq_send(ipc_mq, IPC_MOVE_UP, sizeof(IPC_MOVE_UP) - 1, 0);
- } else if (move == MOVE_STOP) {
- mq_send(ipc_mq, IPC_MOVE_STOP, sizeof(IPC_MOVE_STOP) - 1, 0);
+ if (move != NONE) {
+ char model_suffix[16];
+ int is_ptz_value;
+
+ memset(model_suffix, '\0', sizeof(model_suffix));
+ get_model_suffix(model_suffix, sizeof(model_suffix));
+ is_ptz_value = is_ptz(model_suffix);
+
+ if (is_ptz_value == ALLWINNER_V2) {
+ move = -1 * move;
+ } else if ((is_ptz_value == ALLWINNER_V2_ALT) &&
+ ((move == MOVE_LEFT) || (move == MOVE_RIGHT))) {
+ move = -1 * move;
+ }
+
+ if (move == MOVE_RIGHT) {
+ mq_send(ipc_mq, IPC_MOVE_RIGHT, sizeof(IPC_MOVE_RIGHT) - 1, 0);
+ } else if (move == MOVE_LEFT) {
+ mq_send(ipc_mq, IPC_MOVE_LEFT, sizeof(IPC_MOVE_LEFT) - 1, 0);
+ } else if (move == MOVE_DOWN) {
+ mq_send(ipc_mq, IPC_MOVE_DOWN, sizeof(IPC_MOVE_DOWN) - 1, 0);
+ } else if (move == MOVE_UP) {
+ mq_send(ipc_mq, IPC_MOVE_UP, sizeof(IPC_MOVE_UP) - 1, 0);
+ } else if (move == MOVE_STOP) {
+ mq_send(ipc_mq, IPC_MOVE_STOP, sizeof(IPC_MOVE_STOP) - 1, 0);
+ }
+ }
+
+ if (jump_abs != NONE) {
+ double fx, fy;
+ int cur_x, cur_y;
+ int fin_x, fin_y;
+ char model_suffix[16];
+ int is_ptz_value;
+
+ memset(model_suffix, '\0', sizeof(model_suffix));
+ get_model_suffix(model_suffix, sizeof(model_suffix));
+ is_ptz_value = is_ptz(model_suffix);
+
+ if (is_ptz_value == ALLWINNER_V2_ALT) {
+ y = 180.0 - y;
+ }
+
+ if (read_ptz(&cur_x, &cur_y) != 0) {
+ fprintf(stderr, "Error reading current ptz position\n");
+ return -1;
+ }
+ fx = x * (((double) MAX_PTZ_X) / 360.0);
+ fx = round(fx);
+ fx = (fx - ((double) cur_x)) * 100.0 / 911.0 + 50.0;
+ fin_x = (int) round(fx);
+ fy = y * (((double) MAX_PTZ_Y) / 180.0);
+ fy = round(fy);
+ fy = (fy - ((double) cur_y)) * 100.0 / 694.0 + 50.0;
+ fin_y = (int) round(fy);
+
+ if (debug) fprintf(stderr, "Current x = %d, y = %d\n", cur_x, cur_y);
+ if (debug) fprintf(stderr, "Command xr = %d, yr = %d\n", fin_x, fin_y);
+ memcpy(jump_msg, IPC_JUMP_POSITION, sizeof(IPC_JUMP_POSITION) - 1);
+ memcpy(&jump_msg[16], &fin_x, 4);
+ memcpy(&jump_msg[20], &fin_y, 4);
+ mq_send(ipc_mq, jump_msg, sizeof(IPC_JUMP_POSITION) - 1, 0);
+ }
+
+ if (jump_rel != NONE) {
+ double fx, fy;
+ int cur_x, cur_y;
+ int fin_x, fin_y;
+ char model_suffix[16];
+ int is_ptz_value;
+
+ memset(model_suffix, '\0', sizeof(model_suffix));
+ get_model_suffix(model_suffix, sizeof(model_suffix));
+ is_ptz_value = is_ptz(model_suffix);
+
+ if (is_ptz_value == ALLWINNER_V2_ALT) {
+ y = -1.0 * y;
+ }
+
+ if (read_ptz(&cur_x, &cur_y) != 0) {
+ fprintf(stderr, "Error reading current ptz position\n");
+ return -1;
+ }
+ fx = x * (((double) MAX_PTZ_X) / 360.0);
+ fx = round(fx);
+ fx = fx * 100.0 / 911.0 + 50.0;
+ fin_x = (int) round(fx);
+ fy = y * (((double) MAX_PTZ_Y) / 180.0);
+ fy = round(fy);
+ fy = fy * 100.0 / 694.0 + 50.0;
+ fin_y = (int) round(fy);
+
+ if (debug) fprintf(stderr, "Current x = %d, y = %d\n", cur_x, cur_y);
+ if (debug) fprintf(stderr, "Command xr = %d, yr = %d\n", fin_x, fin_y);
+ memcpy(jump_msg, IPC_JUMP_POSITION, sizeof(IPC_JUMP_POSITION) - 1);
+ memcpy(&jump_msg[16], &fin_x, 4);
+ memcpy(&jump_msg[20], &fin_y, 4);
+ mq_send(ipc_mq, jump_msg, sizeof(IPC_JUMP_POSITION) - 1, 0);
}
if (preset != NONE) {
@@ -686,6 +835,42 @@ int main(int argc, char ** argv)
}
if (add_preset != NONE) {
+ // Ignore name because Yi doesn't support it
+ mq_send(ipc_mq, IPC_ADD_PRESET, sizeof(IPC_ADD_PRESET) - 1, 0);
+ }
+
+ if (get_pos != NONE) {
+ double fx, fy;
+ int cur_x, cur_y;
+ char model_suffix[16];
+ int is_ptz_value;
+
+ memset(model_suffix, '\0', sizeof(model_suffix));
+ get_model_suffix(model_suffix, sizeof(model_suffix));
+ is_ptz_value = is_ptz(model_suffix);
+
+ if (read_ptz(&cur_x, &cur_y) != 0) {
+ fprintf(stderr, "Error reading current ptz position\n");
+ return -1;
+ }
+ fprintf(stderr, "Current x = %d, y = %d\n", cur_x, cur_y);
+ fx = ((double) cur_x) / ((double) MAX_PTZ_X) * 360.0;
+ fy = ((double) cur_y) / ((double) MAX_PTZ_Y) * 180.0;
+ if (is_ptz_value == ALLWINNER_V2_ALT) {
+ fy = 180.0 - fy;
+ }
+
+ fprintf(stderr, "Degrees x = %.1f, y = %.1f\n", fx, fy);
+ fprintf(stdout, "%.1f,%.1f\n", fx, fy);
+ }
+
+ if (set_home_position != NONE) {
+ // Remove preset 0
+ memcpy(preset_msg, IPC_REMOVE_PRESET, sizeof(IPC_REMOVE_PRESET) - 1);
+ preset_msg[16] = 0;
+ mq_send(ipc_mq, preset_msg, sizeof(IPC_REMOVE_PRESET) - 1, 0);
+ // sleep 1 sec and add it again
+ sleep(1);
mq_send(ipc_mq, IPC_ADD_PRESET, sizeof(IPC_ADD_PRESET) - 1, 0);
}
diff --git a/src/ipc_cmd/ipc_cmd/ipc_cmd.h b/src/ipc_cmd/ipc_cmd/ipc_cmd.h
index 7cbb819..b9b5bdc 100644
--- a/src/ipc_cmd/ipc_cmd/ipc_cmd.h
+++ b/src/ipc_cmd/ipc_cmd/ipc_cmd.h
@@ -33,6 +33,9 @@
#define NONE -1
+#define MAX_PTZ_X 4100
+#define MAX_PTZ_Y 1250
+
#define IPC_MOTION_START "\x01\x00\x00\x00\x02\x00\x00\x00\x7c\x00\x7c\x00\x00\x00\x00\x00"
#define IPC_MOTION_STOP "\x01\x00\x00\x00\x02\x00\x00\x00\x7d\x00\x7d\x00\x00\x00\x00\x00"
@@ -80,11 +83,13 @@
#define IPC_MOVE_UP "\x01\x00\x00\x00\x08\x00\x00\x00\x06\x40\x06\x40\x18\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
#define IPC_MOVE_STOP "\x01\x00\x00\x00\x08\x00\x00\x00\x07\x40\x01\x00\x00\x00\x00\x00"
-#define MOVE_RIGHT 0
-#define MOVE_LEFT 1
-#define MOVE_DOWN 2
+#define MOVE_STOP 0
+#define MOVE_RIGHT 2
+#define MOVE_LEFT -2
#define MOVE_UP 3
-#define MOVE_STOP 4
+#define MOVE_DOWN -3
+
+#define IPC_JUMP_POSITION "\x01\x00\x00\x00\x08\x00\x00\x00\x09\x40\x09\x40\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
#define IPC_GOTO_PRESET "\x01\x00\x00\x00\x08\x00\x00\x00\x02\x40\x01\x00\x04\x00\x00\x00\xff\x00\x00\x00"
#define IPC_ADD_PRESET "\x01\x00\x00\x00\x08\x00\x00\x00\x00\x40\x01\x00\x00\x00\x00\x00"
diff --git a/src/ipc_cmd/ipc_cmd/ipc_multiplex.c b/src/ipc_cmd/ipc_cmd/ipc_multiplex.c
index c6b9035..71dd30a 100644
--- a/src/ipc_cmd/ipc_cmd/ipc_multiplex.c
+++ b/src/ipc_cmd/ipc_cmd/ipc_multiplex.c
@@ -19,6 +19,8 @@ ssize_t (*original_mq_receive)(mqd_t, char*, size_t, unsigned int*);
**/
void ipc_multiplex_initialize() {
+ int i;
+
// Enable debug mode if requested
if (getenv(ENV_IPC_MULTIPLEX_DEBUG)) {
debug = true;
@@ -33,7 +35,7 @@ void ipc_multiplex_initialize() {
};
char queue_name[64];
- for (int i = 1; i < 10; i++) {
+ for (i = 1; i < 10; i++) {
sprintf(queue_name, "%s_%d", IPC_QUEUE_NAME, i);
// Open the message queue or create a new one if it does not exist
@@ -64,6 +66,8 @@ inline unsigned int get_message_target(char *msg_ptr) {
**/
ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio) {
+ int i;
+
// Initialize resources on first call.
if (is_initialized == false) {
ipc_multiplex_initialize();
@@ -74,7 +78,7 @@ ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg
if (debug) {
fprintf(stderr, "*** [IPC_MULTIPLEX] ");
- for(int i = 0; i < bytes_read; i++)
+ for(i = 0; i < bytes_read; i++)
fprintf(stderr, "%02x ", msg_ptr[i]);
fprintf(stderr, "\n");
}
@@ -85,7 +89,7 @@ ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg
// }
// Resend the received message to the dispatch queues
- for (int i = 1; i < 10; i++) {
+ for (i = 1; i < 10; i++) {
// mq_send will fail with EAGAIN whenever the target message queue is full.
if (mq_send(ipc_mq[i], msg_ptr, bytes_read, MESSAGE_PRIORITY) != 0 && errno != EAGAIN) {
@@ -95,4 +99,4 @@ ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg
// Return like the original function would do
return bytes_read;
-}
+}
\ No newline at end of file
diff --git a/src/ipc_cmd/ipc_cmd/ipc_notify.c b/src/ipc_cmd/ipc_cmd/ipc_notify.c
index d100f7a..8eeb363 100644
--- a/src/ipc_cmd/ipc_cmd/ipc_notify.c
+++ b/src/ipc_cmd/ipc_cmd/ipc_notify.c
@@ -72,8 +72,10 @@ char lookup[16] = {
static int parse_message(char *buffer, char *cmd, ssize_t len)
{
+ int i;
+
// Convert message to hex string
- for (int i = 0; i < len; i++) {
+ for (i = 0; i < len; i++) {
message_buffer[i * 2] = lookup[buffer[i] >> 4];
message_buffer[i * 2 + 1] = lookup[buffer[i] & 0xF];
}
diff --git a/src/ipc_cmd/ipc_cmd/ptz.c b/src/ipc_cmd/ipc_cmd/ptz.c
new file mode 100644
index 0000000..ce11035
--- /dev/null
+++ b/src/ipc_cmd/ipc_cmd/ptz.c
@@ -0,0 +1,111 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "ptz.h"
+
+#define MODEL_SUFFIX_FILE_V5 "/home/app/.camver"
+#define MODEL_SUFFIX_FILE_MA "/home/yi-hack/model_suffix"
+#define MODEL_SUFFIX_FILE_A2 "/tmp/sd/yi-hack/model_suffix"
+
+int is_ptz(char *model) {
+ if ((strcmp("yi_dome", model) == 0) ||
+ (strcmp("yi_dome_1080p", model) == 0) ||
+ (strcmp("yi_cloud_dome_1080p", model) == 0)) {
+
+ return V5;
+
+ } else if ((strcmp("h201c", model) == 0) ||
+ (strcmp("h305r", model) == 0) ||
+ (strcmp("y30", model) == 0) ||
+ (strcmp("h307", model) == 0)) {
+
+ return MSTAR;
+
+ } else if (strcmp("y30qa", model) == 0) {
+
+ return ALLWINNER;
+
+ } else if ((strcmp("r30gb", model) == 0) ||
+ (strcmp("r35gb", model) == 0) ||
+ (strcmp("r40ga", model) == 0) ||
+ (strcmp("h60ga", model) == 0) ||
+ (strcmp("q321br_lsx", model) == 0) ||
+ (strcmp("qg311r", model) == 0) ||
+ (strcmp("b091qp", model) == 0)) {
+
+ return ALLWINNER_V2;
+
+ } else if ((strcmp("h30ga", model) == 0) ||
+ (strcmp("h51ga", model) == 0) ||
+ (strcmp("h52ga", model) == 0)) {
+
+ return ALLWINNER_V2_ALT;
+ } else {
+ return 0;
+ }
+}
+
+int get_model_suffix(char *model, int size)
+{
+ FILE *fileStream;
+
+ fileStream = fopen(MODEL_SUFFIX_FILE_V5, "r");
+ if (fileStream == NULL) {
+ fileStream = fopen(MODEL_SUFFIX_FILE_MA, "r");
+ if (fileStream == NULL) {
+ fileStream = fopen(MODEL_SUFFIX_FILE_A2, "r");
+ if (fileStream == NULL) {
+ return -1;
+ }
+ }
+ }
+ if (fgets (model, size, fileStream) == NULL)
+ return -2;
+ fclose(fileStream);
+ model[strcspn(model, "\r\n")] = '\0';
+
+ return 0;
+}
+
+int ssp_init()
+{
+ int fd, iRet;
+
+ fd = open("/dev/ssp", O_RDONLY);
+
+ return fd;
+}
+
+int read_ptz(int *px, int *py)
+{
+ int fd_ssp;
+ fd_ssp = ssp_init();
+ if (fd_ssp == -1) {
+ fprintf(stderr, "Error opening cpld\n");
+ return -1;
+ }
+
+ int iRet;
+ unsigned char pos[32];
+
+ memset(pos, '\0', 32);
+ iRet = ioctl(fd_ssp, 0x6d01, &pos);
+ if (iRet < 0) {
+ fprintf(stderr, "Error getting position\n");
+ fprintf(stderr, "ioctl failed and returned errno %s\n", strerror(errno));
+ close(fd_ssp);
+ return -2;
+ }
+
+ close(fd_ssp);
+
+ *px = *((int *) (&pos[0]));
+ *py = *((int *) (&pos[4]));
+
+ return 0;
+}
diff --git a/src/ipc_cmd/ipc_cmd/ptz.h b/src/ipc_cmd/ipc_cmd/ptz.h
new file mode 100644
index 0000000..30e5630
--- /dev/null
+++ b/src/ipc_cmd/ipc_cmd/ptz.h
@@ -0,0 +1,9 @@
+#define V5 1
+#define MSTAR 2
+#define ALLWINNER 3
+#define ALLWINNER_V2 4
+#define ALLWINNER_V2_ALT 5
+
+int is_ptz(char *model);
+int get_model_suffix(char *model, int size);
+int read_ptz(int *px, int *py);
diff --git a/src/libfuse/compile.libfuse b/src/libfuse/compile.libfuse
index 2dbabe0..d5260f5 100755
--- a/src/libfuse/compile.libfuse
+++ b/src/libfuse/compile.libfuse
@@ -12,5 +12,5 @@ ninja || exit 1
rsync -av lib/libfuse3.so* ../../_install/lib/ || exit 1
-arm-hisiv300-linux-uclibcgnueabi-strip ../../_install/lib/* || exit 1
-
+arm-hisiv300-linux-uclibcgnueabi-strip ../../_install/lib/libfuse3.so.3.4.2 || exit 1
+#arm-hisiv300-linux-uclibcgnueabi-strip ../../_install/lib/libfuse3.so.3.4.2.p/*.o || exit 1
diff --git a/src/mqtt-config/mqtt-config/config.c b/src/mqtt-config/mqtt-config/config.c
index 1e02ee1..66eeb06 100644
--- a/src/mqtt-config/mqtt-config/config.c
+++ b/src/mqtt-config/mqtt-config/config.c
@@ -2,6 +2,24 @@
void (*fconf_handler)(const char* key, const char* value);
+void ucase(char *string) {
+ // Convert to upper case
+ char *s = string;
+ while (*s) {
+ *s = toupper((unsigned char) *s);
+ s++;
+ }
+}
+
+void lcase(char *string) {
+ // Convert to lower case
+ char *s = string;
+ while (*s) {
+ *s = tolower((unsigned char) *s);
+ s++;
+ }
+}
+
void config_set_handler(void (*f)(const char* key, const char* value))
{
if (f != NULL)
@@ -30,6 +48,72 @@ void config_parse(FILE *fp)
}
}
+void config_replace(char *filename, char *key, char *value)
+{
+ char buf[MAX_LINE_LENGTH];
+ char oldkey[128];
+ char oldvalue[128];
+ char *line;
+ int parsed;
+ FILE *fps, *fpt;
+ char tmpFile[L_tmpnam + 1]; // Add +1 for the null character.
+
+ lcase(filename);
+ ucase(key);
+
+ fps = fopen(filename, "r");
+ if (fps == NULL) {
+ printf("Can't open file \"%s\": %s\n", filename, strerror(errno));
+ return;
+ }
+
+ tmpnam(tmpFile);
+ fpt = fopen(tmpFile, "w");
+ if (fpt == NULL) {
+ printf("Can't open file \"%s\": %s\n", filename, strerror(errno));
+ return;
+ }
+
+ while (!feof(fps)) {
+ line = fgets(buf, MAX_LINE_LENGTH, fps);
+ if (line == NULL) break;
+ if (buf[0] != '#') {
+ parsed = sscanf(buf, "%[^=] = %s", oldkey, oldvalue);
+ if((parsed == 2) && (strcasecmp(key, oldkey) == 0)) {
+ sprintf(buf, "%s=%s\n", key, value);
+ }
+ }
+ fputs(buf, fpt);
+ }
+
+ fclose(fpt);
+ fclose(fps);
+
+ // Rename file (rename function is a cross-device link)
+ fps = fopen(filename, "w");
+ if (fps == NULL) {
+ printf("Can't open file \"%s\": %s\n", filename, strerror(errno));
+ return;
+ }
+
+ fpt = fopen(tmpFile, "r");
+ if (fpt == NULL) {
+ printf("Can't open file \"%s\": %s\n", filename, strerror(errno));
+ return;
+ }
+
+ while (!feof(fpt)) {
+ line = fgets(buf, MAX_LINE_LENGTH, fpt);
+ if (line == NULL) break;
+ fputs(buf, fps);
+ }
+
+ fclose(fpt);
+ fclose(fps);
+
+ remove(tmpFile);
+}
+
FILE *open_conf_file(const char* filename)
{
FILE *fp;
diff --git a/src/mqtt-config/mqtt-config/config.h b/src/mqtt-config/mqtt-config/config.h
index cc0a9e5..cb070a4 100644
--- a/src/mqtt-config/mqtt-config/config.h
+++ b/src/mqtt-config/mqtt-config/config.h
@@ -11,5 +11,6 @@
void config_set_handler(void (*f)(const char* key, const char* value));
void config_parse(FILE *fp);
+void config_replace(char *filename, char *key, char *value);
FILE *open_conf_file(const char* filename);
void close_conf_file(FILE *fp);
diff --git a/src/mqtt-config/mqtt-config/mqtt-config.c b/src/mqtt-config/mqtt-config/mqtt-config.c
index 04e511c..b928620 100644
--- a/src/mqtt-config/mqtt-config/mqtt-config.c
+++ b/src/mqtt-config/mqtt-config/mqtt-config.c
@@ -60,6 +60,7 @@ void disconnect_callback(struct mosquitto *mosq, void *obj, int result)
void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message)
{
char topic_prefix[MAX_LINE_LENGTH], topic[MAX_LINE_LENGTH], file[MAX_KEY_LENGTH], param[MAX_KEY_LENGTH];
+ char conf_file[256];
char *slash;
bool match = 0;
int len;
@@ -145,9 +146,13 @@ void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_
// Check if we need to run ipc_cmd
if (extract_param(ipc_cmd_param, file, param, 8) == 0) {
if (ipc_cmd_param[0] != '\0') {
- sprintf(cmd_line, "ipc_cmd %s %s", ipc_cmd_param, (char *) message->payload);
+ sprintf(cmd_line, ipc_cmd_param, (char *) message->payload);
if (debug) printf("Running system command \"%s\"\n", cmd_line);
system(cmd_line);
+ } else {
+ sprintf(conf_file, "%s/%s.conf", CONF_FILE_PATH, file);
+ if (debug) fprintf(stderr, "Updating file \"%s\", parameter \"%s\" with value \"%s\"\n", file, param, (char *) message->payload);
+ config_replace(conf_file, param, message->payload);
}
}
} else {
diff --git a/src/mqtt-config/mqtt-config/validate.c b/src/mqtt-config/mqtt-config/validate.c
index 694757e..dbe620d 100644
--- a/src/mqtt-config/mqtt-config/validate.c
+++ b/src/mqtt-config/mqtt-config/validate.c
@@ -18,17 +18,22 @@ char *config_params[PARAM_NUM][PARAM_OPTIONS] = {
{ "system", "SNAPSHOT", "bool", "", "", "" , "", "", "" },
{ "system", "SNAPSHOT_VIDEO", "bool", "", "", "" , "", "", "" },
{ "system", "SNAPSHOT_LOW", "bool", "", "", "" , "", "", "" },
+ { "system", "TIMELAPSE", "bool", "", "", "" , "", "", "" },
+ { "system", "TIMELAPSE_FTP", "bool", "", "", "" , "", "", "" },
+ { "system", "TIMELAPSE_DT", "int", "1", "1440", "" , "", "", "" },
+ { "system", "TIMELAPSE_VDT", "string", "1", "1440", "" , "", "", "" },
{ "system", "ONVIF", "bool", "", "", "" , "", "", "" },
{ "system", "ONVIF_WSDD", "bool", "", "", "" , "", "", "" },
{ "system", "ONVIF_PROFILE", "enum", "high", "low", "both" , "", "", "" },
{ "system", "ONVIF_WM_SNAPSHOT", "bool", "", "", "" , "", "", "" },
{ "system", "ONVIF_NETIF", "string", "", "", "" , "", "", "" },
+ { "system", "TIME_OSD", "bool", "", "", "" , "", "", "" },
{ "system", "NTPD", "bool", "", "", "" , "", "", "" },
{ "system", "NTP_SERVER", "string" "", "", "" , "", "", "" },
{ "system", "PROXYCHAINSNG", "bool", "", "", "" , "", "", "" },
{ "system", "SWAP_FILE", "bool", "", "", "" , "", "", "" },
+ { "system", "SWAP_SWAPPINESS", "int", "0", "100", "" , "", "", "" },
{ "system", "RTSP_PORT", "int", "1", "65535", "" , "", "", "" },
- { "system", "ONVIF_PORT", "int", "1", "65535", "" , "", "", "" },
{ "system", "HTTPD_PORT", "int", "1", "65535", "" , "", "", "" },
{ "system", "USERNAME", "string", "", "", "" , "", "", "" },
{ "system", "PASSWORD", "string", "", "", "" , "", "", "" },
@@ -43,23 +48,30 @@ char *config_params[PARAM_NUM][PARAM_OPTIONS] = {
{ "system", "FTP_FILE_DELETE_AFTER_UPLOAD", "bool", "", "", "" , "", "", "" },
{ "system", "SSH_PASSWORD", "string", "", "", "" , "", "", "" },
{ "system", "CRONTAB", "string", "", "", "" , "", "", "" },
-
- { "camera", "SWITCH_ON", "bool", "", "", "" , "", "", "-t" },
- { "camera", "SAVE_VIDEO_ON_MOTION", "bool", "", "", "" , "", "", "-v" },
- { "camera", "MOTION_DETECTION", "bool", "", "", "" , "", "", "-O" },
- { "camera", "SENSITIVITY", "enum", "low", "medium", "high" , "", "", "-s" },
- { "camera", "AI_HUMAN_DETECTION", "bool", "", "", "" , "", "", "-a" },
- { "camera", "AI_VEHICLE_DETECTION", "bool", "", "", "" , "", "", "-E" },
- { "camera", "AI_ANIMAL_DETECTION", "bool", "", "", "" , "", "", "-N" },
- { "camera", "FACE_DETECTION", "bool", "", "", "" , "", "", "-c" },
- { "camera", "BABY_CRYING_DETECT", "bool", "", "", "" , "", "", "-B" },
- { "camera", "LED", "bool", "", "", "" , "", "", "-l" },
- { "camera", "ROTATE", "bool", "", "", "" , "", "", "-r" },
- { "camera", "IR", "bool", "", "", "", "", "", "-i" },
- { "camera", "SOUND_DETECTION", "bool", "", "", "", "", "", "-b" },
- { "camera", "SOUND_SENSITIVITY", "int", "30", "90", "", "", "", "-n" },
- { "camera", "MOTION_TRACKING", "bool", "", "", "", "", "", "-o" },
- { "camera", "CRUISE", "enum", "no", "presets", "360", "", "", "-C" }
+ { "system", "DEBUG_LOG", "bool", "", "", "" , "", "", "" },
+
+ { "camera", "SWITCH_ON", "bool", "", "", "" , "", "", "ipc_cmd -t %s" },
+ { "camera", "SAVE_VIDEO_ON_MOTION", "bool", "", "", "" , "", "", "ipc_cmd -v %s" },
+ { "camera", "MOTION_DETECTION", "bool", "", "", "" , "", "", "ipc_cmd -O %s" },
+ { "camera", "SENSITIVITY", "enum", "low", "medium", "high" , "", "", "ipc_cmd -s %s" },
+ { "camera", "AI_HUMAN_DETECTION", "bool", "", "", "" , "", "", "ipc_cmd -a %s" },
+ { "camera", "AI_VEHICLE_DETECTION", "bool", "", "", "" , "", "", "ipc_cmd -E %s" },
+ { "camera", "AI_ANIMAL_DETECTION", "bool", "", "", "" , "", "", "ipc_cmd -N %s" },
+ { "camera", "FACE_DETECTION", "bool", "", "", "" , "", "", "ipc_cmd -c %s" },
+ { "camera", "BABY_CRYING_DETECT", "bool", "", "", "" , "", "", "ipc_cmd -B %s" },
+ { "camera", "LED", "bool", "", "", "" , "", "", "ipc_cmd -l %s" },
+ { "camera", "ROTATE", "bool", "", "", "" , "", "", "ipc_cmd -r %s" },
+ { "camera", "IR", "bool", "", "", "", "", "", "ipc_cmd -i %s" },
+ { "camera", "SOUND_DETECTION", "bool", "", "", "", "", "", "ipc_cmd -b %s" },
+ { "camera", "SOUND_SENSITIVITY", "int", "30", "90", "", "", "", "ipc_cmd -n %s" },
+ { "camera", "MOTION_TRACKING", "bool", "", "", "", "", "", "ipc_cmd -o %s" },
+ { "camera", "CRUISE", "enum", "no", "presets", "360", "", "", "ipc_cmd -C %s" },
+
+ { "ptz", "MOVE", "enum", "right", "left", "down", "up", "stop", "QUERY_STRING=\"action=step&dir=%s\" /home/yi-hack/www/cgi-bin/ptz.sh" },
+ { "ptz", "GOTO_PRESET", "int", "0", "7", "", "", "", "/home/yi-hack/script/ptz_presets.sh -a go_preset -n %s" },
+ { "ptz", "ADD_PRESET", "string", "", "", "", "", "", "/home/yi-hack/script/ptz_presets.sh -a add_preset -m %s" },
+ { "ptz", "SET_HOME_POSITION", "string", "", "", "", "", "", "/home/yi-hack/script/ptz_presets.sh -a set_home_position" },
+ { "ptz", "REMOVE_PRESET", "int", "0", "7", "", "", "", "/home/yi-hack/script/ptz_presets.sh -a del_preset -n %s" },
};
int validate_param(char *file, char *key, char *value)
diff --git a/src/mqtt-config/mqtt-config/validate.h b/src/mqtt-config/mqtt-config/validate.h
index 747b981..0e935c9 100644
--- a/src/mqtt-config/mqtt-config/validate.h
+++ b/src/mqtt-config/mqtt-config/validate.h
@@ -6,7 +6,7 @@
#define PARAM_SIZE 128
#define PARAM_OPTIONS 9
-#define PARAM_NUM 58
+#define PARAM_NUM 69
int validate_param(char *file, char *key, char *value);
int extract_param(char *param, char *file, char *key, int index);
diff --git a/src/onvif_simple_server/.gitignore b/src/onvif_simple_server/.gitignore
new file mode 100644
index 0000000..bd9de20
--- /dev/null
+++ b/src/onvif_simple_server/.gitignore
@@ -0,0 +1,5 @@
+# Ignore the install dir
+_install/
+*.xz
+libtomcrypt*/
+onvif_simple_server/onvif_simple_server
diff --git a/src/onvif_simple_server/cleanup.onvif_simple_server b/src/onvif_simple_server/cleanup.onvif_simple_server
new file mode 100755
index 0000000..733f138
--- /dev/null
+++ b/src/onvif_simple_server/cleanup.onvif_simple_server
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+SCRIPT_DIR=$(cd `dirname $0` && pwd)
+cd $SCRIPT_DIR
+
+cd onvif_simple_server
+
+make clean
+
+cd ..
+
+rm -rf libtomcrypt*
+rm crypt*.tar.xz
diff --git a/src/onvif_simple_server/compile.onvif_simple_server b/src/onvif_simple_server/compile.onvif_simple_server
new file mode 100755
index 0000000..7219c61
--- /dev/null
+++ b/src/onvif_simple_server/compile.onvif_simple_server
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+export CROSSPATH=/opt/arm-hisiv300-linux/bin
+export PATH=${PATH}:${CROSSPATH}
+
+export TARGET=arm-hisiv300-linux-uclibcgnueabi
+export CROSS=arm-hisiv300-linux-uclibcgnueabi
+export BUILD=x86_64-pc-linux-gnu
+
+export CROSSPREFIX=${CROSS}-
+
+export STRIP=${CROSSPREFIX}strip
+export CXX=${CROSSPREFIX}g++
+export CC=${CROSSPREFIX}gcc
+export LD=${CROSSPREFIX}ld
+export AS=${CROSSPREFIX}as
+export AR=${CROSSPREFIX}ar
+
+SCRIPT_DIR=$(cd `dirname $0` && pwd)
+cd $SCRIPT_DIR
+
+cd libtomcrypt-1.18.2
+#make clean
+CFLAGS="-DLTC_NOTHING -DLTC_SHA1 -DLTC_BASE64 -ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections" make
+cd ..
+
+cd onvif_simple_server || exit 1
+
+#make clean
+CFLAGS="-std=c99"
+make || exit 1
+
+mkdir -p ../_install/www/onvif || exit 1
+mkdir -p ../_install/bin || exit 1
+mkdir -p ../_install/etc/onvif_notify_server || exit 1
+mkdir -p ../_install/etc/wsd_simple_server || exit 1
+
+cp ./onvif_simple_server ../_install/www/onvif || exit 1
+echo "#!/tmp/sd/yi-hack-v5/www/onvif/onvif_simple_server" > ../_install/www/onvif/device_service
+chmod 0755 ../_install/www/onvif/device_service
+echo "#!/tmp/sd/yi-hack-v5/www/onvif/onvif_simple_server" > ../_install/www/onvif/events_service
+chmod 0755 ../_install/www/onvif/events_service
+echo "#!/tmp/sd/yi-hack-v5/www/onvif/onvif_simple_server" > ../_install/www/onvif/media_service
+chmod 0755 ../_install/www/onvif/media_service
+echo "#!/tmp/sd/yi-hack-v5/www/onvif/onvif_simple_server" > ../_install/www/onvif/ptz_service
+chmod 0755 ../_install/www/onvif/ptz_service
+cp -R ./device_service_files ../_install/www/onvif
+cp -R ./events_service_files ../_install/www/onvif
+cp -R ./generic_files ../_install/www/onvif
+cp -R ./media_service_files ../_install/www/onvif
+cp -R ./ptz_service_files ../_install/www/onvif
+
+cp ./onvif_notify_server ../_install/bin || exit 1
+cp -R ./notify_files/* ../_install/etc/onvif_notify_server
+
+cp ./wsd_simple_server ../_install/bin || exit 1
+cp -R ./wsd_files/* ../_install/etc/wsd_simple_server
+
+${STRIP} ../_install/bin/* || exit 1
+${STRIP} ../_install/www/onvif/onvif_simple_server || exit 1
diff --git a/src/onvif_simple_server/init.onvif_simple_server b/src/onvif_simple_server/init.onvif_simple_server
new file mode 100755
index 0000000..844f5dc
--- /dev/null
+++ b/src/onvif_simple_server/init.onvif_simple_server
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+SCRIPT_DIR=$(cd `dirname $0` && pwd)
+cd $SCRIPT_DIR
+
+rm -rf ./_install
+
+if [ ! -f crypt-1.18.2.tar.xz ]; then
+ wget https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz
+fi
+tar Jxvf ./crypt-1.18.2.tar.xz
+if [ ! -L onvif_simple_server/extras/libtomcrypt ]; then
+ ln -s ../../libtomcrypt-1.18.2 onvif_simple_server/extras/libtomcrypt
+fi
+
+cd onvif_simple_server
+
+git reset --hard
+
+patch -p1 < ../path.patch
diff --git a/src/wsdd/install.wsdd b/src/onvif_simple_server/install.onvif_simple_server
similarity index 50%
rename from src/wsdd/install.wsdd
rename to src/onvif_simple_server/install.onvif_simple_server
index 50e54cc..099379b 100755
--- a/src/wsdd/install.wsdd
+++ b/src/onvif_simple_server/install.onvif_simple_server
@@ -3,6 +3,7 @@
SCRIPT_DIR=$(cd `dirname $0` && pwd)
cd $SCRIPT_DIR
+mkdir -p ../../build/home/yi-hack-v5/www/onvif || exit 1
mkdir -p ../../build/home/yi-hack-v5/bin/ || exit 1
-rsync -a ./_install/bin/wsdd ../../build/home/yi-hack-v5/bin/
+rsync -av ./_install/* ../../build/home/yi-hack-v5/ || exit 1
diff --git a/src/onvif_simple_server/onvif_simple_server b/src/onvif_simple_server/onvif_simple_server
new file mode 160000
index 0000000..2f49b9a
--- /dev/null
+++ b/src/onvif_simple_server/onvif_simple_server
@@ -0,0 +1 @@
+Subproject commit 2f49b9aa7cd99a6e95e5cad53b93554e278ada3c
diff --git a/src/onvif_simple_server/path.patch b/src/onvif_simple_server/path.patch
new file mode 100644
index 0000000..b69e94b
--- /dev/null
+++ b/src/onvif_simple_server/path.patch
@@ -0,0 +1,45 @@
+diff -Naur onvif_simple_server.ori/onvif_notify_server.c onvif_simple_server/onvif_notify_server.c
+--- onvif_simple_server.ori/onvif_notify_server.c 2023-12-09 22:58:35.403631631 +0100
++++ onvif_simple_server/onvif_notify_server.c 2023-12-09 22:59:34.011730308 +0100
+@@ -39,10 +39,10 @@
+ #include "log.h"
+ #include "onvif_simple_server.h"
+
+-#define DEFAULT_CONF_FILE "/etc/onvif_simple_server.conf"
+-#define DEFAULT_LOG_FILE "/var/log/onvif_notify_server.log"
++#define DEFAULT_CONF_FILE "/tmp/onvif_simple_server.conf"
++#define DEFAULT_LOG_FILE "/tmp/onvif_notify_server.log"
+ #define DEFAULT_PID_FILE "/var/run/onvif_notify_server.pid"
+-#define TEMPLATE_DIR "/etc/onvif_notify_server"
++#define TEMPLATE_DIR "/tmp/sd/yi-hack-v5/etc/onvif_notify_server"
+ #define INOTIFY_DIR "/tmp/onvif_notify_server"
+
+ #define ALARM_OFF 0
+diff -Naur onvif_simple_server.ori/onvif_simple_server.c onvif_simple_server/onvif_simple_server.c
+--- onvif_simple_server.ori/onvif_simple_server.c 2023-12-09 22:57:18.935503114 +0100
++++ onvif_simple_server/onvif_simple_server.c 2023-12-09 23:00:26.871819429 +0100
+@@ -36,8 +36,8 @@
+ #include "utils.h"
+ #include "log.h"
+
+-#define DEFAULT_CONF_FILE "/etc/onvif_simple_server.conf"
+-#define DEFAULT_LOG_FILE "/var/log/onvif_simple_server.log"
++#define DEFAULT_CONF_FILE "/tmp/onvif_simple_server.conf"
++#define DEFAULT_LOG_FILE "/tmp/onvif_simple_server.log"
+ #define DEBUG_FILE "/tmp/onvif_simple_server.debug"
+
+ #define ROTATION_LOG_LENGTH 3
+diff -Naur onvif_simple_server.ori/wsd_simple_server.c onvif_simple_server/wsd_simple_server.c
+--- onvif_simple_server.ori/wsd_simple_server.c 2023-12-09 22:57:18.935503114 +0100
++++ onvif_simple_server/wsd_simple_server.c 2023-12-09 23:01:06.899886974 +0100
+@@ -38,8 +38,8 @@
+ #define PORT 3702
+ #define TYPE "NetworkVideoTransmitter"
+
+-#define DEFAULT_LOG_FILE "/var/log/wsd_simple_server.log"
+-#define TEMPLATE_DIR "/etc/wsd_simple_server"
++#define DEFAULT_LOG_FILE "/tmp/wsd_simple_server.log"
++#define TEMPLATE_DIR "/tmp/sd/yi-hack-v5/etc/wsd_simple_server"
+
+ #define RECV_BUFFER_LEN 4096
+
diff --git a/src/onvif_srvd/.gitignore b/src/onvif_srvd/.gitignore
deleted file mode 100644
index d6ea4d2..0000000
--- a/src/onvif_srvd/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-# Ignore the install dir
-_install/
-onvif_srvd/.depend
-onvif_srvd/SDK/
-onvif_srvd/generated/
-onvif_srvd/gsoap-2.8/
-onvif_srvd/lib/
-onvif_srvd/onvif_srvd
-onvif_srvd/openssl
-onvif_srvd/openssl-1.0.2u/
-onvif_srvd/src/ServiceContext.o
-onvif_srvd/src/ServiceDevice.o
-onvif_srvd/src/ServiceMedia.o
-onvif_srvd/src/ServicePTZ.o
-onvif_srvd/src/daemon.o
-onvif_srvd/src/eth_dev_param.o
-onvif_srvd/src/onvif_srvd.o
-
diff --git a/src/onvif_srvd/Makefile.onvif_srvd b/src/onvif_srvd/Makefile.onvif_srvd
deleted file mode 100644
index 4c2396d..0000000
--- a/src/onvif_srvd/Makefile.onvif_srvd
+++ /dev/null
@@ -1,325 +0,0 @@
-DAEMON_NAME = onvif_srvd
-DAEMON_MAJOR_VERSION = 1
-DAEMON_MINOR_VERSION = 1
-DAEMON_PATCH_VERSION = 0
-DAEMON_PID_FILE_NAME = $(DAEMON_NAME).pid
-DAEMON_LOG_FILE_NAME = $(DAEMON_NAME).log
-DAEMON_NO_CHDIR = 1
-DAEMON_NO_CLOSE_STDIO = 0
-
-
-GSOAP_VERSION = 2.8.92
-GSOAP_INSTALL_DIR = ./gsoap-2.8
-GSOAP_DIR = $(GSOAP_INSTALL_DIR)/gsoap
-GSOAP_CUSTOM_DIR = $(GSOAP_DIR)/custom
-GSOAP_PLUGIN_DIR = $(GSOAP_DIR)/plugin
-GSOAP_IMPORT_DIR = $(GSOAP_DIR)/import
-OPENSSL_DIR = ./openssl
-
-
-SOAPCPP2 = $(GSOAP_DIR)/src/soapcpp2
-WSDL2H = $(GSOAP_DIR)/wsdl/wsdl2h
-GSOAP_CONFIGURE = --disable-c-locale
-
-
-COMMON_DIR = ./src
-GENERATED_DIR = ./generated
-
-
-CXXFLAGS = -DDAEMON_NAME='"$(DAEMON_NAME)"'
-CXXFLAGS += -DDAEMON_MAJOR_VERSION=$(DAEMON_MAJOR_VERSION)
-CXXFLAGS += -DDAEMON_MINOR_VERSION=$(DAEMON_MINOR_VERSION)
-CXXFLAGS += -DDAEMON_PATCH_VERSION=$(DAEMON_PATCH_VERSION)
-CXXFLAGS += -DDAEMON_PID_FILE_NAME='"$(DAEMON_PID_FILE_NAME)"'
-CXXFLAGS += -DDAEMON_LOG_FILE_NAME='"$(DAEMON_LOG_FILE_NAME)"'
-CXXFLAGS += -DDAEMON_NO_CHDIR=$(DAEMON_NO_CHDIR)
-CXXFLAGS += -DDAEMON_NO_CLOSE_STDIO=$(DAEMON_NO_CLOSE_STDIO)
-
-CXXFLAGS += -I$(COMMON_DIR)
-CXXFLAGS += -I$(GENERATED_DIR)
-CXXFLAGS += -I$(GSOAP_DIR) -I$(GSOAP_CUSTOM_DIR) -I$(GSOAP_PLUGIN_DIR) -I$(GSOAP_IMPORT_DIR)
-CXXFLAGS += -std=c++11 -O2 -Wall -pipe
-CXXFLAGS += -DWITH_NO_C_LOCALE
-
-CXX ?= g++
-
-
-
-
-
-# To build a daemon with WS-Security support,
-# call make with the WSSE_ON=1 parameter
-# example:
-# make WSSE_ON=1 all
-ifdef WSSE_ON
-CXXFLAGS += -DWITH_OPENSSL -I$(OPENSSL_DIR)/include
-LDFLAGS += openssl/libssl.a openssl/libcrypto.a -ldl
-
-WSSE_SOURCES = $(GSOAP_PLUGIN_DIR)/wsseapi.c \
- $(GSOAP_PLUGIN_DIR)/mecevp.c \
- $(GSOAP_PLUGIN_DIR)/smdevp.c \
- $(GSOAP_PLUGIN_DIR)/wsaapi.c
-
-WSSE_IMPORT = echo '\#import "wsse.h" ' >> $@
-else
-GSOAP_CONFIGURE += --disable-ssl
-endif
-
-
-
-
-
-
-
-SOAP_SRC = $(GSOAP_DIR)/stdsoap2.cpp \
- $(GSOAP_DIR)/dom.cpp \
- $(GSOAP_CUSTOM_DIR)/duration.c
-
-
-
-# We can't use wildcard func, this files will be generated
-SOAP_SERVICE_SRC = $(GENERATED_DIR)/soapDeviceBindingService.cpp \
- $(GENERATED_DIR)/soapMediaBindingService.cpp \
- $(GENERATED_DIR)/soapPTZBindingService.cpp
-
-
-
-# Add your source files to the list.
-# Supported *.c *.cpp *.S files.
-# For other file types write a template rule for build, see below.
-SOURCES = $(COMMON_DIR)/daemon.c \
- $(COMMON_DIR)/$(DAEMON_NAME).cpp \
- $(COMMON_DIR)/eth_dev_param.cpp \
- $(COMMON_DIR)/ServiceContext.cpp \
- $(COMMON_DIR)/ServiceDevice.cpp \
- $(COMMON_DIR)/ServiceMedia.cpp \
- $(COMMON_DIR)/ServicePTZ.cpp \
- $(GENERATED_DIR)/soapC.cpp \
- $(SOAP_SRC) \
- $(SOAP_SERVICE_SRC) \
- $(WSSE_SOURCES)
-
-
-
-
-
-
-OBJECTS := $(patsubst %.c, %.o, $(SOURCES) )
-OBJECTS := $(patsubst %.cpp,%.o, $(OBJECTS) )
-OBJECTS := $(patsubst %.S, %.o, $(OBJECTS) )
-
-
-DEBUG_SUFFIX = debug
-
-DEBUG_OBJECTS := $(patsubst %.o, %_$(DEBUG_SUFFIX).o, $(OBJECTS) )
-
-
-
-
-WSDL_FILES = $(wildcard wsdl/*.wsdl wsdl/*.xsd)
-
-
-
-
-.PHONY: all
-all: debug release
-
-
-
-.PHONY: release
-release: CXXFLAGS := -s $(CXXFLAGS)
-release: $(DAEMON_NAME)
-
-
-
-.PHONY: debug
-debug: DAEMON_NO_CLOSE_STDIO = 1
-debug: CXXFLAGS := -DDEBUG -g $(CXXFLAGS)
-debug: $(DAEMON_NAME)_$(DEBUG_SUFFIX)
-
-
-
-# release
-$(DAEMON_NAME): .depend $(OBJECTS)
- $(call build_bin, $(OBJECTS))
-
-
-# debug
-$(DAEMON_NAME)_$(DEBUG_SUFFIX): .depend $(DEBUG_OBJECTS)
- $(call build_bin, $(DEBUG_OBJECTS))
-
-
-
-# Build release objects
-%.o: %.c
- $(build_object)
-
-
-%.o: %.cpp
- $(build_object)
-
-
-%.o: %.S
- $(build_object)
-
-
-
-# Build debug objects
-%_$(DEBUG_SUFFIX).o: %.c
- $(build_object)
-
-
-%_$(DEBUG_SUFFIX).o: %.cpp
- $(build_object)
-
-
-%_$(DEBUG_SUFFIX).o: %.S
- $(build_object)
-
-
-
-.PHONY: clean
-clean:
- -@rm -f $(DAEMON_NAME)
- -@rm -f $(DAEMON_NAME)_$(DEBUG_SUFFIX)
- -@rm -f $(OBJECTS)
- -@rm -f $(DEBUG_OBJECTS)
- -@rm -f .depend
- -@rm -f -d -R $(GENERATED_DIR)
- -@rm -f *.*~
-
-
-
-.PHONY: distclean
-distclean: clean
- -@rm -f -d -R SDK
- -@rm -f -d -R $(GSOAP_INSTALL_DIR)
- -@rm -f RECV.log SENT.log TEST.log
-
-
-
-
-.depend: $(GENERATED_DIR)/soapC.cpp
- -@rm -f .depend
- @echo "Generating dependencies..."
- @for src in $(SOURCES) ; do \
- echo " [depend] $$src" ; \
- $(CXX) $(CXXFLAGS) -MT ".depend $${src%.*}.o $${src%.*}_$(DEBUG_SUFFIX).o" -MM $$src >> .depend ; \
- done
-
-
-
-ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""
- include $(wildcard .depend)
-endif
-
-
-
-
-
-# ---- gSOAP ----
-
-$(GENERATED_DIR)/onvif.h:
- @$(build_openssl)
- @$(build_gsoap)
- @mkdir -p $(GENERATED_DIR)
- $(WSDL2H) -d -t ./wsdl/typemap.dat -o $@ $(WSDL_FILES)
- $(WSSE_IMPORT)
-
-
-
-$(GENERATED_DIR)/soapC.cpp: $(GENERATED_DIR)/onvif.h
- $(SOAPCPP2) -j -L -x -S -d $(GENERATED_DIR) -I$(GSOAP_DIR):$(GSOAP_IMPORT_DIR) $<
-
-
-
-# This targets is needed for parallel work of make
-$(OBJECTS) $(DEBUG_OBJECTS) $(SOAP_SRC) $(SOAP_SERVICE_SRC) $(WSSE_SOURCES): $(GENERATED_DIR)/soapC.cpp
-
-
-
-
-# Common commands
-BUILD_ECHO = echo "\n [build] $@:"
-
-
-define build_object
- @$(BUILD_ECHO)
- $(CXX) -c $< -o $@ $(CXXFLAGS)
-endef
-
-
-
-define build_bin
- @$(BUILD_ECHO)
- $(CXX) $1 -o $@ $(CXXFLAGS) $(LDFLAGS)
- @echo "\n---- Compiled $@ ver $(DAEMON_MAJOR_VERSION).$(DAEMON_MINOR_VERSION).$(DAEMON_PATCH_VERSION) ----\n"
-endef
-
-
-
-define build_gsoap
-
- # get archive
- if [ ! -f SDK/gsoap.zip ]; then \
- mkdir -p SDK; \
- wget -O ./SDK/gsoap.zip.tmp "http://dl.t2-project.org/mirror/trunk/g/gsoap_$(GSOAP_VERSION).zip" || \
- wget -O ./SDK/gsoap.zip.tmp "https://sourceforge.net/projects/gsoap2/files/gsoap-2.8/gsoap_$(GSOAP_VERSION).zip/download" || \
- wget -O ./SDK/gsoap.zip.tmp "https://sourceforge.net/projects/gsoap2/files/oldreleases/gsoap_$(GSOAP_VERSION).zip/download" || \
- wget -O ./SDK/gsoap.zip.tmp "https://master.dl.sourceforge.net/project/gsoap2/oldreleases/gsoap_$(GSOAP_VERSION).zip" && \
- mv ./SDK/gsoap.zip.tmp ./SDK/gsoap.zip; \
- fi
-
- # unzip
- if [ ! -f $(GSOAP_INSTALL_DIR)/README.txt ]; then \
- unzip ./SDK/gsoap.zip; \
- fi
-
- # build
- if [ ! -f $(SOAPCPP2) ] || [ ! -f $(WSDL2H) ]; then \
- cd $(GSOAP_INSTALL_DIR); \
- unset CXX && ./configure $(GSOAP_CONFIGURE) && \
- make -j1; \
- cd ..;\
- fi
-endef
-
-
-
-define build_openssl
-
- # get archive
- if [ ! -f SDK/openssl.tar.gz ]; then \
- mkdir -p SDK; \
- wget -O ./SDK/openssl.tar.gz.tmp "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz" && \
- mv ./SDK/openssl.tar.gz.tmp ./SDK/openssl.tar.gz; \
- fi
-
- # untar
- if [ ! -f openssl-1.0.2u/README ]; then \
- tar zxvf ./SDK/openssl.tar.gz; \
- ln -s openssl-1.0.2u openssl; \
- fi
-
- # build
- if [ ! -f openssl/libcrypto.so.1.0.0 ] || [ ! -f openssl/libssl.so.1.0.0 ]; then \
- cd openssl; \
- CC=arm-hisiv300-linux-uclibcgnueabi-gcc ./Configure linux-generic32 && \
- CC=arm-hisiv300-linux-uclibcgnueabi-gcc make; \
- cd ..;\
- fi
-endef
-
-
-
-.PHONY: help
-help:
- @echo "make [command]"
- @echo "command is:"
- @echo " all - build daemon in release and debug mode"
- @echo " debug - build in debug mode (#define DEBUG 1)"
- @echo " release - build in release mode (strip)"
- @echo " clean - remove all generated files"
- @echo " distclean - clean + remove all SDK files"
- @echo " help - this help"
-
diff --git a/src/onvif_srvd/cleanup.onvif_srvd b/src/onvif_srvd/cleanup.onvif_srvd
deleted file mode 100755
index 89d3530..0000000
--- a/src/onvif_srvd/cleanup.onvif_srvd
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-SCRIPT_DIR=$(cd `dirname $0` && pwd)
-cd $SCRIPT_DIR
-
-cd onvif_srvd
-
-make clean
-rm -rf SDK
-rm -rf gsoap-2.8
-rm -rf openssl-1.0.2u
-rm -rf openssl
diff --git a/src/onvif_srvd/compile.onvif_srvd b/src/onvif_srvd/compile.onvif_srvd
deleted file mode 100755
index de487e9..0000000
--- a/src/onvif_srvd/compile.onvif_srvd
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-export PATH=${PATH}:/opt/arm-hisiv300-linux/bin
-
-export TARGET=arm-hisiv300-linux-uclibcgnueabi
-export CROSS=arm-hisiv300-linux-uclibcgnueabi
-export BUILD=x86_64-pc-linux-gnu
-
-export CROSSPREFIX=${CROSS}-
-
-export CXX=${CROSSPREFIX}g++
-
-SCRIPT_DIR=$(cd `dirname $0` && pwd)
-cd $SCRIPT_DIR
-
-cd onvif_srvd || exit 1
-
-make clean
-make WSSE_ON=1 release || exit 1
-mkdir -p $SCRIPT_DIR/_install/bin
-cp onvif_srvd $SCRIPT_DIR/_install/bin/
diff --git a/src/onvif_srvd/init.onvif_srvd b/src/onvif_srvd/init.onvif_srvd
deleted file mode 100755
index d6eed52..0000000
--- a/src/onvif_srvd/init.onvif_srvd
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-SCRIPT_DIR=$(cd `dirname $0` && pwd)
-cd $SCRIPT_DIR
-
-rm -rf ./_install
-
-cd onvif_srvd || exit 1
-#git reset --hard || exit 1
-
-cd ..
-
-cp Makefile.onvif_srvd onvif_srvd/Makefile
diff --git a/src/onvif_srvd/install.onvif_srvd b/src/onvif_srvd/install.onvif_srvd
deleted file mode 100755
index a00e3c7..0000000
--- a/src/onvif_srvd/install.onvif_srvd
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-SCRIPT_DIR=$(cd `dirname $0` && pwd)
-cd $SCRIPT_DIR
-
-mkdir -p ../../build/home/yi-hack-v5/bin/ || exit 1
-
-rsync -a ./_install/bin/onvif_srvd ../../build/home/yi-hack-v5/bin/
diff --git a/src/onvif_srvd/onvif_srvd/LICENSE b/src/onvif_srvd/onvif_srvd/LICENSE
deleted file mode 100644
index 6a3fbb9..0000000
--- a/src/onvif_srvd/onvif_srvd/LICENSE
+++ /dev/null
@@ -1,30 +0,0 @@
-BSD 3-Clause License
-
-Copyright (c) 2016, Koynov Stas - skojnov@yandex.ru
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-3. Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/onvif_srvd/onvif_srvd/Makefile b/src/onvif_srvd/onvif_srvd/Makefile
deleted file mode 100644
index 4c2396d..0000000
--- a/src/onvif_srvd/onvif_srvd/Makefile
+++ /dev/null
@@ -1,325 +0,0 @@
-DAEMON_NAME = onvif_srvd
-DAEMON_MAJOR_VERSION = 1
-DAEMON_MINOR_VERSION = 1
-DAEMON_PATCH_VERSION = 0
-DAEMON_PID_FILE_NAME = $(DAEMON_NAME).pid
-DAEMON_LOG_FILE_NAME = $(DAEMON_NAME).log
-DAEMON_NO_CHDIR = 1
-DAEMON_NO_CLOSE_STDIO = 0
-
-
-GSOAP_VERSION = 2.8.92
-GSOAP_INSTALL_DIR = ./gsoap-2.8
-GSOAP_DIR = $(GSOAP_INSTALL_DIR)/gsoap
-GSOAP_CUSTOM_DIR = $(GSOAP_DIR)/custom
-GSOAP_PLUGIN_DIR = $(GSOAP_DIR)/plugin
-GSOAP_IMPORT_DIR = $(GSOAP_DIR)/import
-OPENSSL_DIR = ./openssl
-
-
-SOAPCPP2 = $(GSOAP_DIR)/src/soapcpp2
-WSDL2H = $(GSOAP_DIR)/wsdl/wsdl2h
-GSOAP_CONFIGURE = --disable-c-locale
-
-
-COMMON_DIR = ./src
-GENERATED_DIR = ./generated
-
-
-CXXFLAGS = -DDAEMON_NAME='"$(DAEMON_NAME)"'
-CXXFLAGS += -DDAEMON_MAJOR_VERSION=$(DAEMON_MAJOR_VERSION)
-CXXFLAGS += -DDAEMON_MINOR_VERSION=$(DAEMON_MINOR_VERSION)
-CXXFLAGS += -DDAEMON_PATCH_VERSION=$(DAEMON_PATCH_VERSION)
-CXXFLAGS += -DDAEMON_PID_FILE_NAME='"$(DAEMON_PID_FILE_NAME)"'
-CXXFLAGS += -DDAEMON_LOG_FILE_NAME='"$(DAEMON_LOG_FILE_NAME)"'
-CXXFLAGS += -DDAEMON_NO_CHDIR=$(DAEMON_NO_CHDIR)
-CXXFLAGS += -DDAEMON_NO_CLOSE_STDIO=$(DAEMON_NO_CLOSE_STDIO)
-
-CXXFLAGS += -I$(COMMON_DIR)
-CXXFLAGS += -I$(GENERATED_DIR)
-CXXFLAGS += -I$(GSOAP_DIR) -I$(GSOAP_CUSTOM_DIR) -I$(GSOAP_PLUGIN_DIR) -I$(GSOAP_IMPORT_DIR)
-CXXFLAGS += -std=c++11 -O2 -Wall -pipe
-CXXFLAGS += -DWITH_NO_C_LOCALE
-
-CXX ?= g++
-
-
-
-
-
-# To build a daemon with WS-Security support,
-# call make with the WSSE_ON=1 parameter
-# example:
-# make WSSE_ON=1 all
-ifdef WSSE_ON
-CXXFLAGS += -DWITH_OPENSSL -I$(OPENSSL_DIR)/include
-LDFLAGS += openssl/libssl.a openssl/libcrypto.a -ldl
-
-WSSE_SOURCES = $(GSOAP_PLUGIN_DIR)/wsseapi.c \
- $(GSOAP_PLUGIN_DIR)/mecevp.c \
- $(GSOAP_PLUGIN_DIR)/smdevp.c \
- $(GSOAP_PLUGIN_DIR)/wsaapi.c
-
-WSSE_IMPORT = echo '\#import "wsse.h" ' >> $@
-else
-GSOAP_CONFIGURE += --disable-ssl
-endif
-
-
-
-
-
-
-
-SOAP_SRC = $(GSOAP_DIR)/stdsoap2.cpp \
- $(GSOAP_DIR)/dom.cpp \
- $(GSOAP_CUSTOM_DIR)/duration.c
-
-
-
-# We can't use wildcard func, this files will be generated
-SOAP_SERVICE_SRC = $(GENERATED_DIR)/soapDeviceBindingService.cpp \
- $(GENERATED_DIR)/soapMediaBindingService.cpp \
- $(GENERATED_DIR)/soapPTZBindingService.cpp
-
-
-
-# Add your source files to the list.
-# Supported *.c *.cpp *.S files.
-# For other file types write a template rule for build, see below.
-SOURCES = $(COMMON_DIR)/daemon.c \
- $(COMMON_DIR)/$(DAEMON_NAME).cpp \
- $(COMMON_DIR)/eth_dev_param.cpp \
- $(COMMON_DIR)/ServiceContext.cpp \
- $(COMMON_DIR)/ServiceDevice.cpp \
- $(COMMON_DIR)/ServiceMedia.cpp \
- $(COMMON_DIR)/ServicePTZ.cpp \
- $(GENERATED_DIR)/soapC.cpp \
- $(SOAP_SRC) \
- $(SOAP_SERVICE_SRC) \
- $(WSSE_SOURCES)
-
-
-
-
-
-
-OBJECTS := $(patsubst %.c, %.o, $(SOURCES) )
-OBJECTS := $(patsubst %.cpp,%.o, $(OBJECTS) )
-OBJECTS := $(patsubst %.S, %.o, $(OBJECTS) )
-
-
-DEBUG_SUFFIX = debug
-
-DEBUG_OBJECTS := $(patsubst %.o, %_$(DEBUG_SUFFIX).o, $(OBJECTS) )
-
-
-
-
-WSDL_FILES = $(wildcard wsdl/*.wsdl wsdl/*.xsd)
-
-
-
-
-.PHONY: all
-all: debug release
-
-
-
-.PHONY: release
-release: CXXFLAGS := -s $(CXXFLAGS)
-release: $(DAEMON_NAME)
-
-
-
-.PHONY: debug
-debug: DAEMON_NO_CLOSE_STDIO = 1
-debug: CXXFLAGS := -DDEBUG -g $(CXXFLAGS)
-debug: $(DAEMON_NAME)_$(DEBUG_SUFFIX)
-
-
-
-# release
-$(DAEMON_NAME): .depend $(OBJECTS)
- $(call build_bin, $(OBJECTS))
-
-
-# debug
-$(DAEMON_NAME)_$(DEBUG_SUFFIX): .depend $(DEBUG_OBJECTS)
- $(call build_bin, $(DEBUG_OBJECTS))
-
-
-
-# Build release objects
-%.o: %.c
- $(build_object)
-
-
-%.o: %.cpp
- $(build_object)
-
-
-%.o: %.S
- $(build_object)
-
-
-
-# Build debug objects
-%_$(DEBUG_SUFFIX).o: %.c
- $(build_object)
-
-
-%_$(DEBUG_SUFFIX).o: %.cpp
- $(build_object)
-
-
-%_$(DEBUG_SUFFIX).o: %.S
- $(build_object)
-
-
-
-.PHONY: clean
-clean:
- -@rm -f $(DAEMON_NAME)
- -@rm -f $(DAEMON_NAME)_$(DEBUG_SUFFIX)
- -@rm -f $(OBJECTS)
- -@rm -f $(DEBUG_OBJECTS)
- -@rm -f .depend
- -@rm -f -d -R $(GENERATED_DIR)
- -@rm -f *.*~
-
-
-
-.PHONY: distclean
-distclean: clean
- -@rm -f -d -R SDK
- -@rm -f -d -R $(GSOAP_INSTALL_DIR)
- -@rm -f RECV.log SENT.log TEST.log
-
-
-
-
-.depend: $(GENERATED_DIR)/soapC.cpp
- -@rm -f .depend
- @echo "Generating dependencies..."
- @for src in $(SOURCES) ; do \
- echo " [depend] $$src" ; \
- $(CXX) $(CXXFLAGS) -MT ".depend $${src%.*}.o $${src%.*}_$(DEBUG_SUFFIX).o" -MM $$src >> .depend ; \
- done
-
-
-
-ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""
- include $(wildcard .depend)
-endif
-
-
-
-
-
-# ---- gSOAP ----
-
-$(GENERATED_DIR)/onvif.h:
- @$(build_openssl)
- @$(build_gsoap)
- @mkdir -p $(GENERATED_DIR)
- $(WSDL2H) -d -t ./wsdl/typemap.dat -o $@ $(WSDL_FILES)
- $(WSSE_IMPORT)
-
-
-
-$(GENERATED_DIR)/soapC.cpp: $(GENERATED_DIR)/onvif.h
- $(SOAPCPP2) -j -L -x -S -d $(GENERATED_DIR) -I$(GSOAP_DIR):$(GSOAP_IMPORT_DIR) $<
-
-
-
-# This targets is needed for parallel work of make
-$(OBJECTS) $(DEBUG_OBJECTS) $(SOAP_SRC) $(SOAP_SERVICE_SRC) $(WSSE_SOURCES): $(GENERATED_DIR)/soapC.cpp
-
-
-
-
-# Common commands
-BUILD_ECHO = echo "\n [build] $@:"
-
-
-define build_object
- @$(BUILD_ECHO)
- $(CXX) -c $< -o $@ $(CXXFLAGS)
-endef
-
-
-
-define build_bin
- @$(BUILD_ECHO)
- $(CXX) $1 -o $@ $(CXXFLAGS) $(LDFLAGS)
- @echo "\n---- Compiled $@ ver $(DAEMON_MAJOR_VERSION).$(DAEMON_MINOR_VERSION).$(DAEMON_PATCH_VERSION) ----\n"
-endef
-
-
-
-define build_gsoap
-
- # get archive
- if [ ! -f SDK/gsoap.zip ]; then \
- mkdir -p SDK; \
- wget -O ./SDK/gsoap.zip.tmp "http://dl.t2-project.org/mirror/trunk/g/gsoap_$(GSOAP_VERSION).zip" || \
- wget -O ./SDK/gsoap.zip.tmp "https://sourceforge.net/projects/gsoap2/files/gsoap-2.8/gsoap_$(GSOAP_VERSION).zip/download" || \
- wget -O ./SDK/gsoap.zip.tmp "https://sourceforge.net/projects/gsoap2/files/oldreleases/gsoap_$(GSOAP_VERSION).zip/download" || \
- wget -O ./SDK/gsoap.zip.tmp "https://master.dl.sourceforge.net/project/gsoap2/oldreleases/gsoap_$(GSOAP_VERSION).zip" && \
- mv ./SDK/gsoap.zip.tmp ./SDK/gsoap.zip; \
- fi
-
- # unzip
- if [ ! -f $(GSOAP_INSTALL_DIR)/README.txt ]; then \
- unzip ./SDK/gsoap.zip; \
- fi
-
- # build
- if [ ! -f $(SOAPCPP2) ] || [ ! -f $(WSDL2H) ]; then \
- cd $(GSOAP_INSTALL_DIR); \
- unset CXX && ./configure $(GSOAP_CONFIGURE) && \
- make -j1; \
- cd ..;\
- fi
-endef
-
-
-
-define build_openssl
-
- # get archive
- if [ ! -f SDK/openssl.tar.gz ]; then \
- mkdir -p SDK; \
- wget -O ./SDK/openssl.tar.gz.tmp "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz" && \
- mv ./SDK/openssl.tar.gz.tmp ./SDK/openssl.tar.gz; \
- fi
-
- # untar
- if [ ! -f openssl-1.0.2u/README ]; then \
- tar zxvf ./SDK/openssl.tar.gz; \
- ln -s openssl-1.0.2u openssl; \
- fi
-
- # build
- if [ ! -f openssl/libcrypto.so.1.0.0 ] || [ ! -f openssl/libssl.so.1.0.0 ]; then \
- cd openssl; \
- CC=arm-hisiv300-linux-uclibcgnueabi-gcc ./Configure linux-generic32 && \
- CC=arm-hisiv300-linux-uclibcgnueabi-gcc make; \
- cd ..;\
- fi
-endef
-
-
-
-.PHONY: help
-help:
- @echo "make [command]"
- @echo "command is:"
- @echo " all - build daemon in release and debug mode"
- @echo " debug - build in debug mode (#define DEBUG 1)"
- @echo " release - build in release mode (strip)"
- @echo " clean - remove all generated files"
- @echo " distclean - clean + remove all SDK files"
- @echo " help - this help"
-
diff --git a/src/onvif_srvd/onvif_srvd/README.md b/src/onvif_srvd/onvif_srvd/README.md
deleted file mode 100644
index 5302f2f..0000000
--- a/src/onvif_srvd/onvif_srvd/README.md
+++ /dev/null
@@ -1,121 +0,0 @@
-# ONVIF Device(IP camera) Service server
-
-
-## Description
-
-**onvif_srvd** - ONVIF Device(IP camera) Service server (Linux daemon)
-
-This server (Service) has a minimal implementation. Use this server as a template for writing your ONVIF service for an IP camera.
-
-
-ONVIF official website: [https://www.onvif.org](https://www.onvif.org)
-and their [github presence](https://github.com/onvif/).
-
-The web services data binding is generated using [gSOAP](https://www.genivia.com)
-
-
-
-
-## Build
-
-#### Dependencies
-Most Linux systems for building this project require the following packages to be installed: `make m4 flex bison byacc yacc`
-
-If you need support for encryption and WS-Security then you also need: `openssl zlib libcrypto`
-
-
-For example, on ubuntu 20.04, you needed to install:
-```console
-sudo apt install flex bison byacc make m4
-
-#for support encryption and WS-Security
-sudo apt install openssl libssl-dev libcrypto++6
-```
-
-To start build you have to choose your compiler (or toolchain) in the [Makefile](./Makefile) (see variable `$CXX`).
-
-For build use make for [Makefile](./Makefile):
-```console
-make target
-```
-
-target is:
- - `all` - build daemon in release and debug mode
- - `debug` - build in debug mode (#define DEBUG 1)
- - `release` - build in release mode (strip)
- - `clean` - remove all generated files
- - `distclean` - clean + remove all SDK files
- - `help` - show list support targets
-
-
-> **Note**: If you need WS-Security support, you need to call make with the `WSSE_ON=1` parameter.
-
-Show how enable support WS-Security:
-```console
-make WSSE_ON=1
-```
-
-If before make was done without WS-Security support, **must cleanup** (We need to rebuild the gsoap with `openssl` support):
-```console
-make distclean
-```
-
-
-
-## Usage
-
-To start the daemon, you have to give him the parameters that are needed for work:
-
-```console
-./onvif_srvd --ifs eth0 --scope onvif://www.onvif.org/name/TestDev --scope onvif://www.onvif.org/Profile/S --name RTSP --width 800 --height 600 --url rtsp://%s:554/unicast --type JPEG"
-```
-The `--url` option can contain or static IP or dynamic (template parameter `%s`) that will be replaced with the IP address of the interface, see the option `--ifs`.
-
-For more details see help:
-```console
-./onvif_srvd --help
-```
-
-Or you can use [S90onvif_srvd](./start_scripts/S90onvif_srvd) script to start the daemon (for old init.d script style):
-```console
-./start_scripts/S90onvif_srvd start
-```
-
-If You use systemd see:
-[onvif_srvd.service](./start_scripts/onvif_srvd.service)
-
-
-
-## Testing
-
-For testing daemon you need client application.
-
-
-#### Linux:
-1. [ONVIF Device Tool (GUI)](http://lingodigit.com/onvif_nvc.html)
-
-> **Note**:
-> 1. ONVIF Device Tool at me this application falls when show the first frame of RTSP. Sad :(.
-> 2. This application requires support for **WS-Security**
-> 3. This application requires support for [**WS-Discovery**](https://github.com/KoynovStas/wsdd)
-
-
-
-2. [gsoap-onvif](https://github.com/tonyhu/gsoap-onvif)
-
-Only the console client, useful for debugging.
-
-Usage:
-```console
-./ipconvif 127.0.0.1:1000
-```
-
-
-#### Windows:
-1. [ONVIF Device Manager](https://sourceforge.net/projects/onvifdm/)
-
-
-
-## License
-
-[BSD-3-Clause](./LICENSE).
diff --git a/src/onvif_srvd/onvif_srvd/src/ServiceContext.cpp b/src/onvif_srvd/onvif_srvd/src/ServiceContext.cpp
deleted file mode 100644
index 76120ab..0000000
--- a/src/onvif_srvd/onvif_srvd/src/ServiceContext.cpp
+++ /dev/null
@@ -1,500 +0,0 @@
-#include
-
-#include
-
-#include "ServiceContext.h"
-#include "stools.h"
-
-
-
-
-
-ServiceContext::ServiceContext():
- port ( 1000 ),
- user ( "admin" ),
- password ( "admin" ),
-
-
- //Device Information
- manufacturer ( "Manufacturer" ),
- model ( "Model" ),
- firmware_version ( "FirmwareVersion"),
- serial_number ( "SerialNumber" ),
- hardware_id ( "HardwareId" )
-{
-}
-
-
-
-std::string ServiceContext::getServerIpFromClientIp(uint32_t client_ip) const
-{
- char server_ip[INET_ADDRSTRLEN];
-
-
- if (eth_ifs.size() == 1)
- {
- eth_ifs[0].get_ip(server_ip);
- return server_ip;
- }
-
- for(size_t i = 0; i < eth_ifs.size(); ++i)
- {
- uint32_t if_ip, if_mask;
- eth_ifs[i].get_ip(&if_ip);
- eth_ifs[i].get_mask(&if_mask);
-
- if( (if_ip & if_mask) == (client_ip & if_mask) )
- {
- eth_ifs[i].get_ip(server_ip);
- return server_ip;
- }
- }
-
-
- return "127.0.0.1"; //localhost
-}
-
-
-
-std::string ServiceContext::getXAddr(soap *soap) const
-{
- std::ostringstream os;
-
- os << "http://" << getServerIpFromClientIp(htonl(soap->ip)) << ":" << port;
-
- return os.str();
-}
-
-
-
-bool ServiceContext::add_profile(const StreamProfile &profile)
-{
- if( !profile.is_valid() )
- {
- str_err = "profile has unset parameters";
- return false;
- }
-
-
- if( profiles.find(profile.get_name()) != profiles.end() )
- {
- str_err = "profile: " + profile.get_name() + " already exist";
- return false;
- }
-
-
- profiles[profile.get_name()] = profile;
- return true;
-}
-
-
-
-std::string ServiceContext::get_stream_uri(const std::string &profile_url, uint32_t client_ip) const
-{
- std::string uri(profile_url);
- std::string template_str("%s");
-
-
- auto it = uri.find(template_str, 0);
-
- if( it != std::string::npos )
- uri.replace(it, template_str.size(), getServerIpFromClientIp(client_ip));
-
-
- return uri;
-}
-
-
-
-std::string ServiceContext::get_snapshot_uri(const std::string &profile_url, uint32_t client_ip) const
-{
- std::string uri(profile_url);
- std::string template_str("%s");
-
-
- auto it = uri.find(template_str, 0);
-
- if( it != std::string::npos )
- uri.replace(it, template_str.size(), getServerIpFromClientIp(client_ip));
-
-
- return uri;
-}
-
-
-
-tds__DeviceServiceCapabilities *ServiceContext::getDeviceServiceCapabilities(soap *soap)
-{
- tds__DeviceServiceCapabilities *capabilities = soap_new_tds__DeviceServiceCapabilities(soap);
-
- capabilities->Network = soap_new_tds__NetworkCapabilities(soap);
-
- capabilities->Network->IPFilter = soap_new_ptr(soap, false);
- capabilities->Network->ZeroConfiguration = soap_new_ptr(soap, false);
- capabilities->Network->IPVersion6 = soap_new_ptr(soap, false);
- capabilities->Network->DynDNS = soap_new_ptr(soap, false);
- capabilities->Network->Dot11Configuration = soap_new_ptr(soap, false);
- capabilities->Network->Dot1XConfigurations = soap_new_ptr(soap, 0);
- capabilities->Network->HostnameFromDHCP = soap_new_ptr(soap, false);
- capabilities->Network->NTP = soap_new_ptr(soap, 0);
- capabilities->Network->DHCPv6 = soap_new_ptr(soap, false);
-
-
- capabilities->Security = soap_new_tds__SecurityCapabilities(soap);
-
- capabilities->Security->TLS1_x002e0 = soap_new_ptr(soap, false);
- capabilities->Security->TLS1_x002e1 = soap_new_ptr(soap, false);
- capabilities->Security->TLS1_x002e2 = soap_new_ptr(soap, false);
- capabilities->Security->OnboardKeyGeneration = soap_new_ptr(soap, false);
- capabilities->Security->AccessPolicyConfig = soap_new_ptr(soap, false);
- capabilities->Security->DefaultAccessPolicy = soap_new_ptr(soap, false);
- capabilities->Security->Dot1X = soap_new_ptr(soap, false);
- capabilities->Security->RemoteUserHandling = soap_new_ptr(soap, false);
- capabilities->Security->X_x002e509Token = soap_new_ptr(soap, false);
- capabilities->Security->SAMLToken = soap_new_ptr(soap, false);
- capabilities->Security->KerberosToken = soap_new_ptr(soap, false);
- capabilities->Security->UsernameToken = soap_new_ptr(soap, false);
- capabilities->Security->HttpDigest = soap_new_ptr(soap, false);
- capabilities->Security->RELToken = soap_new_ptr(soap, false);
- capabilities->Security->MaxUsers = soap_new_ptr(soap, 0);
- capabilities->Security->MaxUserNameLength = soap_new_ptr(soap, 0);
- capabilities->Security->MaxPasswordLength = soap_new_ptr(soap, 0);
-
-
- capabilities->System = soap_new_tds__SystemCapabilities(soap);
-
- capabilities->System->DiscoveryResolve = soap_new_ptr(soap, true);
- capabilities->System->DiscoveryBye = soap_new_ptr(soap, true);
- capabilities->System->RemoteDiscovery = soap_new_ptr(soap, true);
- capabilities->System->SystemBackup = soap_new_ptr(soap, false);
- capabilities->System->SystemLogging = soap_new_ptr(soap, false);
- capabilities->System->FirmwareUpgrade = soap_new_ptr(soap, false);
- capabilities->System->HttpFirmwareUpgrade = soap_new_ptr(soap, false);
- capabilities->System->HttpSystemBackup = soap_new_ptr(soap, false);
- capabilities->System->HttpSystemLogging = soap_new_ptr(soap, false);
- capabilities->System->HttpSupportInformation = soap_new_ptr(soap, false);
- capabilities->System->StorageConfiguration = soap_new_ptr(soap, false);
-
-
- return capabilities;
-}
-
-
-
-trt__Capabilities *ServiceContext::getMediaServiceCapabilities(soap *soap)
-{
- trt__Capabilities *capabilities = soap_new_trt__Capabilities(soap);
-
- auto profiles = this->get_profiles();
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it ) {
- if (( !it->second.get_snapurl().empty() ) && ( capabilities->SnapshotUri == NULL )) {
- capabilities->SnapshotUri = soap_new_ptr(soap, true);
- }
- }
-
- capabilities->ProfileCapabilities = soap_new_trt__ProfileCapabilities(soap);
- capabilities->ProfileCapabilities->MaximumNumberOfProfiles = soap_new_ptr(soap, 1);
-
- capabilities->StreamingCapabilities = soap_new_trt__StreamingCapabilities(soap);
- capabilities->StreamingCapabilities->RTPMulticast = soap_new_ptr(soap, false);
- capabilities->StreamingCapabilities->RTP_USCORETCP = soap_new_ptr(soap, false);
- capabilities->StreamingCapabilities->RTP_USCORERTSP_USCORETCP = soap_new_ptr(soap, true);
-
-
- return capabilities;
-}
-
-
-
-tptz__Capabilities *ServiceContext::getPTZServiceCapabilities(soap *soap)
-{
- tptz__Capabilities *capabilities = soap_new_tptz__Capabilities(soap);
-
- return capabilities;
-}
-
-
-
-
-// ------------------------------- StreamProfile -------------------------------
-
-
-
-
-tt__VideoSourceConfiguration* StreamProfile::get_video_src_cnf(struct soap *soap) const
-{
- tt__VideoSourceConfiguration* src_cfg = soap_new_tt__VideoSourceConfiguration(soap);
-
- src_cfg->token = name;
- src_cfg->SourceToken = name;
- src_cfg->Bounds = soap_new_req_tt__IntRectangle(soap, 0, 0, width, height);
-
- return src_cfg;
-}
-
-
-
-tt__VideoEncoderConfiguration* StreamProfile::get_video_enc_cfg(struct soap *soap) const
-{
- tt__VideoEncoderConfiguration* enc_cfg = soap_new_tt__VideoEncoderConfiguration(soap);
-
- enc_cfg->Name = name;
- enc_cfg->token = name;
- enc_cfg->Resolution = soap_new_req_tt__VideoResolution(soap, width, height);
- enc_cfg->RateControl = soap_new_req_tt__VideoRateControl(soap, 0, 0, 0);
- enc_cfg->Multicast = soap_new_tt__MulticastConfiguration(soap);
- enc_cfg->Multicast->Address = soap_new_tt__IPAddress(soap);
- enc_cfg->Encoding = static_cast(type);
-// enc_cfg->GuaranteedFrameRate= soap_new_ptr(soap, true);
- enc_cfg->H264 = soap_new_tt__H264Configuration(soap);
- enc_cfg->H264->GovLength = 40;
- enc_cfg->H264->H264Profile = tt__H264Profile__Main;
-
- return enc_cfg;
-}
-
-
-
-tt__PTZConfiguration* StreamProfile::get_ptz_cfg(struct soap *soap) const
-{
- tt__PTZConfiguration* ptz_cfg = soap_new_tt__PTZConfiguration(soap);
-
- ptz_cfg->Name = "PTZ";
- ptz_cfg->token = "PTZToken";
- ptz_cfg->NodeToken = "PTZNodeToken";
-
- ptz_cfg->DefaultAbsolutePantTiltPositionSpace = soap_new_std__string(soap);
- *ptz_cfg->DefaultAbsolutePantTiltPositionSpace = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace";
- ptz_cfg->DefaultAbsoluteZoomPositionSpace = soap_new_std__string(soap);
- *ptz_cfg->DefaultAbsoluteZoomPositionSpace = "http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace";
- ptz_cfg->DefaultRelativePanTiltTranslationSpace = soap_new_std__string(soap);
- *ptz_cfg->DefaultRelativePanTiltTranslationSpace = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace";
- ptz_cfg->DefaultRelativeZoomTranslationSpace = soap_new_std__string(soap);
- *ptz_cfg->DefaultRelativeZoomTranslationSpace = "http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace";
- ptz_cfg->DefaultContinuousPanTiltVelocitySpace = soap_new_std__string(soap);
- *ptz_cfg->DefaultContinuousPanTiltVelocitySpace = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace";
- ptz_cfg->DefaultContinuousZoomVelocitySpace = soap_new_std__string(soap);
- *ptz_cfg->DefaultContinuousZoomVelocitySpace = "http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace";
-
- ptz_cfg->DefaultPTZSpeed = soap_new_tt__PTZSpeed(soap);
- ptz_cfg->DefaultPTZSpeed->PanTilt = soap_new_req_tt__Vector2D(soap, 0.1f, 0.1f);
- ptz_cfg->DefaultPTZSpeed->Zoom = soap_new_req_tt__Vector1D(soap, 1.0f);
-
- ptz_cfg->DefaultPTZTimeout = soap_new_ptr(soap, (LONG64)1000);
-
- ptz_cfg->PanTiltLimits = soap_new_tt__PanTiltLimits(soap);
- ptz_cfg->PanTiltLimits->Range = soap_new_tt__Space2DDescription(soap);
- ptz_cfg->PanTiltLimits->Range->URI = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace";
- ptz_cfg->PanTiltLimits->Range->XRange = soap_new_req_tt__FloatRange(soap, -INFINITY, INFINITY);
- ptz_cfg->PanTiltLimits->Range->YRange = soap_new_req_tt__FloatRange(soap, -INFINITY, INFINITY);
-
- ptz_cfg->ZoomLimits = soap_new_tt__ZoomLimits(soap);
- ptz_cfg->ZoomLimits->Range = soap_new_tt__Space1DDescription(soap);
- ptz_cfg->ZoomLimits->Range->URI = "http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace";
- ptz_cfg->ZoomLimits->Range->XRange = soap_new_req_tt__FloatRange(soap, -INFINITY, INFINITY);
-
- return ptz_cfg;
-}
-
-
-
-tt__Profile* StreamProfile::get_profile(struct soap *soap) const
-{
- ServiceContext* ctx = (ServiceContext*)soap->user;
-
- tt__Profile* profile = soap_new_tt__Profile(soap);
-
- profile->Name = name;
- profile->token = name;
- profile->fixed = soap_new_ptr(soap, true);
-
- profile->VideoSourceConfiguration = get_video_src_cnf(soap);
- profile->VideoEncoderConfiguration = get_video_enc_cfg(soap);
- if (ctx->get_ptz_node()->enable) {
- profile->PTZConfiguration = get_ptz_cfg(soap);
- }
-
- return profile;
-}
-
-
-
-tt__VideoSource* StreamProfile::get_video_src(soap *soap) const
-{
- tt__VideoSource* video_src = soap_new_tt__VideoSource(soap);
-
- video_src->token = name;
- video_src->Resolution = soap_new_req_tt__VideoResolution(soap, width, height);
- video_src->Imaging = soap_new_tt__ImagingSettings(soap);
-
- return video_src;
-}
-
-
-
-bool StreamProfile::set_name(const char *new_val)
-{
- if(!new_val)
- {
- str_err = "Name is empty";
- return false;
- }
-
-
- name = new_val;
- return true;
-}
-
-
-
-bool StreamProfile::set_width(const char *new_val)
-{
-
- std::istringstream ss(new_val);
- int tmp_val;
- ss >> tmp_val;
-
-
- if( (tmp_val < 100) || (tmp_val >= 10000) )
- {
- str_err = "width is bad, correct range: 100-10000";
- return false;
- }
-
-
- width = tmp_val;
- return true;
-}
-
-
-
-bool StreamProfile::set_height(const char *new_val)
-{
- std::istringstream ss(new_val);
- int tmp_val;
- ss >> tmp_val;
-
-
- if( (tmp_val < 100) || (tmp_val >= 10000) )
- {
- str_err = "height is bad, correct range: 100-10000";
- return false;
- }
-
-
- height = tmp_val;
- return true;
-}
-
-
-
-bool StreamProfile::set_url(const char *new_val)
-{
- if(!new_val)
- {
- str_err = "URL is empty";
- return false;
- }
-
-
- url = new_val;
- return true;
-}
-
-
-
-bool StreamProfile::set_snapurl(const char *new_val)
-{
- if(!new_val)
- {
- str_err = "URL is empty";
- return false;
- }
-
-
- snapurl = new_val;
- return true;
-}
-
-
-
-bool StreamProfile::set_type(const char *new_val)
-{
- std::string new_type(new_val);
-
-
- if( new_type == "JPEG" )
- type = tt__VideoEncoding__JPEG;
- else if( new_type == "MPEG4" )
- type = tt__VideoEncoding__MPEG4;
- else if( new_type == "H264" )
- type = tt__VideoEncoding__H264;
- else
- {
- str_err = "type dont support";
- return false;
- }
-
-
- return true;
-}
-
-
-
-void StreamProfile::clear()
-{
- name.clear();
- url.clear();
- snapurl.clear();
-
- width = -1;
- height = -1;
- type = -1;
-}
-
-
-
-bool StreamProfile::is_valid() const
-{
- return ( !name.empty() &&
- !url.empty() &&
- (width != -1) &&
- (height != -1) &&
- (type != -1)
- );
-}
-
-
-
-
-// ------------------------------- PTZNode -------------------------------
-
-
-
-
-void PTZNode::clear()
-{
- enable = false;
-
- move_left.clear();
- move_right.clear();
- move_up.clear();
- move_down.clear();
- move_stop.clear();
- move_preset.clear();
-}
-
-
-
-bool PTZNode::set_str_value(const char* new_val, std::string& value)
-{
- if(!new_val)
- {
- str_err = "Process is empty";
- return false;
- }
-
-
- value = new_val;
- return true;
-}
diff --git a/src/onvif_srvd/onvif_srvd/src/ServiceContext.h b/src/onvif_srvd/onvif_srvd/src/ServiceContext.h
deleted file mode 100644
index 64daa64..0000000
--- a/src/onvif_srvd/onvif_srvd/src/ServiceContext.h
+++ /dev/null
@@ -1,193 +0,0 @@
-#ifndef SERVICECONTEXT_H
-#define SERVICECONTEXT_H
-
-
-#include
-#include
-#include
-
-#include "soapH.h"
-#include "eth_dev_param.h"
-
-
-
-
-
-class StreamProfile
-{
- public:
-
- StreamProfile() { clear(); }
-
- std::string get_name (void) const { return name; }
- int get_width (void) const { return width; }
- int get_height (void) const { return height; }
- std::string get_url (void) const { return url; }
- std::string get_snapurl(void) const { return snapurl;}
- int get_type (void) const { return type; }
-
-
-
- tt__Profile* get_profile(struct soap *soap) const;
- tt__VideoSource* get_video_src(struct soap *soap) const;
-
- tt__VideoSourceConfiguration* get_video_src_cnf(struct soap *soap) const;
- tt__VideoEncoderConfiguration* get_video_enc_cfg(struct soap *soap) const;
- tt__PTZConfiguration* get_ptz_cfg(struct soap *soap) const;
-
-
-
- //methods for parsing opt from cmd
- bool set_name (const char *new_val);
- bool set_width (const char *new_val);
- bool set_height (const char *new_val);
- bool set_url (const char *new_val);
- bool set_snapurl(const char *new_val);
- bool set_type (const char *new_val);
-
-
- std::string get_str_err() const { return str_err; }
- const char* get_cstr_err() const { return str_err.c_str(); }
-
- void clear(void);
- bool is_valid(void) const;
-
-
- private:
-
- std::string name;
- int width;
- int height;
- std::string url;
- std::string snapurl;
- int type;
-
-
- std::string str_err;
-};
-
-
-
-
-
-class PTZNode
-{
- public:
-
- PTZNode() { clear(); }
-
- bool enable;
-
- std::string get_move_left (void) const { return move_left; }
- std::string get_move_right (void) const { return move_right; }
- std::string get_move_up (void) const { return move_up; }
- std::string get_move_down (void) const { return move_down; }
- std::string get_move_stop (void) const { return move_stop; }
- std::string get_move_preset (void) const { return move_preset; }
-
-
-
- //methods for parsing opt from cmd
- bool set_move_left (const char *new_val) { return set_str_value(new_val, move_left ); }
- bool set_move_right (const char *new_val) { return set_str_value(new_val, move_right ); }
- bool set_move_up (const char *new_val) { return set_str_value(new_val, move_up ); }
- bool set_move_down (const char *new_val) { return set_str_value(new_val, move_down ); }
- bool set_move_stop (const char *new_val) { return set_str_value(new_val, move_stop ); }
- bool set_move_preset (const char *new_val) { return set_str_value(new_val, move_preset); }
-
-
- std::string get_str_err() const { return str_err; }
- const char* get_cstr_err() const { return str_err.c_str(); }
-
- void clear(void);
-
-
- private:
-
- std::string move_left;
- std::string move_right;
- std::string move_up;
- std::string move_down;
- std::string move_stop;
- std::string move_preset;
-
-
- std::string str_err;
-
- bool set_str_value(const char *new_val, std::string& value);
-};
-
-
-
-
-
-class ServiceContext
-{
- public:
-
- ServiceContext();
-
-
- int port;
- std::string user;
- std::string password;
-
-
- //Device Information
- std::string manufacturer;
- std::string model;
- std::string firmware_version;
- std::string serial_number;
- std::string hardware_id;
-
- std::vector scopes;
-
-
- std::vector eth_ifs; //ethernet interfaces
-
-
- std::string getServerIpFromClientIp(uint32_t client_ip) const;
- std::string getXAddr(struct soap* soap) const;
-
-
-
- std::string get_str_err() const { return str_err; }
- const char* get_cstr_err()const { return str_err.c_str(); }
-
-
- bool add_profile(const StreamProfile& profile);
-
-
- std::string get_stream_uri(const std::string& profile_url, uint32_t client_ip) const;
- std::string get_snapshot_uri(const std::string& profile_url, uint32_t client_ip) const;
-
-
- const std::map &get_profiles(void) { return profiles; }
- PTZNode* get_ptz_node(void) { return &ptz_node; }
-
- // service capabilities
- tds__DeviceServiceCapabilities* getDeviceServiceCapabilities(struct soap* soap);
- trt__Capabilities* getMediaServiceCapabilities (struct soap* soap);
- tptz__Capabilities* getPTZServiceCapabilities (struct soap* soap);
-// timg__Capabilities* getImagingServiceCapabilities (struct soap* soap);
-// trc__Capabilities* getRecordingServiceCapabilities(struct soap* soap);
-// tse__Capabilities* getSearchServiceCapabilities (struct soap* soap);
-// trv__Capabilities* getReceiverServiceCapabilities (struct soap* soap);
-// trp__Capabilities* getReplayServiceCapabilities (struct soap* soap);
-// tev__Capabilities* getEventServiceCapabilities (struct soap* soap);
-// tls__Capabilities* getDisplayServiceCapabilities (struct soap* soap);
-// tmd__Capabilities* getDeviceIOServiceCapabilities (struct soap* soap);
-
- private:
-
- std::map profiles;
- PTZNode ptz_node;
-
- std::string str_err;
-};
-
-
-
-
-
-#endif // SERVICECONTEXT_H
diff --git a/src/onvif_srvd/onvif_srvd/src/ServiceDevice.cpp b/src/onvif_srvd/onvif_srvd/src/ServiceDevice.cpp
deleted file mode 100644
index c9b757f..0000000
--- a/src/onvif_srvd/onvif_srvd/src/ServiceDevice.cpp
+++ /dev/null
@@ -1,841 +0,0 @@
-/*
- --------------------------------------------------------------------------
- ServiceDevice.cpp
-
- Implementation of functions (methods) for the service:
- ONVIF devicemgmt.wsdl server side
------------------------------------------------------------------------------
-*/
-
-
-#include "soapDeviceBindingService.h"
-#include "ServiceContext.h"
-#include "smacros.h"
-#include "stools.h"
-
-
-
-
-
-int DeviceBindingService::GetServices(_tds__GetServices *tds__GetServices, _tds__GetServicesResponse &tds__GetServicesResponse)
-{
- DEBUG_MSG("Device: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- std::string XAddr = ctx->getXAddr(this->soap);
-
-
-
- //Device Service
- tds__GetServicesResponse.Service.push_back(soap_new_tds__Service(this->soap));
- tds__GetServicesResponse.Service.back()->Namespace = "http://www.onvif.org/ver10/device/wsdl";
- tds__GetServicesResponse.Service.back()->XAddr = XAddr;
- tds__GetServicesResponse.Service.back()->Version = soap_new_req_tt__OnvifVersion(this->soap, 2, 5);
- if( tds__GetServices->IncludeCapability )
- {
- tds__GetServicesResponse.Service.back()->Capabilities = soap_new__tds__Service_Capabilities(this->soap);
- tds__DeviceServiceCapabilities *capabilities = ctx->getDeviceServiceCapabilities(this->soap);
- tds__GetServicesResponse.Service.back()->Capabilities->__any = soap_dom_element(this->soap, NULL, "tds:Capabilities", capabilities, capabilities->soap_type());
- }
-
-
- tds__GetServicesResponse.Service.push_back(soap_new_tds__Service(this->soap));
- tds__GetServicesResponse.Service.back()->Namespace = "http://www.onvif.org/ver10/media/wsdl";
- tds__GetServicesResponse.Service.back()->XAddr = XAddr;
- tds__GetServicesResponse.Service.back()->Version = soap_new_req_tt__OnvifVersion(this->soap, 2, 6);
- if (tds__GetServices->IncludeCapability)
- {
- tds__GetServicesResponse.Service.back()->Capabilities = soap_new__tds__Service_Capabilities(this->soap);
- trt__Capabilities *capabilities = ctx->getMediaServiceCapabilities(this->soap);
- tds__GetServicesResponse.Service.back()->Capabilities->__any = soap_dom_element(this->soap, NULL, "trt:Capabilities", capabilities, capabilities->soap_type());
- }
-
-
- if (ctx->get_ptz_node()->enable) {
- tds__GetServicesResponse.Service.push_back(soap_new_tds__Service(this->soap));
- tds__GetServicesResponse.Service.back()->Namespace = "http://www.onvif.org/ver20/ptz/wsdl";
- tds__GetServicesResponse.Service.back()->XAddr = XAddr;
- tds__GetServicesResponse.Service.back()->Version = soap_new_req_tt__OnvifVersion(this->soap, 2, 4);
- if (tds__GetServices->IncludeCapability)
- {
- tds__GetServicesResponse.Service.back()->Capabilities = soap_new__tds__Service_Capabilities(this->soap);
- tptz__Capabilities *capabilities = ctx->getPTZServiceCapabilities(this->soap);
- tds__GetServicesResponse.Service.back()->Capabilities->__any = soap_dom_element(this->soap, NULL, "tptz:Capabilities", capabilities, capabilities->soap_type());
- }
- }
-
-
- return SOAP_OK;
-}
-
-
-
-int DeviceBindingService::GetServiceCapabilities(_tds__GetServiceCapabilities *tds__GetServiceCapabilities, _tds__GetServiceCapabilitiesResponse &tds__GetServiceCapabilitiesResponse)
-{
- UNUSED(tds__GetServiceCapabilities);
- DEBUG_MSG("Device: %s\n", __FUNCTION__);
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
- tds__GetServiceCapabilitiesResponse.Capabilities = ctx->getDeviceServiceCapabilities(this->soap);
-
- return SOAP_OK;
-}
-
-
-
-int DeviceBindingService::GetDeviceInformation(_tds__GetDeviceInformation *tds__GetDeviceInformation, _tds__GetDeviceInformationResponse &tds__GetDeviceInformationResponse)
-{
- UNUSED(tds__GetDeviceInformation);
- DEBUG_MSG("Device: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
- tds__GetDeviceInformationResponse.Manufacturer = ctx->manufacturer;
- tds__GetDeviceInformationResponse.Model = ctx->model;
- tds__GetDeviceInformationResponse.FirmwareVersion = ctx->firmware_version;
- tds__GetDeviceInformationResponse.SerialNumber = ctx->serial_number;
- tds__GetDeviceInformationResponse.HardwareId = ctx->hardware_id;
-
- return SOAP_OK;
-}
-
-
-
-int DeviceBindingService::SetSystemDateAndTime(_tds__SetSystemDateAndTime *tds__SetSystemDateAndTime, _tds__SetSystemDateAndTimeResponse &tds__SetSystemDateAndTimeResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetSystemDateAndTime, "Device");
-}
-
-
-
-int DeviceBindingService::GetSystemDateAndTime(_tds__GetSystemDateAndTime *tds__GetSystemDateAndTime, _tds__GetSystemDateAndTimeResponse &tds__GetSystemDateAndTimeResponse)
-{
- UNUSED(tds__GetSystemDateAndTime);
- DEBUG_MSG("Device: %s\n", __FUNCTION__);
-
-
- const time_t timestamp = time(NULL);
- struct tm *tm = gmtime(×tamp);
-
- tds__GetSystemDateAndTimeResponse.SystemDateAndTime = soap_new_tt__SystemDateTime(this->soap);
- tds__GetSystemDateAndTimeResponse.SystemDateAndTime->DateTimeType = tt__SetDateTimeType__Manual;
- tds__GetSystemDateAndTimeResponse.SystemDateAndTime->DaylightSavings = tm->tm_isdst;
- tds__GetSystemDateAndTimeResponse.SystemDateAndTime->TimeZone = soap_new_tt__TimeZone(this->soap);
- tds__GetSystemDateAndTimeResponse.SystemDateAndTime->TimeZone->TZ = "GMT0";
- tds__GetSystemDateAndTimeResponse.SystemDateAndTime->UTCDateTime = soap_new_tt__DateTime(this->soap);
- tds__GetSystemDateAndTimeResponse.SystemDateAndTime->UTCDateTime->Time = soap_new_req_tt__Time(this->soap, tm->tm_hour, tm->tm_min , tm->tm_sec );
- tds__GetSystemDateAndTimeResponse.SystemDateAndTime->UTCDateTime->Date = soap_new_req_tt__Date(this->soap, tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
-
- return SOAP_OK;
-}
-
-
-
-int DeviceBindingService::SetSystemFactoryDefault(_tds__SetSystemFactoryDefault *tds__SetSystemFactoryDefault, _tds__SetSystemFactoryDefaultResponse &tds__SetSystemFactoryDefaultResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetSystemFactoryDefault, "Device");
-}
-
-
-
-int DeviceBindingService::UpgradeSystemFirmware(_tds__UpgradeSystemFirmware *tds__UpgradeSystemFirmware, _tds__UpgradeSystemFirmwareResponse &tds__UpgradeSystemFirmwareResponse)
-{
- SOAP_EMPTY_HANDLER(tds__UpgradeSystemFirmware, "Device");
-}
-
-
-
-int DeviceBindingService::SystemReboot(_tds__SystemReboot *tds__SystemReboot, _tds__SystemRebootResponse &tds__SystemRebootResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SystemReboot, "Device");
-}
-
-
-
-int DeviceBindingService::RestoreSystem(_tds__RestoreSystem *tds__RestoreSystem, _tds__RestoreSystemResponse &tds__RestoreSystemResponse)
-{
- SOAP_EMPTY_HANDLER(tds__RestoreSystem, "Device");
-}
-
-
-
-int DeviceBindingService::GetSystemBackup(_tds__GetSystemBackup *tds__GetSystemBackup, _tds__GetSystemBackupResponse &tds__GetSystemBackupResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetSystemBackup, "Device");
-}
-
-
-
-int DeviceBindingService::GetSystemLog(_tds__GetSystemLog *tds__GetSystemLog, _tds__GetSystemLogResponse &tds__GetSystemLogResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetSystemLog, "Device");
-}
-
-
-
-int DeviceBindingService::GetSystemSupportInformation(_tds__GetSystemSupportInformation *tds__GetSystemSupportInformation, _tds__GetSystemSupportInformationResponse &tds__GetSystemSupportInformationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetSystemSupportInformation, "Device");
-}
-
-
-
-int DeviceBindingService::GetScopes(_tds__GetScopes *tds__GetScopes, _tds__GetScopesResponse &tds__GetScopesResponse)
-{
- UNUSED(tds__GetScopes);
- DEBUG_MSG("Device: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- for(size_t i = 0; i < ctx->scopes.size(); ++i)
- {
- tds__GetScopesResponse.Scopes.push_back(soap_new_req_tt__Scope(soap, tt__ScopeDefinition__Fixed, ctx->scopes[i]));
- }
-
- return SOAP_OK;
-}
-
-
-
-int DeviceBindingService::SetScopes(_tds__SetScopes *tds__SetScopes, _tds__SetScopesResponse &tds__SetScopesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetScopes, "Device");
-}
-
-
-
-int DeviceBindingService::AddScopes(_tds__AddScopes *tds__AddScopes, _tds__AddScopesResponse &tds__AddScopesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__AddScopes, "Device");
-}
-
-
-
-int DeviceBindingService::RemoveScopes(_tds__RemoveScopes *tds__RemoveScopes, _tds__RemoveScopesResponse &tds__RemoveScopesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__RemoveScopes, "Device");
-}
-
-
-
-int DeviceBindingService::GetDiscoveryMode(_tds__GetDiscoveryMode *tds__GetDiscoveryMode, _tds__GetDiscoveryModeResponse &tds__GetDiscoveryModeResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetDiscoveryMode, "Device");
-}
-
-
-
-int DeviceBindingService::SetDiscoveryMode(_tds__SetDiscoveryMode *tds__SetDiscoveryMode, _tds__SetDiscoveryModeResponse &tds__SetDiscoveryModeResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetDiscoveryMode, "Device");
-}
-
-
-
-int DeviceBindingService::GetRemoteDiscoveryMode(_tds__GetRemoteDiscoveryMode *tds__GetRemoteDiscoveryMode, _tds__GetRemoteDiscoveryModeResponse &tds__GetRemoteDiscoveryModeResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetRemoteDiscoveryMode, "Device");
-}
-
-
-
-int DeviceBindingService::SetRemoteDiscoveryMode(_tds__SetRemoteDiscoveryMode *tds__SetRemoteDiscoveryMode, _tds__SetRemoteDiscoveryModeResponse &tds__SetRemoteDiscoveryModeResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetRemoteDiscoveryMode, "Device");
-}
-
-
-
-int DeviceBindingService::GetDPAddresses(_tds__GetDPAddresses *tds__GetDPAddresses, _tds__GetDPAddressesResponse &tds__GetDPAddressesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetDPAddresses, "Device");
-}
-
-
-
-int DeviceBindingService::GetEndpointReference(_tds__GetEndpointReference *tds__GetEndpointReference, _tds__GetEndpointReferenceResponse &tds__GetEndpointReferenceResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetEndpointReference, "Device");
-}
-
-
-
-int DeviceBindingService::GetRemoteUser(_tds__GetRemoteUser *tds__GetRemoteUser, _tds__GetRemoteUserResponse &tds__GetRemoteUserResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetRemoteUser, "Device");
-}
-
-
-
-int DeviceBindingService::SetRemoteUser(_tds__SetRemoteUser *tds__SetRemoteUser, _tds__SetRemoteUserResponse &tds__SetRemoteUserResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetRemoteUser, "Device");
-}
-
-
-
-int DeviceBindingService::GetUsers(_tds__GetUsers *tds__GetUsers, _tds__GetUsersResponse &tds__GetUsersResponse)
-{
- UNUSED(tds__GetUsers);
- DEBUG_MSG("Device: %s\n", __FUNCTION__);
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- if( !ctx->user.empty() )
- {
- tds__GetUsersResponse.User.push_back(soap_new_tt__User(this->soap));
- tds__GetUsersResponse.User.back()->Username = ctx->user;
- }
-
- return SOAP_OK;
-}
-
-
-
-int DeviceBindingService::CreateUsers(_tds__CreateUsers *tds__CreateUsers, _tds__CreateUsersResponse &tds__CreateUsersResponse)
-{
- SOAP_EMPTY_HANDLER(tds__CreateUsers, "Device");
-}
-
-
-
-int DeviceBindingService::DeleteUsers(_tds__DeleteUsers *tds__DeleteUsers, _tds__DeleteUsersResponse &tds__DeleteUsersResponse)
-{
- SOAP_EMPTY_HANDLER(tds__DeleteUsers, "Device");
-}
-
-
-
-int DeviceBindingService::SetUser(_tds__SetUser *tds__SetUser, _tds__SetUserResponse &tds__SetUserResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetUser, "Device");
-}
-
-
-
-int DeviceBindingService::GetWsdlUrl(_tds__GetWsdlUrl *tds__GetWsdlUrl, _tds__GetWsdlUrlResponse &tds__GetWsdlUrlResponse)
-{
- UNUSED(tds__GetWsdlUrl);
- DEBUG_MSG("Device: %s\n", __FUNCTION__);
-
- std::string url = soap->endpoint;
- tds__GetWsdlUrlResponse.WsdlUrl = url.c_str();
-
- return SOAP_OK;
-}
-
-
-
-int DeviceBindingService::GetCapabilities(_tds__GetCapabilities *tds__GetCapabilities, _tds__GetCapabilitiesResponse &tds__GetCapabilitiesResponse)
-{
- DEBUG_MSG("Device: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- std::string XAddr = ctx->getXAddr(this->soap);
-
-
-
- tds__GetCapabilitiesResponse.Capabilities = soap_new_tt__Capabilities(this->soap);
- std::vector& categories(tds__GetCapabilities->Category);
- if(categories.empty())
- {
- categories.push_back(tt__CapabilityCategory__All);
- }
-
-
- for(tt__CapabilityCategory category : categories)
- {
- if(!tds__GetCapabilitiesResponse.Capabilities->Device && ( (category == tt__CapabilityCategory__All) || (category == tt__CapabilityCategory__Device) ) )
- {
- tds__GetCapabilitiesResponse.Capabilities->Device = soap_new_tt__DeviceCapabilities(this->soap);
- tds__GetCapabilitiesResponse.Capabilities->Device->XAddr = XAddr;
- tds__GetCapabilitiesResponse.Capabilities->Device->System = soap_new_tt__SystemCapabilities(this->soap);
- tds__GetCapabilitiesResponse.Capabilities->Device->System->SupportedVersions.push_back(soap_new_req_tt__OnvifVersion(this->soap, 2, 0));
- tds__GetCapabilitiesResponse.Capabilities->Device->Network = soap_new_tt__NetworkCapabilities(this->soap);
- tds__GetCapabilitiesResponse.Capabilities->Device->Security = soap_new_tt__SecurityCapabilities(this->soap);
- tds__GetCapabilitiesResponse.Capabilities->Device->IO = soap_new_tt__IOCapabilities(this->soap);
- }
-
-
- if(!tds__GetCapabilitiesResponse.Capabilities->Media && ( (category == tt__CapabilityCategory__All) || (category == tt__CapabilityCategory__Media) ) )
- {
- tds__GetCapabilitiesResponse.Capabilities->Media = soap_new_tt__MediaCapabilities(this->soap);
- tds__GetCapabilitiesResponse.Capabilities->Media->XAddr = XAddr;
- tds__GetCapabilitiesResponse.Capabilities->Media->StreamingCapabilities = soap_new_tt__RealTimeStreamingCapabilities(this->soap);
- tds__GetCapabilitiesResponse.Capabilities->Media->StreamingCapabilities->RTPMulticast = soap_new_ptr(soap, false);
- tds__GetCapabilitiesResponse.Capabilities->Media->StreamingCapabilities->RTP_USCORETCP = soap_new_ptr(soap, false);
- tds__GetCapabilitiesResponse.Capabilities->Media->StreamingCapabilities->RTP_USCORERTSP_USCORETCP = soap_new_ptr(soap, true);
- }
-
- if (ctx->get_ptz_node()->enable) {
- if(!tds__GetCapabilitiesResponse.Capabilities->PTZ && ( (category == tt__CapabilityCategory__All) || (category == tt__CapabilityCategory__PTZ) ) )
- {
- tds__GetCapabilitiesResponse.Capabilities->PTZ = soap_new_tt__PTZCapabilities(this->soap);
- tds__GetCapabilitiesResponse.Capabilities->PTZ->XAddr = XAddr;
- }
- }
-
- }
-
-
- return SOAP_OK;
-}
-
-
-
-int DeviceBindingService::SetDPAddresses(_tds__SetDPAddresses *tds__SetDPAddresses, _tds__SetDPAddressesResponse &tds__SetDPAddressesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetDPAddresses, "Device");
-}
-
-
-
-int DeviceBindingService::GetHostname(_tds__GetHostname *tds__GetHostname, _tds__GetHostnameResponse &tds__GetHostnameResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetHostname, "Device");
-}
-
-
-
-int DeviceBindingService::SetHostname(_tds__SetHostname *tds__SetHostname, _tds__SetHostnameResponse &tds__SetHostnameResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetHostname, "Device");
-}
-
-
-
-int DeviceBindingService::SetHostnameFromDHCP(_tds__SetHostnameFromDHCP *tds__SetHostnameFromDHCP, _tds__SetHostnameFromDHCPResponse &tds__SetHostnameFromDHCPResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetHostnameFromDHCP, "Device");
-}
-
-
-
-int DeviceBindingService::GetDNS(_tds__GetDNS *tds__GetDNS, _tds__GetDNSResponse &tds__GetDNSResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetDNS, "Device");
-}
-
-
-
-int DeviceBindingService::SetDNS(_tds__SetDNS *tds__SetDNS, _tds__SetDNSResponse &tds__SetDNSResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetDNS, "Device");
-}
-
-
-
-int DeviceBindingService::GetNTP(_tds__GetNTP *tds__GetNTP, _tds__GetNTPResponse &tds__GetNTPResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetNTP, "Device");
-}
-
-
-
-int DeviceBindingService::SetNTP(_tds__SetNTP *tds__SetNTP, _tds__SetNTPResponse &tds__SetNTPResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetNTP, "Device");
-}
-
-
-
-int DeviceBindingService::GetDynamicDNS(_tds__GetDynamicDNS *tds__GetDynamicDNS, _tds__GetDynamicDNSResponse &tds__GetDynamicDNSResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetDynamicDNS, "Device");
-}
-
-
-
-int DeviceBindingService::SetDynamicDNS(_tds__SetDynamicDNS *tds__SetDynamicDNS, _tds__SetDynamicDNSResponse &tds__SetDynamicDNSResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetDynamicDNS, "Device");
-}
-
-
-
-int DeviceBindingService::GetNetworkInterfaces(_tds__GetNetworkInterfaces *tds__GetNetworkInterfaces, _tds__GetNetworkInterfacesResponse &tds__GetNetworkInterfacesResponse)
-{
- UNUSED(tds__GetNetworkInterfaces);
- DEBUG_MSG("Device: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
-
- for(size_t i = 0; i < ctx->eth_ifs.size(); ++i)
- {
-
- char tmp_buf[20];
-
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.push_back(soap_new_tt__NetworkInterface(this->soap));
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->Enabled = true;
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->Info = soap_new_tt__NetworkInterfaceInfo(this->soap);
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->Info->Name = soap_new_std__string(this->soap);
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->Info->Name->assign(ctx->eth_ifs[i].dev_name());
-
- ctx->eth_ifs[i].get_hwaddr(tmp_buf);
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->Info->HwAddress = tmp_buf;
-
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->IPv4 = soap_new_tt__IPv4NetworkInterface(this->soap);
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->IPv4->Config = soap_new_tt__IPv4Configuration(this->soap);
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->IPv4->Config->Manual.push_back(soap_new_tt__PrefixedIPv4Address(this->soap));
-
- ctx->eth_ifs[i].get_ip(tmp_buf);
-
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->IPv4->Config->Manual.back()->Address = tmp_buf;
- tds__GetNetworkInterfacesResponse.NetworkInterfaces.back()->IPv4->Config->Manual.back()->PrefixLength = ctx->eth_ifs[i].get_mask_prefix();
-
- }
-
-
- return SOAP_OK;
-}
-
-
-
-int DeviceBindingService::SetNetworkInterfaces(_tds__SetNetworkInterfaces *tds__SetNetworkInterfaces, _tds__SetNetworkInterfacesResponse &tds__SetNetworkInterfacesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetNetworkInterfaces, "Device");
-}
-
-
-
-int DeviceBindingService::GetNetworkProtocols(_tds__GetNetworkProtocols *tds__GetNetworkProtocols, _tds__GetNetworkProtocolsResponse &tds__GetNetworkProtocolsResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetNetworkProtocols, "Device");
-}
-
-
-
-int DeviceBindingService::SetNetworkProtocols(_tds__SetNetworkProtocols *tds__SetNetworkProtocols, _tds__SetNetworkProtocolsResponse &tds__SetNetworkProtocolsResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetNetworkProtocols, "Device");
-}
-
-
-
-int DeviceBindingService::GetNetworkDefaultGateway(_tds__GetNetworkDefaultGateway *tds__GetNetworkDefaultGateway, _tds__GetNetworkDefaultGatewayResponse &tds__GetNetworkDefaultGatewayResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetNetworkDefaultGateway, "Device");
-}
-
-
-
-int DeviceBindingService::SetNetworkDefaultGateway(_tds__SetNetworkDefaultGateway *tds__SetNetworkDefaultGateway, _tds__SetNetworkDefaultGatewayResponse &tds__SetNetworkDefaultGatewayResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetNetworkDefaultGateway, "Device");
-}
-
-
-
-int DeviceBindingService::GetZeroConfiguration(_tds__GetZeroConfiguration *tds__GetZeroConfiguration, _tds__GetZeroConfigurationResponse &tds__GetZeroConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetZeroConfiguration, "Device");
-}
-
-
-
-int DeviceBindingService::SetZeroConfiguration(_tds__SetZeroConfiguration *tds__SetZeroConfiguration, _tds__SetZeroConfigurationResponse &tds__SetZeroConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetZeroConfiguration, "Device");
-}
-
-
-
-int DeviceBindingService::GetIPAddressFilter(_tds__GetIPAddressFilter *tds__GetIPAddressFilter, _tds__GetIPAddressFilterResponse &tds__GetIPAddressFilterResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetIPAddressFilter, "Device");
-}
-
-
-
-int DeviceBindingService::SetIPAddressFilter(_tds__SetIPAddressFilter *tds__SetIPAddressFilter, _tds__SetIPAddressFilterResponse &tds__SetIPAddressFilterResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetIPAddressFilter, "Device");
-}
-
-
-
-int DeviceBindingService::AddIPAddressFilter(_tds__AddIPAddressFilter *tds__AddIPAddressFilter, _tds__AddIPAddressFilterResponse &tds__AddIPAddressFilterResponse)
-{
- SOAP_EMPTY_HANDLER(tds__AddIPAddressFilter, "Device");
-}
-
-
-
-int DeviceBindingService::RemoveIPAddressFilter(_tds__RemoveIPAddressFilter *tds__RemoveIPAddressFilter, _tds__RemoveIPAddressFilterResponse &tds__RemoveIPAddressFilterResponse)
-{
- SOAP_EMPTY_HANDLER(tds__RemoveIPAddressFilter, "Device");
-}
-
-
-
-int DeviceBindingService::GetAccessPolicy(_tds__GetAccessPolicy *tds__GetAccessPolicy, _tds__GetAccessPolicyResponse &tds__GetAccessPolicyResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetAccessPolicy, "Device");
-}
-
-
-
-int DeviceBindingService::SetAccessPolicy(_tds__SetAccessPolicy *tds__SetAccessPolicy, _tds__SetAccessPolicyResponse &tds__SetAccessPolicyResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetAccessPolicy, "Device");
-}
-
-
-
-int DeviceBindingService::CreateCertificate(_tds__CreateCertificate *tds__CreateCertificate, _tds__CreateCertificateResponse &tds__CreateCertificateResponse)
-{
- SOAP_EMPTY_HANDLER(tds__CreateCertificate, "Device");
-}
-
-
-
-int DeviceBindingService::GetCertificates(_tds__GetCertificates *tds__GetCertificates, _tds__GetCertificatesResponse &tds__GetCertificatesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetCertificates, "Device");
-}
-
-
-
-int DeviceBindingService::GetCertificatesStatus(_tds__GetCertificatesStatus *tds__GetCertificatesStatus, _tds__GetCertificatesStatusResponse &tds__GetCertificatesStatusResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetCertificatesStatus, "Device");
-}
-
-
-
-int DeviceBindingService::SetCertificatesStatus(_tds__SetCertificatesStatus *tds__SetCertificatesStatus, _tds__SetCertificatesStatusResponse &tds__SetCertificatesStatusResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetCertificatesStatus, "Device");
-}
-
-
-
-int DeviceBindingService::DeleteCertificates(_tds__DeleteCertificates *tds__DeleteCertificates, _tds__DeleteCertificatesResponse &tds__DeleteCertificatesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__DeleteCertificates, "Device");
-}
-
-
-
-int DeviceBindingService::GetPkcs10Request(_tds__GetPkcs10Request *tds__GetPkcs10Request, _tds__GetPkcs10RequestResponse &tds__GetPkcs10RequestResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetPkcs10Request, "Device");
-}
-
-
-
-int DeviceBindingService::LoadCertificates(_tds__LoadCertificates *tds__LoadCertificates, _tds__LoadCertificatesResponse &tds__LoadCertificatesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__LoadCertificates, "Device");
-}
-
-
-
-int DeviceBindingService::GetClientCertificateMode(_tds__GetClientCertificateMode *tds__GetClientCertificateMode, _tds__GetClientCertificateModeResponse &tds__GetClientCertificateModeResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetClientCertificateMode, "Device");
-}
-
-
-
-int DeviceBindingService::SetClientCertificateMode(_tds__SetClientCertificateMode *tds__SetClientCertificateMode, _tds__SetClientCertificateModeResponse &tds__SetClientCertificateModeResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetClientCertificateMode, "Device");
-}
-
-
-
-int DeviceBindingService::GetRelayOutputs(_tds__GetRelayOutputs *tds__GetRelayOutputs, _tds__GetRelayOutputsResponse &tds__GetRelayOutputsResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetRelayOutputs, "Device");
-}
-
-
-
-int DeviceBindingService::SetRelayOutputSettings(_tds__SetRelayOutputSettings *tds__SetRelayOutputSettings, _tds__SetRelayOutputSettingsResponse &tds__SetRelayOutputSettingsResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetRelayOutputSettings, "Device");
-}
-
-
-
-int DeviceBindingService::SetRelayOutputState(_tds__SetRelayOutputState *tds__SetRelayOutputState, _tds__SetRelayOutputStateResponse &tds__SetRelayOutputStateResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetRelayOutputState, "Device");
-}
-
-
-
-int DeviceBindingService::SendAuxiliaryCommand(_tds__SendAuxiliaryCommand *tds__SendAuxiliaryCommand, _tds__SendAuxiliaryCommandResponse &tds__SendAuxiliaryCommandResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SendAuxiliaryCommand, "Device");
-}
-
-
-
-int DeviceBindingService::GetCACertificates(_tds__GetCACertificates *tds__GetCACertificates, _tds__GetCACertificatesResponse &tds__GetCACertificatesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetCACertificates, "Device");
-}
-
-
-
-int DeviceBindingService::LoadCertificateWithPrivateKey(_tds__LoadCertificateWithPrivateKey *tds__LoadCertificateWithPrivateKey, _tds__LoadCertificateWithPrivateKeyResponse &tds__LoadCertificateWithPrivateKeyResponse)
-{
- SOAP_EMPTY_HANDLER(tds__LoadCertificateWithPrivateKey, "Device");
-}
-
-
-
-int DeviceBindingService::GetCertificateInformation(_tds__GetCertificateInformation *tds__GetCertificateInformation, _tds__GetCertificateInformationResponse &tds__GetCertificateInformationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetCertificateInformation, "Device");
-}
-
-
-
-int DeviceBindingService::LoadCACertificates(_tds__LoadCACertificates *tds__LoadCACertificates, _tds__LoadCACertificatesResponse &tds__LoadCACertificatesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__LoadCACertificates, "Device");
-}
-
-
-
-int DeviceBindingService::CreateDot1XConfiguration(_tds__CreateDot1XConfiguration *tds__CreateDot1XConfiguration, _tds__CreateDot1XConfigurationResponse &tds__CreateDot1XConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__CreateDot1XConfiguration, "Device");
-}
-
-
-
-int DeviceBindingService::SetDot1XConfiguration(_tds__SetDot1XConfiguration *tds__SetDot1XConfiguration, _tds__SetDot1XConfigurationResponse &tds__SetDot1XConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetDot1XConfiguration, "Device");
-}
-
-
-
-int DeviceBindingService::GetDot1XConfiguration(_tds__GetDot1XConfiguration *tds__GetDot1XConfiguration, _tds__GetDot1XConfigurationResponse &tds__GetDot1XConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetDot1XConfiguration, "Device");
-}
-
-
-
-int DeviceBindingService::GetDot1XConfigurations(_tds__GetDot1XConfigurations *tds__GetDot1XConfigurations, _tds__GetDot1XConfigurationsResponse &tds__GetDot1XConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetDot1XConfigurations, "Device");
-}
-
-
-
-int DeviceBindingService::DeleteDot1XConfiguration(_tds__DeleteDot1XConfiguration *tds__DeleteDot1XConfiguration, _tds__DeleteDot1XConfigurationResponse &tds__DeleteDot1XConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__DeleteDot1XConfiguration, "Device");
-}
-
-
-
-int DeviceBindingService::GetDot11Capabilities(_tds__GetDot11Capabilities *tds__GetDot11Capabilities, _tds__GetDot11CapabilitiesResponse &tds__GetDot11CapabilitiesResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetDot11Capabilities, "Device");
-}
-
-
-
-int DeviceBindingService::GetDot11Status(_tds__GetDot11Status *tds__GetDot11Status, _tds__GetDot11StatusResponse &tds__GetDot11StatusResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetDot11Status, "Device");
-}
-
-
-
-int DeviceBindingService::ScanAvailableDot11Networks(_tds__ScanAvailableDot11Networks *tds__ScanAvailableDot11Networks, _tds__ScanAvailableDot11NetworksResponse &tds__ScanAvailableDot11NetworksResponse)
-{
- SOAP_EMPTY_HANDLER(tds__ScanAvailableDot11Networks, "Device");
-}
-
-
-
-int DeviceBindingService::GetSystemUris(_tds__GetSystemUris *tds__GetSystemUris, _tds__GetSystemUrisResponse &tds__GetSystemUrisResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetSystemUris, "Device");
-}
-
-
-
-int DeviceBindingService::StartFirmwareUpgrade(_tds__StartFirmwareUpgrade *tds__StartFirmwareUpgrade, _tds__StartFirmwareUpgradeResponse &tds__StartFirmwareUpgradeResponse)
-{
- SOAP_EMPTY_HANDLER(tds__StartFirmwareUpgrade, "Device");
-}
-
-
-
-int DeviceBindingService::StartSystemRestore(_tds__StartSystemRestore *tds__StartSystemRestore, _tds__StartSystemRestoreResponse &tds__StartSystemRestoreResponse)
-{
- SOAP_EMPTY_HANDLER(tds__StartSystemRestore, "Device");
-}
-
-
-
-int DeviceBindingService::GetStorageConfigurations(_tds__GetStorageConfigurations *tds__GetStorageConfigurations, _tds__GetStorageConfigurationsResponse &tds__GetStorageConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetStorageConfigurations, "Device");
-}
-
-
-
-int DeviceBindingService::CreateStorageConfiguration(_tds__CreateStorageConfiguration *tds__CreateStorageConfiguration, _tds__CreateStorageConfigurationResponse &tds__CreateStorageConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__CreateStorageConfiguration, "Device");
-}
-
-
-
-int DeviceBindingService::GetStorageConfiguration(_tds__GetStorageConfiguration *tds__GetStorageConfiguration, _tds__GetStorageConfigurationResponse &tds__GetStorageConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetStorageConfiguration, "Device");
-}
-
-
-
-
-int DeviceBindingService::SetStorageConfiguration(_tds__SetStorageConfiguration *tds__SetStorageConfiguration, _tds__SetStorageConfigurationResponse &tds__SetStorageConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetStorageConfiguration, "Device");
-}
-
-
-
-int DeviceBindingService::DeleteStorageConfiguration(_tds__DeleteStorageConfiguration *tds__DeleteStorageConfiguration, _tds__DeleteStorageConfigurationResponse &tds__DeleteStorageConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__DeleteStorageConfiguration, "Device");
-}
-
-
-
-int DeviceBindingService::GetGeoLocation(_tds__GetGeoLocation *tds__GetGeoLocation, _tds__GetGeoLocationResponse &tds__GetGeoLocationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__GetGeoLocation, "Device");
-}
-
-
-
-int DeviceBindingService::SetGeoLocation(_tds__SetGeoLocation *tds__SetGeoLocation, _tds__SetGeoLocationResponse &tds__SetGeoLocationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__SetGeoLocation, "Device");
-}
-
-
-
-int DeviceBindingService::DeleteGeoLocation(_tds__DeleteGeoLocation *tds__DeleteGeoLocation, _tds__DeleteGeoLocationResponse &tds__DeleteGeoLocationResponse)
-{
- SOAP_EMPTY_HANDLER(tds__DeleteGeoLocation, "Device");
-}
diff --git a/src/onvif_srvd/onvif_srvd/src/ServiceMedia.cpp b/src/onvif_srvd/onvif_srvd/src/ServiceMedia.cpp
deleted file mode 100644
index e9e8f37..0000000
--- a/src/onvif_srvd/onvif_srvd/src/ServiceMedia.cpp
+++ /dev/null
@@ -1,885 +0,0 @@
-/*
- --------------------------------------------------------------------------
- ServiceMedia.cpp
-
- Implementation of functions (methods) for the service:
- ONVIF media.wsdl server side
------------------------------------------------------------------------------
-*/
-
-
-#include "soapMediaBindingService.h"
-#include "ServiceContext.h"
-#include "smacros.h"
-#include "stools.h"
-
-
-
-
-
-int MediaBindingService::GetServiceCapabilities(_trt__GetServiceCapabilities *trt__GetServiceCapabilities, _trt__GetServiceCapabilitiesResponse &trt__GetServiceCapabilitiesResponse)
-{
- UNUSED(trt__GetServiceCapabilities);
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
- trt__GetServiceCapabilitiesResponse.Capabilities = ctx->getMediaServiceCapabilities(this->soap);
-
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::GetVideoSources(_trt__GetVideoSources *trt__GetVideoSources, _trt__GetVideoSourcesResponse &trt__GetVideoSourcesResponse)
-{
- UNUSED(trt__GetVideoSources);
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- auto profiles = ctx->get_profiles();
-
-
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- trt__GetVideoSourcesResponse.VideoSources.push_back(it->second.get_video_src(this->soap));
- }
-
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::GetAudioSources(_trt__GetAudioSources *trt__GetAudioSources, _trt__GetAudioSourcesResponse &trt__GetAudioSourcesResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioSources, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioOutputs(_trt__GetAudioOutputs *trt__GetAudioOutputs, _trt__GetAudioOutputsResponse &trt__GetAudioOutputsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioOutputs, "Media");
-}
-
-
-
-int MediaBindingService::CreateProfile(_trt__CreateProfile *trt__CreateProfile, _trt__CreateProfileResponse &trt__CreateProfileResponse)
-{
- SOAP_EMPTY_HANDLER(trt__CreateProfile, "Media");
-}
-
-
-
-int MediaBindingService::GetProfile(_trt__GetProfile *trt__GetProfile, _trt__GetProfileResponse &trt__GetProfileResponse)
-{
- DEBUG_MSG("Media: %s get profile:%s\n", __FUNCTION__, trt__GetProfile->ProfileToken.c_str());
-
- int ret = SOAP_FAULT;
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
- auto profiles = ctx->get_profiles();
- auto it = profiles.find(trt__GetProfile->ProfileToken);
-
-
- if( it != profiles.end() )
- {
- trt__GetProfileResponse.Profile = it->second.get_profile(this->soap);
- ret = SOAP_OK;
- }
-
-
- return ret;
-}
-
-
-
-int MediaBindingService::GetProfiles(_trt__GetProfiles *trt__GetProfiles, _trt__GetProfilesResponse &trt__GetProfilesResponse)
-{
- UNUSED(trt__GetProfiles);
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- auto profiles = ctx->get_profiles();
-
-
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- trt__GetProfilesResponse.Profiles.push_back(it->second.get_profile(this->soap));
- }
-
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::AddVideoEncoderConfiguration(_trt__AddVideoEncoderConfiguration *trt__AddVideoEncoderConfiguration, _trt__AddVideoEncoderConfigurationResponse &trt__AddVideoEncoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__AddVideoEncoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::AddVideoSourceConfiguration(_trt__AddVideoSourceConfiguration *trt__AddVideoSourceConfiguration, _trt__AddVideoSourceConfigurationResponse &trt__AddVideoSourceConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__AddVideoSourceConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::AddAudioEncoderConfiguration(_trt__AddAudioEncoderConfiguration *trt__AddAudioEncoderConfiguration, _trt__AddAudioEncoderConfigurationResponse &trt__AddAudioEncoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__AddAudioEncoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::AddAudioSourceConfiguration(_trt__AddAudioSourceConfiguration *trt__AddAudioSourceConfiguration, _trt__AddAudioSourceConfigurationResponse &trt__AddAudioSourceConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__AddAudioSourceConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::AddPTZConfiguration(_trt__AddPTZConfiguration *trt__AddPTZConfiguration, _trt__AddPTZConfigurationResponse &trt__AddPTZConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__AddPTZConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::AddVideoAnalyticsConfiguration(_trt__AddVideoAnalyticsConfiguration *trt__AddVideoAnalyticsConfiguration, _trt__AddVideoAnalyticsConfigurationResponse &trt__AddVideoAnalyticsConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__AddVideoAnalyticsConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::AddMetadataConfiguration(_trt__AddMetadataConfiguration *trt__AddMetadataConfiguration, _trt__AddMetadataConfigurationResponse &trt__AddMetadataConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__AddMetadataConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::AddAudioOutputConfiguration(_trt__AddAudioOutputConfiguration *trt__AddAudioOutputConfiguration, _trt__AddAudioOutputConfigurationResponse &trt__AddAudioOutputConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__AddAudioOutputConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::AddAudioDecoderConfiguration(_trt__AddAudioDecoderConfiguration *trt__AddAudioDecoderConfiguration, _trt__AddAudioDecoderConfigurationResponse &trt__AddAudioDecoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__AddAudioDecoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::RemoveVideoEncoderConfiguration(_trt__RemoveVideoEncoderConfiguration *trt__RemoveVideoEncoderConfiguration, _trt__RemoveVideoEncoderConfigurationResponse &trt__RemoveVideoEncoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__RemoveVideoEncoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::RemoveVideoSourceConfiguration(_trt__RemoveVideoSourceConfiguration *trt__RemoveVideoSourceConfiguration, _trt__RemoveVideoSourceConfigurationResponse &trt__RemoveVideoSourceConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__RemoveVideoSourceConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::RemoveAudioEncoderConfiguration(_trt__RemoveAudioEncoderConfiguration *trt__RemoveAudioEncoderConfiguration, _trt__RemoveAudioEncoderConfigurationResponse &trt__RemoveAudioEncoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__RemoveAudioEncoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::RemoveAudioSourceConfiguration(_trt__RemoveAudioSourceConfiguration *trt__RemoveAudioSourceConfiguration, _trt__RemoveAudioSourceConfigurationResponse &trt__RemoveAudioSourceConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__RemoveAudioSourceConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::RemovePTZConfiguration(_trt__RemovePTZConfiguration *trt__RemovePTZConfiguration, _trt__RemovePTZConfigurationResponse &trt__RemovePTZConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__RemovePTZConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::RemoveVideoAnalyticsConfiguration(_trt__RemoveVideoAnalyticsConfiguration *trt__RemoveVideoAnalyticsConfiguration, _trt__RemoveVideoAnalyticsConfigurationResponse &trt__RemoveVideoAnalyticsConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__RemoveVideoAnalyticsConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::RemoveMetadataConfiguration(_trt__RemoveMetadataConfiguration *trt__RemoveMetadataConfiguration, _trt__RemoveMetadataConfigurationResponse &trt__RemoveMetadataConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__RemoveMetadataConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::RemoveAudioOutputConfiguration(_trt__RemoveAudioOutputConfiguration *trt__RemoveAudioOutputConfiguration, _trt__RemoveAudioOutputConfigurationResponse &trt__RemoveAudioOutputConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__RemoveAudioOutputConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::RemoveAudioDecoderConfiguration(_trt__RemoveAudioDecoderConfiguration *trt__RemoveAudioDecoderConfiguration, _trt__RemoveAudioDecoderConfigurationResponse &trt__RemoveAudioDecoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__RemoveAudioDecoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::DeleteProfile(_trt__DeleteProfile *trt__DeleteProfile, _trt__DeleteProfileResponse &trt__DeleteProfileResponse)
-{
- SOAP_EMPTY_HANDLER(trt__DeleteProfile, "Media");
-}
-
-
-
-int MediaBindingService::GetVideoSourceConfigurations(_trt__GetVideoSourceConfigurations *trt__GetVideoSourceConfigurations, _trt__GetVideoSourceConfigurationsResponse &trt__GetVideoSourceConfigurationsResponse)
-{
- UNUSED(trt__GetVideoSourceConfigurations);
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- auto profiles = ctx->get_profiles();
-
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- tt__VideoSourceConfiguration *vsc = it->second.get_video_src_cnf(this->soap);
- trt__GetVideoSourceConfigurationsResponse.Configurations.push_back(vsc);
- }
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::GetVideoEncoderConfigurations(_trt__GetVideoEncoderConfigurations *trt__GetVideoEncoderConfigurations, _trt__GetVideoEncoderConfigurationsResponse &trt__GetVideoEncoderConfigurationsResponse)
-{
- UNUSED(trt__GetVideoEncoderConfigurations);
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- auto profiles = ctx->get_profiles();
-
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- tt__VideoEncoderConfiguration *vec = it->second.get_video_enc_cfg(this->soap);
- trt__GetVideoEncoderConfigurationsResponse.Configurations.push_back(vec);
- }
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::GetAudioSourceConfigurations(_trt__GetAudioSourceConfigurations *trt__GetAudioSourceConfigurations, _trt__GetAudioSourceConfigurationsResponse &trt__GetAudioSourceConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioSourceConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioEncoderConfigurations(_trt__GetAudioEncoderConfigurations *trt__GetAudioEncoderConfigurations, _trt__GetAudioEncoderConfigurationsResponse &trt__GetAudioEncoderConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioEncoderConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetVideoAnalyticsConfigurations(_trt__GetVideoAnalyticsConfigurations *trt__GetVideoAnalyticsConfigurations, _trt__GetVideoAnalyticsConfigurationsResponse &trt__GetVideoAnalyticsConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetVideoAnalyticsConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetMetadataConfigurations(_trt__GetMetadataConfigurations *trt__GetMetadataConfigurations, _trt__GetMetadataConfigurationsResponse &trt__GetMetadataConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetMetadataConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioOutputConfigurations(_trt__GetAudioOutputConfigurations *trt__GetAudioOutputConfigurations, _trt__GetAudioOutputConfigurationsResponse &trt__GetAudioOutputConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioOutputConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioDecoderConfigurations(_trt__GetAudioDecoderConfigurations *trt__GetAudioDecoderConfigurations, _trt__GetAudioDecoderConfigurationsResponse &trt__GetAudioDecoderConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioDecoderConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetVideoSourceConfiguration(_trt__GetVideoSourceConfiguration *trt__GetVideoSourceConfiguration, _trt__GetVideoSourceConfigurationResponse &trt__GetVideoSourceConfigurationResponse)
-{
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- auto profiles = ctx->get_profiles();
-
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- if (trt__GetVideoSourceConfiguration->ConfigurationToken == it->second.get_video_src_cnf(this->soap)->token) {
- tt__VideoSourceConfiguration *vsc = it->second.get_video_src_cnf(this->soap);
- trt__GetVideoSourceConfigurationResponse.Configuration = vsc;
- break;
- }
- }
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::GetVideoEncoderConfiguration(_trt__GetVideoEncoderConfiguration *trt__GetVideoEncoderConfiguration, _trt__GetVideoEncoderConfigurationResponse &trt__GetVideoEncoderConfigurationResponse)
-{
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- auto profiles = ctx->get_profiles();
-
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- if (trt__GetVideoEncoderConfiguration->ConfigurationToken == it->second.get_video_enc_cfg(this->soap)->token) {
- tt__VideoEncoderConfiguration *vec = it->second.get_video_enc_cfg(this->soap);
- trt__GetVideoEncoderConfigurationResponse.Configuration = vec;
- break;
- }
- }
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::GetAudioSourceConfiguration(_trt__GetAudioSourceConfiguration *trt__GetAudioSourceConfiguration, _trt__GetAudioSourceConfigurationResponse &trt__GetAudioSourceConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioSourceConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioEncoderConfiguration(_trt__GetAudioEncoderConfiguration *trt__GetAudioEncoderConfiguration, _trt__GetAudioEncoderConfigurationResponse &trt__GetAudioEncoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioEncoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::GetVideoAnalyticsConfiguration(_trt__GetVideoAnalyticsConfiguration *trt__GetVideoAnalyticsConfiguration, _trt__GetVideoAnalyticsConfigurationResponse &trt__GetVideoAnalyticsConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetVideoAnalyticsConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::GetMetadataConfiguration(_trt__GetMetadataConfiguration *trt__GetMetadataConfiguration, _trt__GetMetadataConfigurationResponse &trt__GetMetadataConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetMetadataConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioOutputConfiguration(_trt__GetAudioOutputConfiguration *trt__GetAudioOutputConfiguration, _trt__GetAudioOutputConfigurationResponse &trt__GetAudioOutputConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioOutputConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioDecoderConfiguration(_trt__GetAudioDecoderConfiguration *trt__GetAudioDecoderConfiguration, _trt__GetAudioDecoderConfigurationResponse &trt__GetAudioDecoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioDecoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::GetCompatibleVideoEncoderConfigurations(_trt__GetCompatibleVideoEncoderConfigurations *trt__GetCompatibleVideoEncoderConfigurations, _trt__GetCompatibleVideoEncoderConfigurationsResponse &trt__GetCompatibleVideoEncoderConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetCompatibleVideoEncoderConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetCompatibleVideoSourceConfigurations(_trt__GetCompatibleVideoSourceConfigurations *trt__GetCompatibleVideoSourceConfigurations, _trt__GetCompatibleVideoSourceConfigurationsResponse &trt__GetCompatibleVideoSourceConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetCompatibleVideoSourceConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetCompatibleAudioEncoderConfigurations(_trt__GetCompatibleAudioEncoderConfigurations *trt__GetCompatibleAudioEncoderConfigurations, _trt__GetCompatibleAudioEncoderConfigurationsResponse &trt__GetCompatibleAudioEncoderConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetCompatibleAudioEncoderConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetCompatibleAudioSourceConfigurations(_trt__GetCompatibleAudioSourceConfigurations *trt__GetCompatibleAudioSourceConfigurations, _trt__GetCompatibleAudioSourceConfigurationsResponse &trt__GetCompatibleAudioSourceConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetCompatibleAudioSourceConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetCompatibleVideoAnalyticsConfigurations(_trt__GetCompatibleVideoAnalyticsConfigurations *trt__GetCompatibleVideoAnalyticsConfigurations, _trt__GetCompatibleVideoAnalyticsConfigurationsResponse &trt__GetCompatibleVideoAnalyticsConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetCompatibleVideoAnalyticsConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetCompatibleMetadataConfigurations(_trt__GetCompatibleMetadataConfigurations *trt__GetCompatibleMetadataConfigurations, _trt__GetCompatibleMetadataConfigurationsResponse &trt__GetCompatibleMetadataConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetCompatibleMetadataConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetCompatibleAudioOutputConfigurations(_trt__GetCompatibleAudioOutputConfigurations *trt__GetCompatibleAudioOutputConfigurations, _trt__GetCompatibleAudioOutputConfigurationsResponse &trt__GetCompatibleAudioOutputConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetCompatibleAudioOutputConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::GetCompatibleAudioDecoderConfigurations(_trt__GetCompatibleAudioDecoderConfigurations *trt__GetCompatibleAudioDecoderConfigurations, _trt__GetCompatibleAudioDecoderConfigurationsResponse &trt__GetCompatibleAudioDecoderConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetCompatibleAudioDecoderConfigurations, "Media");
-}
-
-
-
-int MediaBindingService::SetVideoSourceConfiguration(_trt__SetVideoSourceConfiguration *trt__SetVideoSourceConfiguration, _trt__SetVideoSourceConfigurationResponse &trt__SetVideoSourceConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetVideoSourceConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::SetVideoEncoderConfiguration(_trt__SetVideoEncoderConfiguration *trt__SetVideoEncoderConfiguration, _trt__SetVideoEncoderConfigurationResponse &trt__SetVideoEncoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetVideoEncoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::SetAudioSourceConfiguration(_trt__SetAudioSourceConfiguration *trt__SetAudioSourceConfiguration, _trt__SetAudioSourceConfigurationResponse &trt__SetAudioSourceConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetAudioSourceConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::SetAudioEncoderConfiguration(_trt__SetAudioEncoderConfiguration *trt__SetAudioEncoderConfiguration, _trt__SetAudioEncoderConfigurationResponse &trt__SetAudioEncoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetAudioEncoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::SetVideoAnalyticsConfiguration(_trt__SetVideoAnalyticsConfiguration *trt__SetVideoAnalyticsConfiguration, _trt__SetVideoAnalyticsConfigurationResponse &trt__SetVideoAnalyticsConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetVideoAnalyticsConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::SetMetadataConfiguration(_trt__SetMetadataConfiguration *trt__SetMetadataConfiguration, _trt__SetMetadataConfigurationResponse &trt__SetMetadataConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetMetadataConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::SetAudioOutputConfiguration(_trt__SetAudioOutputConfiguration *trt__SetAudioOutputConfiguration, _trt__SetAudioOutputConfigurationResponse &trt__SetAudioOutputConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetAudioOutputConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::SetAudioDecoderConfiguration(_trt__SetAudioDecoderConfiguration *trt__SetAudioDecoderConfiguration, _trt__SetAudioDecoderConfigurationResponse &trt__SetAudioDecoderConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetAudioDecoderConfiguration, "Media");
-}
-
-
-
-int MediaBindingService::GetVideoSourceConfigurationOptions(_trt__GetVideoSourceConfigurationOptions *trt__GetVideoSourceConfigurationOptions, _trt__GetVideoSourceConfigurationOptionsResponse &trt__GetVideoSourceConfigurationOptionsResponse)
-{
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
- std::string token;
- int width;
- int height;
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- auto profiles = ctx->get_profiles();
-
- if (trt__GetVideoSourceConfigurationOptions->ConfigurationToken != NULL) {
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- if (*(trt__GetVideoSourceConfigurationOptions->ConfigurationToken) == it->second.get_video_enc_cfg(this->soap)->token) {
- token.assign(it->second.get_video_enc_cfg(this->soap)->token);
- }
- }
- } else if (trt__GetVideoSourceConfigurationOptions->ProfileToken != NULL) {
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- if (*(trt__GetVideoSourceConfigurationOptions->ProfileToken) == it->second.get_video_src_cnf(this->soap)->token) {
- token.assign(it->second.get_video_src_cnf(this->soap)->token);
- }
- }
- }
-
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- if ((token.empty()) || (token == it->second.get_video_src_cnf(this->soap)->token)) {
- width = it->second.get_width();
- height = it->second.get_height();
-
- trt__GetVideoSourceConfigurationOptionsResponse.Options = soap_new_tt__VideoSourceConfigurationOptions(soap);
-
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange = soap_new_tt__IntRectangleRange(soap);
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->XRange = soap_new_tt__IntRange(soap);
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->XRange->Min = 0; //dummy
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->XRange->Max = width; //dummy
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->YRange = soap_new_tt__IntRange(soap);
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->YRange->Min = 0; //dummy
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->YRange->Max = height; //dummy
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->WidthRange = soap_new_tt__IntRange(soap);
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->WidthRange->Min = 0; //dummy
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->WidthRange->Max = width; //dummy
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->HeightRange = soap_new_tt__IntRange(soap);
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->HeightRange->Min = 0; //dummy
- trt__GetVideoSourceConfigurationOptionsResponse.Options->BoundsRange->HeightRange->Max = height; //dummy
-
- trt__GetVideoSourceConfigurationOptionsResponse.Options->VideoSourceTokensAvailable.push_back(it->second.get_video_src_cnf(this->soap)->token);
-
- break;
- }
- }
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::GetVideoEncoderConfigurationOptions(_trt__GetVideoEncoderConfigurationOptions *trt__GetVideoEncoderConfigurationOptions, _trt__GetVideoEncoderConfigurationOptionsResponse &trt__GetVideoEncoderConfigurationOptionsResponse)
-{
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
- std::string token;
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- auto profiles = ctx->get_profiles();
-
- if (trt__GetVideoEncoderConfigurationOptions->ConfigurationToken != NULL) {
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- if (*(trt__GetVideoEncoderConfigurationOptions->ConfigurationToken) == it->second.get_video_enc_cfg(this->soap)->token) {
- token.assign(it->second.get_video_enc_cfg(this->soap)->token);
- }
- }
- } else if (trt__GetVideoEncoderConfigurationOptions->ProfileToken != NULL) {
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- if (*(trt__GetVideoEncoderConfigurationOptions->ProfileToken) == it->second.get_video_src_cnf(this->soap)->token) {
- token.assign(it->second.get_video_src_cnf(this->soap)->token);
- }
- }
- }
-
- trt__GetVideoEncoderConfigurationOptionsResponse.Options = soap_new_tt__VideoEncoderConfigurationOptions(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->JPEG = NULL;
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4 = NULL;
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264 = NULL;
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->QualityRange = soap_new_tt__IntRange(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->QualityRange->Min = 0; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->QualityRange->Max = 100; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->Extension = NULL;
-
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it ) {
- if ((token.empty()) || (token == it->second.get_video_src_cnf(this->soap)->token)) {
- if (it->second.get_type() == tt__VideoEncoding__JPEG) {
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->JPEG = soap_new_tt__JpegOptions(soap);
-
- tt__VideoResolution *vr = soap_new_tt__VideoResolution(soap);
- vr->Width = it->second.get_width();
- vr->Height = it->second.get_height();
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->JPEG->ResolutionsAvailable.push_back(vr);
-
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->JPEG->FrameRateRange = soap_new_tt__IntRange(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->JPEG->FrameRateRange->Min = 0; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->JPEG->FrameRateRange->Max = 20; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->JPEG->EncodingIntervalRange = soap_new_tt__IntRange(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->JPEG->EncodingIntervalRange->Min = 0; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->JPEG->EncodingIntervalRange->Max = 3; //dummy
- } else if (it->second.get_type() == tt__VideoEncoding__MPEG4) {
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4 = soap_new_tt__Mpeg4Options(soap);
-
- tt__VideoResolution *vr = soap_new_tt__VideoResolution(soap);
- vr->Width = it->second.get_width();
- vr->Height = it->second.get_height();
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->ResolutionsAvailable.push_back(vr);
-
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->GovLengthRange = soap_new_tt__IntRange(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->GovLengthRange->Min = 0; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->GovLengthRange->Max = 40; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->FrameRateRange = soap_new_tt__IntRange(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->FrameRateRange->Min = 0; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->FrameRateRange->Max = 20; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->EncodingIntervalRange = soap_new_tt__IntRange(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->EncodingIntervalRange->Min = 0; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->EncodingIntervalRange->Max = 3; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->MPEG4->Mpeg4ProfilesSupported.push_back(tt__Mpeg4Profile__SP);
- } else if (it->second.get_type() == tt__VideoEncoding__H264) {
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264 = soap_new_tt__H264Options(soap);
-
- tt__VideoResolution *vr = soap_new_tt__VideoResolution(soap);
- vr->Width = it->second.get_width();
- vr->Height = it->second.get_height();
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->ResolutionsAvailable.push_back(vr);
-
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->GovLengthRange = soap_new_tt__IntRange(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->GovLengthRange->Min = 0; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->GovLengthRange->Max = 40; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->FrameRateRange = soap_new_tt__IntRange(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->FrameRateRange->Min = 0; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->FrameRateRange->Max = 20; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->EncodingIntervalRange = soap_new_tt__IntRange(soap);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->EncodingIntervalRange->Min = 0; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->EncodingIntervalRange->Max = 3; //dummy
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->H264ProfilesSupported.push_back(tt__H264Profile__Main);
- trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->H264ProfilesSupported.push_back(tt__H264Profile__Main);
- }
- }
- }
-
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::GetAudioSourceConfigurationOptions(_trt__GetAudioSourceConfigurationOptions *trt__GetAudioSourceConfigurationOptions, _trt__GetAudioSourceConfigurationOptionsResponse &trt__GetAudioSourceConfigurationOptionsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioSourceConfigurationOptions, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioEncoderConfigurationOptions(_trt__GetAudioEncoderConfigurationOptions *trt__GetAudioEncoderConfigurationOptions, _trt__GetAudioEncoderConfigurationOptionsResponse &trt__GetAudioEncoderConfigurationOptionsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioEncoderConfigurationOptions, "Media");
-}
-
-
-
-int MediaBindingService::GetMetadataConfigurationOptions(_trt__GetMetadataConfigurationOptions *trt__GetMetadataConfigurationOptions, _trt__GetMetadataConfigurationOptionsResponse &trt__GetMetadataConfigurationOptionsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetMetadataConfigurationOptions, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioOutputConfigurationOptions(_trt__GetAudioOutputConfigurationOptions *trt__GetAudioOutputConfigurationOptions, _trt__GetAudioOutputConfigurationOptionsResponse &trt__GetAudioOutputConfigurationOptionsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioOutputConfigurationOptions, "Media");
-}
-
-
-
-int MediaBindingService::GetAudioDecoderConfigurationOptions(_trt__GetAudioDecoderConfigurationOptions *trt__GetAudioDecoderConfigurationOptions, _trt__GetAudioDecoderConfigurationOptionsResponse &trt__GetAudioDecoderConfigurationOptionsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetAudioDecoderConfigurationOptions, "Media");
-}
-
-
-
-int MediaBindingService::GetGuaranteedNumberOfVideoEncoderInstances(_trt__GetGuaranteedNumberOfVideoEncoderInstances *trt__GetGuaranteedNumberOfVideoEncoderInstances, _trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse &trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse)
-{
- UNUSED(trt__GetGuaranteedNumberOfVideoEncoderInstances);
- DEBUG_MSG("Media: %s\n", __FUNCTION__);
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- auto profiles = ctx->get_profiles();
-
- int instancesNumber = 3;
- int jpegInstancesNumber = 0;
- int mpeg4InstancesNumber = 0;
- int h264InstancesNumber = 0;
-
- for( auto it = profiles.cbegin(); it != profiles.cend(); ++it )
- {
- if (it->second.get_type() == tt__VideoEncoding__JPEG) {
- jpegInstancesNumber += instancesNumber;
- } else if (it->second.get_type() == tt__VideoEncoding__MPEG4) {
- mpeg4InstancesNumber += instancesNumber;
- } else if (it->second.get_type() == tt__VideoEncoding__H264) {
- h264InstancesNumber += instancesNumber;
- }
- }
-
- trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse.TotalNumber = jpegInstancesNumber + mpeg4InstancesNumber + h264InstancesNumber;
- trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse.JPEG = soap_new_ptr(soap, jpegInstancesNumber);
- trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse.MPEG4 = soap_new_ptr(soap, mpeg4InstancesNumber);
- trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse.H264 = soap_new_ptr(soap, h264InstancesNumber);
-
- return SOAP_OK;
-}
-
-
-
-int MediaBindingService::GetStreamUri(_trt__GetStreamUri *trt__GetStreamUri, _trt__GetStreamUriResponse &trt__GetStreamUriResponse)
-{
- DEBUG_MSG("Media: %s for profile:%s\n", __FUNCTION__, trt__GetStreamUri->ProfileToken.c_str());
-
-
- int ret = SOAP_FAULT;
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
- auto profiles = ctx->get_profiles();
- auto it = profiles.find(trt__GetStreamUri->ProfileToken);
-
-
- if( it != profiles.end() )
- {
- trt__GetStreamUriResponse.MediaUri = soap_new_tt__MediaUri(this->soap);
- trt__GetStreamUriResponse.MediaUri->Uri = ctx->get_stream_uri(it->second.get_url(), htonl(this->soap->ip));
- ret = SOAP_OK;
- }
-
-
- return ret;
-}
-
-
-
-int MediaBindingService::StartMulticastStreaming(_trt__StartMulticastStreaming *trt__StartMulticastStreaming, _trt__StartMulticastStreamingResponse &trt__StartMulticastStreamingResponse)
-{
- SOAP_EMPTY_HANDLER(trt__StartMulticastStreaming, "Media");
-}
-
-
-
-int MediaBindingService::StopMulticastStreaming(_trt__StopMulticastStreaming *trt__StopMulticastStreaming, _trt__StopMulticastStreamingResponse &trt__StopMulticastStreamingResponse)
-{
- SOAP_EMPTY_HANDLER(trt__StopMulticastStreaming, "Media");
-}
-
-
-
-int MediaBindingService::SetSynchronizationPoint(_trt__SetSynchronizationPoint *trt__SetSynchronizationPoint, _trt__SetSynchronizationPointResponse &trt__SetSynchronizationPointResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetSynchronizationPoint, "Media");
-}
-
-
-
-int MediaBindingService::GetSnapshotUri(_trt__GetSnapshotUri *trt__GetSnapshotUri, _trt__GetSnapshotUriResponse &trt__GetSnapshotUriResponse)
-{
- DEBUG_MSG("Media: %s for profile:%s\n", __FUNCTION__, trt__GetSnapshotUri->ProfileToken.c_str());
-
-
- int ret = SOAP_FAULT;
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
- auto profiles = ctx->get_profiles();
- auto it = profiles.find(trt__GetSnapshotUri->ProfileToken);
-
- if( it != profiles.end() )
- {
- trt__GetSnapshotUriResponse.MediaUri = soap_new_tt__MediaUri(this->soap);
- trt__GetSnapshotUriResponse.MediaUri->Uri = ctx->get_snapshot_uri(it->second.get_snapurl(), htonl(this->soap->ip));
- ret = SOAP_OK;
- }
-
-
- return ret;
-}
-
-
-
-int MediaBindingService::GetVideoSourceModes(_trt__GetVideoSourceModes *trt__GetVideoSourceModes, _trt__GetVideoSourceModesResponse &trt__GetVideoSourceModesResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetVideoSourceModes, "Media");
-}
-
-
-
-int MediaBindingService::SetVideoSourceMode(_trt__SetVideoSourceMode *trt__SetVideoSourceMode, _trt__SetVideoSourceModeResponse &trt__SetVideoSourceModeResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetVideoSourceMode, "Media");
-}
-
-
-
-int MediaBindingService::GetOSDs(_trt__GetOSDs *trt__GetOSDs, _trt__GetOSDsResponse &trt__GetOSDsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetOSDs, "Media");
-}
-
-
-
-int MediaBindingService::GetOSD(_trt__GetOSD *trt__GetOSD, _trt__GetOSDResponse &trt__GetOSDResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetOSD, "Media");
-}
-
-
-
-int MediaBindingService::GetOSDOptions(_trt__GetOSDOptions *trt__GetOSDOptions, _trt__GetOSDOptionsResponse &trt__GetOSDOptionsResponse)
-{
- SOAP_EMPTY_HANDLER(trt__GetOSDOptions, "Media");
-}
-
-
-
-int MediaBindingService::SetOSD(_trt__SetOSD *trt__SetOSD, _trt__SetOSDResponse &trt__SetOSDResponse)
-{
- SOAP_EMPTY_HANDLER(trt__SetOSD, "Media");
-}
-
-
-
-int MediaBindingService::CreateOSD(_trt__CreateOSD *trt__CreateOSD, _trt__CreateOSDResponse &trt__CreateOSDResponse)
-{
- SOAP_EMPTY_HANDLER(trt__CreateOSD, "Media");
-}
-
-
-
-int MediaBindingService::DeleteOSD(_trt__DeleteOSD *trt__DeleteOSD, _trt__DeleteOSDResponse &trt__DeleteOSDResponse)
-{
- SOAP_EMPTY_HANDLER(trt__DeleteOSD, "Media");
-}
diff --git a/src/onvif_srvd/onvif_srvd/src/ServicePTZ.cpp b/src/onvif_srvd/onvif_srvd/src/ServicePTZ.cpp
deleted file mode 100644
index 0e174aa..0000000
--- a/src/onvif_srvd/onvif_srvd/src/ServicePTZ.cpp
+++ /dev/null
@@ -1,449 +0,0 @@
-/*
- --------------------------------------------------------------------------
- ServicePTZ.cpp
-
- Implementation of functions (methods) for the service:
- ONVIF ptz.wsdl server side
------------------------------------------------------------------------------
-*/
-
-
-#include
-#include "soapPTZBindingService.h"
-#include "ServiceContext.h"
-#include "smacros.h"
-
-
-
-
-
-int PTZBindingService::GetServiceCapabilities(_tptz__GetServiceCapabilities *tptz__GetServiceCapabilities, _tptz__GetServiceCapabilitiesResponse &tptz__GetServiceCapabilitiesResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__GetServiceCapabilities, "PTZ");
-}
-
-
-
-int PTZBindingService::GetConfigurations(_tptz__GetConfigurations *tptz__GetConfigurations, _tptz__GetConfigurationsResponse &tptz__GetConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__GetConfigurations, "PTZ");
-}
-
-
-
-int GetPTZPreset(struct soap *soap, tt__PTZPreset* ptzp, int number)
-{
- std::stringstream stream;
-
- stream << number;
- ptzp->token = soap_new_std__string(soap);
- *ptzp->token = stream.str();
- ptzp->Name = soap_new_std__string(soap);
- *ptzp->Name = stream.str();
-
- ptzp->PTZPosition = soap_new_tt__PTZVector(soap);
- ptzp->PTZPosition->PanTilt = soap_new_req_tt__Vector2D(soap, 0.0f, 0.0f);
- ptzp->PTZPosition->Zoom = soap_new_req_tt__Vector1D(soap, 1.0f);
-
- return SOAP_OK;
-}
-
-
-
-int PTZBindingService::GetPresets(_tptz__GetPresets *tptz__GetPresets, _tptz__GetPresetsResponse &tptz__GetPresetsResponse)
-{
- UNUSED(tptz__GetPresets);
- DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
-
-
- soap_default_std__vectorTemplateOfPointerTott__PTZPreset(soap, &tptz__GetPresetsResponse._tptz__GetPresetsResponse::Preset);
- for (int i = 0; i < 8; i++) {
- tt__PTZPreset* ptzp;
- ptzp = soap_new_tt__PTZPreset(soap);
- tptz__GetPresetsResponse.Preset.push_back(ptzp);
- GetPTZPreset(this->soap, ptzp, i);
- }
-
- return SOAP_OK;
-}
-
-
-
-int PTZBindingService::SetPreset(_tptz__SetPreset *tptz__SetPreset, _tptz__SetPresetResponse &tptz__SetPresetResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__SetPreset, "PTZ");
-}
-
-
-
-int PTZBindingService::RemovePreset(_tptz__RemovePreset *tptz__RemovePreset, _tptz__RemovePresetResponse &tptz__RemovePresetResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__RemovePreset, "PTZ");
-}
-
-
-
-int PTZBindingService::GotoPreset(_tptz__GotoPreset *tptz__GotoPreset, _tptz__GotoPresetResponse &tptz__GotoPresetResponse)
-{
- UNUSED(tptz__GotoPresetResponse);
- DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
-
-
- std::string preset_cmd;
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- if (tptz__GotoPreset == NULL) {
- return SOAP_OK;
- }
- if (tptz__GotoPreset->ProfileToken.c_str() == NULL) {
- return SOAP_OK;
- }
- if (tptz__GotoPreset->PresetToken.c_str() == NULL) {
- return SOAP_OK;
- }
-
- if (!ctx->get_ptz_node()->get_move_preset().empty()) {
- preset_cmd = ctx->get_ptz_node()->get_move_preset().c_str();
- } else {
- return SOAP_OK;
- }
-
- std::string template_str_t("%t");
-
- auto it_t = preset_cmd.find(template_str_t, 0);
-
- if( it_t != std::string::npos ) {
- preset_cmd.replace(it_t, template_str_t.size(), tptz__GotoPreset->PresetToken.c_str());
- }
-
- system(preset_cmd.c_str());
-
- return SOAP_OK;
-}
-
-
-
-int PTZBindingService::GetStatus(_tptz__GetStatus *tptz__GetStatus, _tptz__GetStatusResponse &tptz__GetStatusResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__GetStatus, "PTZ");
-}
-
-
-
-int PTZBindingService::GetConfiguration(_tptz__GetConfiguration *tptz__GetConfiguration, _tptz__GetConfigurationResponse &tptz__GetConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__GetConfiguration, "PTZ");
-}
-
-
-
-int GetPTZNode(struct soap *soap, tt__PTZNode* ptzn)
-{
- ptzn->token = "PTZNodeToken";
- ptzn->Name = soap_new_std__string(soap);
- *ptzn->Name = "PTZ";
-
- ptzn->SupportedPTZSpaces = soap_new_tt__PTZSpaces(soap);;
- soap_default_std__vectorTemplateOfPointerTott__Space2DDescription(soap, &ptzn->SupportedPTZSpaces->tt__PTZSpaces::RelativePanTiltTranslationSpace);
- soap_default_std__vectorTemplateOfPointerTott__Space1DDescription(soap, &ptzn->SupportedPTZSpaces->tt__PTZSpaces::RelativeZoomTranslationSpace);
- soap_default_std__vectorTemplateOfPointerTott__Space2DDescription(soap, &ptzn->SupportedPTZSpaces->tt__PTZSpaces::ContinuousPanTiltVelocitySpace);
- soap_default_std__vectorTemplateOfPointerTott__Space1DDescription(soap, &ptzn->SupportedPTZSpaces->tt__PTZSpaces::ContinuousZoomVelocitySpace);
- soap_default_std__vectorTemplateOfPointerTott__Space1DDescription(soap, &ptzn->SupportedPTZSpaces->tt__PTZSpaces::PanTiltSpeedSpace);
- soap_default_std__vectorTemplateOfPointerTott__Space1DDescription(soap, &ptzn->SupportedPTZSpaces->tt__PTZSpaces::ZoomSpeedSpace);
-
-
- auto ptzs1 = soap_new_tt__Space2DDescription(soap);
- ptzn->SupportedPTZSpaces->RelativePanTiltTranslationSpace.push_back(ptzs1);
-
- auto ptzs2 = soap_new_tt__Space1DDescription(soap);
- ptzn->SupportedPTZSpaces->RelativeZoomTranslationSpace.push_back(ptzs2);
-
- auto ptzs3 = soap_new_tt__Space2DDescription(soap);
- ptzn->SupportedPTZSpaces->ContinuousPanTiltVelocitySpace.push_back(ptzs3);
-
- auto ptzs4 = soap_new_tt__Space1DDescription(soap);
- ptzn->SupportedPTZSpaces->ContinuousZoomVelocitySpace.push_back(ptzs4);
-
- auto ptzs5 = soap_new_tt__Space1DDescription(soap);
- ptzn->SupportedPTZSpaces->PanTiltSpeedSpace.push_back(ptzs5);
-
- auto ptzs6 = soap_new_tt__Space1DDescription(soap);
- ptzn->SupportedPTZSpaces->ZoomSpeedSpace.push_back(ptzs6);
-
- ptzs1->URI = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace";
- ptzs1->XRange = soap_new_req_tt__FloatRange(soap, -1.0f, 1.0f);
- ptzs1->YRange = soap_new_req_tt__FloatRange(soap, -1.0f, 1.0f);
-
- ptzs2->URI = "http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace";
- ptzs2->XRange = soap_new_req_tt__FloatRange(soap, -1.0f, 1.0f);
-
- ptzs3->URI = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace";
- ptzs3->XRange = soap_new_req_tt__FloatRange(soap, -1.0f, 1.0f);
- ptzs3->YRange = soap_new_req_tt__FloatRange(soap, -1.0f, 1.0f);
-
- ptzs4->URI = "http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace";
- ptzs4->XRange = soap_new_req_tt__FloatRange(soap, -1.0f, 1.0f);
-
- ptzs5->URI = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace";
- ptzs5->XRange = soap_new_req_tt__FloatRange(soap, 0.0f, 1.0f);
-
- ptzs6->URI = "http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace";
- ptzs6->XRange = soap_new_req_tt__FloatRange(soap, 0.0f, 1.0f);
-
-
- ptzn->MaximumNumberOfPresets = 8;
- ptzn->HomeSupported = true;
- ptzn->FixedHomePosition = (bool *)soap_malloc(soap, sizeof(bool));
- soap_s2bool(soap, "true", ptzn->FixedHomePosition);
-
- return SOAP_OK;
-}
-
-
-
-int PTZBindingService::GetNodes(_tptz__GetNodes *tptz__GetNodes, _tptz__GetNodesResponse &tptz__GetNodesResponse)
-{
- UNUSED(tptz__GetNodes);
- DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
-
-
- soap_default_std__vectorTemplateOfPointerTott__PTZNode(soap, &tptz__GetNodesResponse._tptz__GetNodesResponse::PTZNode);
- tt__PTZNode* ptzn;
- ptzn = soap_new_tt__PTZNode(soap);
- tptz__GetNodesResponse.PTZNode.push_back(ptzn);
- GetPTZNode(this->soap, ptzn);
-
- return SOAP_OK;
-}
-
-
-
-int PTZBindingService::GetNode(_tptz__GetNode *tptz__GetNode, _tptz__GetNodeResponse &tptz__GetNodeResponse)
-{
- UNUSED(tptz__GetNode);
- DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
-
- tptz__GetNodeResponse.PTZNode = soap_new_tt__PTZNode(this->soap);
- GetPTZNode(this->soap, tptz__GetNodeResponse.PTZNode);
-
- return SOAP_OK;
-}
-
-
-
-int PTZBindingService::SetConfiguration(_tptz__SetConfiguration *tptz__SetConfiguration, _tptz__SetConfigurationResponse &tptz__SetConfigurationResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__SetConfiguration, "PTZ");
-}
-
-
-
-int PTZBindingService::GetConfigurationOptions(_tptz__GetConfigurationOptions *tptz__GetConfigurationOptions, _tptz__GetConfigurationOptionsResponse &tptz__GetConfigurationOptionsResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__GetConfigurationOptions, "PTZ");
-}
-
-
-
-int PTZBindingService::GotoHomePosition(_tptz__GotoHomePosition *tptz__GotoHomePosition, _tptz__GotoHomePositionResponse &tptz__GotoHomePositionResponse)
-{
- UNUSED(tptz__GotoHomePosition);
- UNUSED(tptz__GotoHomePositionResponse);
- DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
-
- std::string preset_cmd;
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- if (tptz__GotoHomePosition == NULL) {
- return SOAP_OK;
- }
- if (tptz__GotoHomePosition->ProfileToken.c_str() == NULL) {
- return SOAP_OK;
- }
-
- if (!ctx->get_ptz_node()->get_move_preset().empty()) {
- preset_cmd = ctx->get_ptz_node()->get_move_preset().c_str();
- } else {
- return SOAP_OK;
- }
-
- std::string template_str_t("%t");
-
- auto it_t = preset_cmd.find(template_str_t, 0);
-
- if( it_t != std::string::npos ) {
- preset_cmd.replace(it_t, template_str_t.size(), "1");
- }
-
- system(preset_cmd.c_str());
-
- return SOAP_OK;
-}
-
-int PTZBindingService::SetHomePosition(_tptz__SetHomePosition *tptz__SetHomePosition, _tptz__SetHomePositionResponse &tptz__SetHomePositionResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__SetHomePosition, "PTZ");
-}
-
-
-
-int PTZBindingService::ContinuousMove(_tptz__ContinuousMove *tptz__ContinuousMove, _tptz__ContinuousMoveResponse &tptz__ContinuousMoveResponse)
-{
- UNUSED(tptz__ContinuousMoveResponse);
- DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- if (tptz__ContinuousMove == NULL) {
- return SOAP_OK;
- }
- if (tptz__ContinuousMove->Velocity == NULL) {
- return SOAP_OK;
- }
- if (tptz__ContinuousMove->Velocity->PanTilt == NULL) {
- return SOAP_OK;
- }
-
- if (tptz__ContinuousMove->Velocity->PanTilt->x > 0) {
- system(ctx->get_ptz_node()->get_move_right().c_str());
- } else if (tptz__ContinuousMove->Velocity->PanTilt->x < 0) {
- system(ctx->get_ptz_node()->get_move_left().c_str());
- }
- if (tptz__ContinuousMove->Velocity->PanTilt->y > 0) {
- system(ctx->get_ptz_node()->get_move_up().c_str());
- } else if (tptz__ContinuousMove->Velocity->PanTilt->y < 0) {
- system(ctx->get_ptz_node()->get_move_down().c_str());
- }
-
- return SOAP_OK;
-}
-
-
-
-int PTZBindingService::RelativeMove(_tptz__RelativeMove *tptz__RelativeMove, _tptz__RelativeMoveResponse &tptz__RelativeMoveResponse)
-{
- UNUSED(tptz__RelativeMoveResponse);
- DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
-
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- if (tptz__RelativeMove == NULL) {
- return SOAP_OK;
- }
- if (tptz__RelativeMove->Translation == NULL) {
- return SOAP_OK;
- }
- if (tptz__RelativeMove->Translation->PanTilt == NULL) {
- return SOAP_OK;
- }
-
- if (tptz__RelativeMove->Translation->PanTilt->x > 0) {
- system(ctx->get_ptz_node()->get_move_right().c_str());
- usleep(300000);
- system(ctx->get_ptz_node()->get_move_stop().c_str());
- } else if (tptz__RelativeMove->Translation->PanTilt->x < 0) {
- system(ctx->get_ptz_node()->get_move_left().c_str());
- usleep(300000);
- system(ctx->get_ptz_node()->get_move_stop().c_str());
- }
- if (tptz__RelativeMove->Translation->PanTilt->y > 0) {
- system(ctx->get_ptz_node()->get_move_up().c_str());
- usleep(300000);
- system(ctx->get_ptz_node()->get_move_stop().c_str());
- } else if (tptz__RelativeMove->Translation->PanTilt->y < 0) {
- system(ctx->get_ptz_node()->get_move_down().c_str());
- usleep(300000);
- system(ctx->get_ptz_node()->get_move_stop().c_str());
- }
-
- return SOAP_OK;
-}
-
-
-
-int PTZBindingService::SendAuxiliaryCommand(_tptz__SendAuxiliaryCommand *tptz__SendAuxiliaryCommand, _tptz__SendAuxiliaryCommandResponse &tptz__SendAuxiliaryCommandResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__SendAuxiliaryCommand, "PTZ");
-}
-
-
-
-int PTZBindingService::AbsoluteMove(_tptz__AbsoluteMove *tptz__AbsoluteMove, _tptz__AbsoluteMoveResponse &tptz__AbsoluteMoveResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__AbsoluteMove, "PTZ");
-}
-
-
-
-int PTZBindingService::Stop(_tptz__Stop *tptz__Stop, _tptz__StopResponse &tptz__StopResponse)
-{
- UNUSED(tptz__Stop);
- UNUSED(tptz__StopResponse);
- DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
-
- ServiceContext* ctx = (ServiceContext*)this->soap->user;
-
- system(ctx->get_ptz_node()->get_move_stop().c_str());
-
- return SOAP_OK;
-}
-
-
-
-int PTZBindingService::GetPresetTours(_tptz__GetPresetTours *tptz__GetPresetTours, _tptz__GetPresetToursResponse &tptz__GetPresetToursResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__GetPresetTours, "PTZ");
-}
-
-
-
-int PTZBindingService::GetPresetTour(_tptz__GetPresetTour *tptz__GetPresetTour, _tptz__GetPresetTourResponse &tptz__GetPresetTourResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__GetPresetTour, "PTZ");
-}
-
-
-
-int PTZBindingService::GetPresetTourOptions(_tptz__GetPresetTourOptions *tptz__GetPresetTourOptions, _tptz__GetPresetTourOptionsResponse &tptz__GetPresetTourOptionsResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__GetPresetTourOptions, "PTZ");
-}
-
-
-
-int PTZBindingService::CreatePresetTour(_tptz__CreatePresetTour *tptz__CreatePresetTour, _tptz__CreatePresetTourResponse &tptz__CreatePresetTourResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__CreatePresetTour, "PTZ");
-}
-
-
-
-int PTZBindingService::ModifyPresetTour(_tptz__ModifyPresetTour *tptz__ModifyPresetTour, _tptz__ModifyPresetTourResponse &tptz__ModifyPresetTourResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__ModifyPresetTour, "PTZ");
-}
-
-
-
-int PTZBindingService::OperatePresetTour(_tptz__OperatePresetTour *tptz__OperatePresetTour, _tptz__OperatePresetTourResponse &tptz__OperatePresetTourResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__OperatePresetTour, "PTZ");
-}
-
-
-
-int PTZBindingService::RemovePresetTour(_tptz__RemovePresetTour *tptz__RemovePresetTour, _tptz__RemovePresetTourResponse &tptz__RemovePresetTourResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__RemovePresetTour, "PTZ");
-}
-
-
-
-int PTZBindingService::GetCompatibleConfigurations(_tptz__GetCompatibleConfigurations *tptz__GetCompatibleConfigurations, _tptz__GetCompatibleConfigurationsResponse &tptz__GetCompatibleConfigurationsResponse)
-{
- SOAP_EMPTY_HANDLER(tptz__GetCompatibleConfigurations, "PTZ");
-}
diff --git a/src/onvif_srvd/onvif_srvd/src/daemon.c b/src/onvif_srvd/onvif_srvd/src/daemon.c
deleted file mode 100644
index 37d6b01..0000000
--- a/src/onvif_srvd/onvif_srvd/src/daemon.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * daemon.c
- *
- *
- * version 1.1
- *
- *
- *
- * BSD 3-Clause License
- *
- * Copyright (c) 2015, Koynov Stas - skojnov@yandex.ru
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-
-#include "daemon.h"
-
-
-
-
-
-/*
- * How can I execute a new process from GNOME Terminal
- * so that the child process's parent PID becomes 1 and not
- * the PID of the ubuntu session init process?
- *
- * This is intentionally hard.
- * Service managers want to keep track of orphaned child processes.
- * They want not to lose them to process #1.
- * Stop trying to do that!!!
- *
- *
- * If you are asking solely because you think that your process (daemon)
- * ought to have a parent process ID of 1, then wean yourself off this idea.
- *
- *
- * Therefore, modern Linux system does not correctly determine the fact of
- * daemonized through the function:
- *
- * if( getppid() == 1 )
- * return 1; //already a daemon
- *
- * We uses our flag daemonized in daemon_info_t
- */
-
-
-
-volatile struct daemon_info_t daemon_info =
-{
- .terminated = 0,
- .daemonized = 0, //flag will be set in finale function daemonize()
-
-
- #ifdef DAEMON_NO_CHDIR
- .no_chdir = DAEMON_NO_CHDIR,
- #else
- .no_chdir = 0,
- #endif
-
-
- #ifdef DAEMON_NO_FORK
- .no_fork = DAEMON_NO_FORK,
- #else
- .no_fork = 0,
- #endif
-
-
- #ifdef DAEMON_NO_CLOSE_STDIO
- .no_close_stdio = DAEMON_NO_CLOSE_STDIO,
- #else
- .no_close_stdio = 0,
- #endif
-
-
- #ifdef DAEMON_PID_FILE_NAME
- .pid_file = DAEMON_PID_FILE_NAME,
- #else
- .pid_file = NULL,
- #endif
-
-
- #ifdef DAEMON_LOG_FILE_NAME
- .log_file = DAEMON_LOG_FILE_NAME,
- #else
- .log_file = NULL,
- #endif
-
-
- #ifdef DAEMON_CMD_PIPE_NAME
- .cmd_pipe = DAEMON_CMD_PIPE_NAME,
- #else
- .cmd_pipe = NULL,
- #endif
-};
-
-
-
-
-
-void exit_if_not_daemonized(int exit_status)
-{
- if( !daemon_info.daemonized )
- _exit(exit_status);
-}
-
-
-
-void daemon_error_exit(const char *format, ...)
-{
- va_list ap;
-
-
- if( format && *format )
- {
- va_start(ap, format);
- fprintf(stderr, "%s: ", DAEMON_NAME);
- vfprintf(stderr, format, ap);
- va_end(ap);
- }
-
-
- _exit(EXIT_FAILURE);
-}
-
-
-
-int redirect_stdio_to_devnull(void)
-{
- int fd;
-
-
- fd = open("/dev/null", O_RDWR);
- if(fd == -1)
- return -1; //error can't open file
-
-
- dup2(fd, STDIN_FILENO);
- dup2(fd, STDOUT_FILENO);
- dup2(fd, STDERR_FILENO);
-
-
- if(fd > 2)
- close(fd);
-
-
- return 0; //good job
-}
-
-
-
-int create_pid_file(const char *pid_file_name)
-{
- int fd;
- const int BUF_SIZE = 32;
- char buf[BUF_SIZE];
-
-
-
- if( !pid_file_name )
- {
- errno = EINVAL;
- return -1;
- }
-
-
- fd = open(pid_file_name, O_RDWR | O_CREAT, 0644);
- if(fd == -1)
- return -1; // Could not create on PID file
-
-
- if( lockf(fd, F_TLOCK, 0) == -1 )
- {
- close(fd);
- return -1; // Could not get lock on PID file
- }
-
-
- if( ftruncate(fd, 0) != 0 )
- {
- close(fd);
- return -1; // Could not truncate on PID file
- }
-
-
- snprintf(buf, BUF_SIZE, "%ld\n", (long)getpid());
- if( write(fd, buf, strlen(buf)) != (int)strlen(buf) )
- {
- close(fd);
- return -1; // Could not write PID to PID file
- }
-
-
- return fd; //good job
-}
-
-
-
-static void do_fork()
-{
- switch( fork() ) // Become background process
- {
- case -1: daemon_error_exit("Can't fork: %m\n");
- case 0: break; // child process (go next)
- default: _exit(EXIT_SUCCESS); // We can exit the parent process
- }
-
- // ---- At this point we are executing as the child process ----
-}
-
-
-
-void daemonize2(void (*optional_init)(void *), void *data)
-{
- if( !daemon_info.no_fork )
- do_fork();
-
-
- // Reset the file mode mask
- umask(0);
-
-
- // Create a new process group(session) (SID) for the child process
- // call setsid() only if fork is done
- if( !daemon_info.no_fork && (setsid() == -1) )
- daemon_error_exit("Can't setsid: %m\n");
-
-
- // Change the current working directory to "/"
- // This prevents the current directory from locked
- // The demon must always change the directory to "/"
- if( !daemon_info.no_chdir && (chdir("/") != 0) )
- daemon_error_exit("Can't chdir: %m\n");
-
-
- if( daemon_info.pid_file && (create_pid_file(daemon_info.pid_file) == -1) )
- daemon_error_exit("Can't create pid file: %s: %m\n", daemon_info.pid_file);
-
-
- // call user functions for the optional initialization
- // before closing the standardIO (STDIN, STDOUT, STDERR)
- if( optional_init )
- optional_init(data);
-
-
- if( !daemon_info.no_close_stdio && (redirect_stdio_to_devnull() != 0) )
- daemon_error_exit("Can't redirect stdio to /dev/null: %m\n");
-
-
- daemon_info.daemonized = 1; //good job
-}
diff --git a/src/onvif_srvd/onvif_srvd/src/daemon.h b/src/onvif_srvd/onvif_srvd/src/daemon.h
deleted file mode 100644
index 6ae678c..0000000
--- a/src/onvif_srvd/onvif_srvd/src/daemon.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * daemon.h
- *
- *
- * version 1.1
- *
- *
- *
- * BSD 3-Clause License
- *
- * Copyright (c) 2015, Koynov Stas - skojnov@yandex.ru
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef DAEMON_HEADER
-#define DAEMON_HEADER
-
-
-#include //for NULL
-
-
-
-
-
-#define DAEMON_DEF_TO_STR_(text) #text
-#define DAEMON_DEF_TO_STR(arg) DAEMON_DEF_TO_STR_(arg)
-
-
-#define DAEMON_MAJOR_VERSION_STR DAEMON_DEF_TO_STR(DAEMON_MAJOR_VERSION)
-#define DAEMON_MINOR_VERSION_STR DAEMON_DEF_TO_STR(DAEMON_MINOR_VERSION)
-#define DAEMON_PATCH_VERSION_STR DAEMON_DEF_TO_STR(DAEMON_PATCH_VERSION)
-
-#define DAEMON_VERSION_STR DAEMON_MAJOR_VERSION_STR "." \
- DAEMON_MINOR_VERSION_STR "." \
- DAEMON_PATCH_VERSION_STR
-
-
-
-
-
-struct daemon_info_t
-{
- //flags
- unsigned int terminated :1;
- unsigned int daemonized :1;
- unsigned int no_chdir :1;
- unsigned int no_fork :1;
- unsigned int no_close_stdio :1;
-
- const char *pid_file;
- const char *log_file;
- const char *cmd_pipe;
-};
-
-
-extern volatile struct daemon_info_t daemon_info;
-
-
-
-
-
-int redirect_stdio_to_devnull(void);
-int create_pid_file(const char *pid_file_name);
-
-
-
-void daemon_error_exit(const char *format, ...);
-void exit_if_not_daemonized(int exit_status);
-
-
-
-void daemonize2(void (*optional_init)(void *), void *data);
-
-static inline void daemonize() { daemonize2(NULL, NULL); }
-
-
-
-
-
-#endif //DAEMON_HEADER
diff --git a/src/onvif_srvd/onvif_srvd/src/eth_dev_param.cpp b/src/onvif_srvd/onvif_srvd/src/eth_dev_param.cpp
deleted file mode 100644
index a0957ea..0000000
--- a/src/onvif_srvd/onvif_srvd/src/eth_dev_param.cpp
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- * eth_dev_param.cpp
- *
- *
- * version 1.0
- *
- *
- * Copyright (c) 2015, Koynov Stas - skojnov@yandex.ru
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-#include "eth_dev_param.h"
-
-
-
-
-
-Eth_Dev_Param::Eth_Dev_Param() :
-
- //private
- _sd(-1),
- _opened(false)
-{
-}
-
-
-
-Eth_Dev_Param::~Eth_Dev_Param()
-{
-// if( is_open() )
-// this->close(); //close old socket
-}
-
-
-
-int Eth_Dev_Param::open(const char *dev_name)
-{
-
- this->close(); //close old socket
-
-
- if( !dev_name || (strlen(dev_name) >= IFNAMSIZ) )
- return -1;
-
-
- _sd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
-
- if( _sd == -1 )
- return -1;
-
-
- strcpy(_ifr.ifr_name, dev_name);
-
-
- // try get flags for interface
- if( ioctl(_sd, SIOCGIFFLAGS, &_ifr) == -1 )
- {
- this->close();
- return -1; //can't get flags
- }
-
-
- _opened = true;
- return 0; //good job
-}
-
-
-
-void Eth_Dev_Param::close()
-{
- if( _sd != -1 )
- ::close(_sd);
-
- memset(&_ifr, 0, sizeof(struct ifreq));
- _opened = false;
- _sd = -1;
-}
-
-
-
-int Eth_Dev_Param::set_ip(const char *IP)
-{
- if( !is_open() || !IP )
- return -1;
-
-
- struct sockaddr_in* addr = (struct sockaddr_in*)&_ifr.ifr_addr;
-
- memset(addr, 0, sizeof( struct sockaddr_in) );
- addr->sin_family = AF_INET;
-
- if( inet_pton(AF_INET, IP, &addr->sin_addr) <= 0 )
- return -1;
-
-
- return ioctl(_sd, SIOCSIFADDR, &_ifr);
-}
-
-
-
-int Eth_Dev_Param::set_ip(uint32_t IP)
-{
- if( !is_open() )
- return -1;
-
-
- struct sockaddr_in* addr = (struct sockaddr_in*)&_ifr.ifr_addr;
-
- memset(addr, 0, sizeof( struct sockaddr_in) );
- addr->sin_family = AF_INET;
- addr->sin_addr.s_addr = IP;
-
-
- return ioctl(_sd, SIOCSIFADDR, &_ifr);
-}
-
-
-
-int Eth_Dev_Param::get_ip(char *IP) const
-{
- if( !is_open() || !IP )
- return -1;
-
-
- if( ioctl(_sd, SIOCGIFADDR, &_ifr) != 0 )
- return -1;
-
- struct sockaddr_in* addr = (struct sockaddr_in*)&_ifr.ifr_addr;
-
-
- if( inet_ntop(AF_INET, &addr->sin_addr, IP, INET_ADDRSTRLEN) != NULL )
- return 0; //good job
-
-
- return -1;
-}
-
-
-
-int Eth_Dev_Param::get_ip(uint32_t *IP) const
-{
- if( !is_open() || !IP )
- return -1;
-
-
- if( ioctl(_sd, SIOCGIFDSTADDR, &_ifr) != 0 )
- return -1;
-
- struct sockaddr_in* addr = (struct sockaddr_in*)&_ifr.ifr_addr;
-
- *IP = addr->sin_addr.s_addr;
-
-
- return 0; //good job
-}
-
-
-
-int Eth_Dev_Param::set_mask(const char *mask)
-{
- if( !is_open() || !mask )
- return -1;
-
-
- struct sockaddr_in* addr = (struct sockaddr_in*)&_ifr.ifr_addr;
-
- memset(addr, 0, sizeof( struct sockaddr_in) );
- addr->sin_family = AF_INET;
-
- if( inet_pton(AF_INET, mask, &addr->sin_addr) <= 0 )
- return -1;
-
-
- return ioctl(_sd, SIOCSIFNETMASK, &_ifr);
-}
-
-
-
-int Eth_Dev_Param::set_mask(uint32_t mask)
-{
- if( !is_open() )
- return -1;
-
-
- struct sockaddr_in* addr = (struct sockaddr_in*)&_ifr.ifr_addr;
-
- memset(addr, 0, sizeof( struct sockaddr_in) );
- addr->sin_family = AF_INET;
- addr->sin_addr.s_addr = mask;
-
-
- return ioctl(_sd, SIOCSIFNETMASK, &_ifr);
-}
-
-
-
-int Eth_Dev_Param::get_mask(char *mask) const
-{
- if( !is_open() || !mask )
- return -1;
-
-
- if( ioctl(_sd, SIOCGIFNETMASK, &_ifr) != 0 )
- return -1;
-
- struct sockaddr_in* addr = (struct sockaddr_in*)&_ifr.ifr_addr;
-
-
- if( inet_ntop(AF_INET, &addr->sin_addr, mask, INET_ADDRSTRLEN) != NULL )
- return 0; //good job
-
-
- return -1;
-}
-
-
-
-int Eth_Dev_Param::get_mask(uint32_t *mask) const
-{
- if( !is_open() || !mask )
- return -1;
-
-
- if( ioctl(_sd, SIOCGIFNETMASK, &_ifr) != 0 )
- return -1;
-
- struct sockaddr_in* addr = (struct sockaddr_in*)&_ifr.ifr_addr;
-
- *mask = addr->sin_addr.s_addr;
-
-
- return 0; //good job
-}
-
-
-
-int Eth_Dev_Param::get_mask_prefix() const
-{
- int prefix = 0;
- uint32_t mask;
- get_mask(&mask);
-
- mask = ntohl(mask);
-
- while(mask != 0)
- {
- mask <<= 1;
- prefix++;
- }
-
- return prefix;
-}
-
-
-
-int Eth_Dev_Param::set_gateway(const char *gateway)
-{
- if( !is_open() || !gateway )
- return -1;
-
- char cmd[64];
-
-
- sprintf(cmd, "route add %s %s", gateway, _ifr.ifr_name);
-
- return run_shell_cmd(cmd);
-}
-
-
-
-int Eth_Dev_Param::set_gateway(uint32_t gateway)
-{
- if( !is_open() )
- return -1;
-
- char cmd[64];
-
- struct in_addr in;
- in.s_addr = gateway;
-
-
- sprintf(cmd, "route add %s %s", inet_ntoa(in), _ifr.ifr_name);
-
- return run_shell_cmd(cmd);
-}
-
-
-
-int Eth_Dev_Param::get_gateway(char *gateway) const
-{
- if( !is_open() || !gateway )
- return -1;
-
- uint32_t tmp_gateway;
-
- struct sockaddr_in s_addr;
-
- if( get_gateway(&tmp_gateway) != 0 )
- return -1;
-
- memset(&s_addr, 0, sizeof(struct sockaddr_in));
- s_addr.sin_family = AF_INET;
- s_addr.sin_addr.s_addr = tmp_gateway;
-
-
- if( inet_ntop(AF_INET, &s_addr.sin_addr, gateway, INET_ADDRSTRLEN) != NULL )
- return 0; //good job
- else
- return -1;
-}
-
-
-
-int Eth_Dev_Param::get_gateway(uint32_t *gateway) const
-{
- if( !is_open() || !gateway )
- return -1;
-
-
- char devname[64];
- unsigned long d, g, m;
- int flgs, ref, use, metric, mtu, win, ir;
-
-
- FILE *fp = fopen("/proc/net/route", "r");
-
- if( !fp )
- return -1; //can't open file
-
-
- if( fscanf(fp, "%*[^\n]\n") < 0 ) // Skip the first line
- {
- fclose(fp);
- return -1; // Empty or missing line, or read error
- }
-
-
- while( !feof(fp) )
- {
- int r;
- r = fscanf(fp, "%63s%lx%lx%X%d%d%d%lx%d%d%d\n",
- devname, &d, &g, &flgs, &ref, &use, &metric, &m, &mtu, &win, &ir);
-
-
- if (r != 11)
- {
- fclose(fp);
- return -1;
- }
-
- if( strcmp(devname, _ifr.ifr_name) != 0 )
- continue;
-
- fclose(fp);
- *gateway = g;
-
- return 0; //good job
- }
-
-
- fclose(fp);
- return -1; //can't finde
-}
-
-
-
-int Eth_Dev_Param::set_hwaddr(const char *hwaddr)
-{
-
- if( !is_open() || !hwaddr || (strlen(hwaddr) != 17) )
- return -1;
-
-
- int tmp_mac[6]; // int for sscanf!!!
-
-
- sscanf(hwaddr, "%x:%x:%x:%x:%x:%x", &tmp_mac[0], &tmp_mac[1], &tmp_mac[2], &tmp_mac[3], &tmp_mac[4], &tmp_mac[5]);
-
-
- _ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER;
-
- for(int i = 0; i < 6; i++)
- _ifr.ifr_hwaddr.sa_data[i] = tmp_mac[i];
-
-
- return ioctl(_sd, SIOCSIFHWADDR, &_ifr);
-}
-
-
-
-int Eth_Dev_Param::set_hwaddr(const uint8_t *hwaddr)
-{
- if( !is_open() || !hwaddr )
- return -1;
-
-
- _ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER;
- memcpy(_ifr.ifr_hwaddr.sa_data, hwaddr, 6);
-
-
- char cmd[32];
-
- sprintf(cmd, "ifconfig %s down", dev_name());
- run_shell_cmd(cmd);
-
- int ret = ioctl(_sd, SIOCSIFHWADDR, &_ifr);
-
- sprintf(cmd, "ifconfig %s up", dev_name());
- run_shell_cmd(cmd);
-
-
- return ret;
-}
-
-
-
-int Eth_Dev_Param::get_hwaddr(char *hwaddr) const
-{
- if( !is_open() || !hwaddr )
- return -1;
-
-
- if( ioctl(_sd, SIOCGIFHWADDR, &_ifr) != 0 )
- return -1;
-
-
- if( _ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER )
- return -1;
-
-
- uint8_t *tmp_mac = (uint8_t *)_ifr.ifr_hwaddr.sa_data;
-
-
- sprintf(hwaddr, "%02x:%02x:%02x:%02x:%02x:%02x",
- tmp_mac[0], tmp_mac[1], tmp_mac[2], tmp_mac[3], tmp_mac[4], tmp_mac[5]);
-
-
- return 0; //good job
-}
-
-
-
-int Eth_Dev_Param::get_hwaddr(uint8_t *hwaddr) const
-{
- if( !is_open() || !hwaddr )
- return -1;
-
-
- if( ioctl(_sd, SIOCGIFHWADDR, &_ifr) != 0 )
- return -1;
-
-
- if( _ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER )
- return -1;
-
-
- memcpy(hwaddr, _ifr.ifr_hwaddr.sa_data, 6);
-
-
- return 0; //good job
-}
-
-
-
-int Eth_Dev_Param::run_shell_cmd(const char *cmd) const
-{
- FILE *ptr;
-
- if(!cmd)
- return -1;
-
-
- ptr = popen(cmd, "w");
- if(!ptr)
- return -1;
-
-
- if(pclose(ptr)<0)
- return -1;
-
-
- return 0; //good job
-}
diff --git a/src/onvif_srvd/onvif_srvd/src/eth_dev_param.h b/src/onvif_srvd/onvif_srvd/src/eth_dev_param.h
deleted file mode 100644
index d14c9d5..0000000
--- a/src/onvif_srvd/onvif_srvd/src/eth_dev_param.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * eth_dev_param.h
- *
- *
- * version 1.0
- *
- *
- * Copyright (c) 2015, Koynov Stas - skojnov@yandex.ru
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ETH_DEV_PARAM_H
-#define ETH_DEV_PARAM_H
-
-#include
-#include
-
-
-
-
-
-class Eth_Dev_Param
-{
- public:
- Eth_Dev_Param();
- ~Eth_Dev_Param();
-
- bool is_open() const { return _opened; }
-
- int open(const char *dev_name);
- void close();
-
- const char *dev_name() const { return _ifr.ifr_name; }
-
-
- int set_ip(const char *IP);
- int set_ip(uint32_t IP);
-
- int get_ip(char *IP) const;
- int get_ip(uint32_t *IP) const;
-
-
- int set_mask(const char *mask);
- int set_mask(uint32_t mask);
-
- int get_mask(char *mask) const;
- int get_mask(uint32_t *mask) const;
- int get_mask_prefix() const;
-
-
- int set_gateway(const char *gateway);
- int set_gateway(uint32_t gateway);
-
- int get_gateway(char *gateway) const;
- int get_gateway(uint32_t *gateway) const;
-
-
- int set_hwaddr(const char *hwaddr);
- int set_hwaddr(const uint8_t *hwaddr);
-
- int get_hwaddr(char *hwaddr) const;
- int get_hwaddr(uint8_t *hwaddr) const;
-
-
- private:
- int _sd;
- bool _opened;
- struct ifreq _ifr;
-
- int run_shell_cmd(const char *cmd) const;
-};
-
-
-
-
-
-#endif // ETH_DEV_PARAM_H
diff --git a/src/onvif_srvd/onvif_srvd/src/onvif_srvd.cpp b/src/onvif_srvd/onvif_srvd/src/onvif_srvd.cpp
deleted file mode 100644
index 716071d..0000000
--- a/src/onvif_srvd/onvif_srvd/src/onvif_srvd.cpp
+++ /dev/null
@@ -1,539 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-#include "daemon.h"
-#include "smacros.h"
-#include "ServiceContext.h"
-
-// ---- gsoap ----
-#include "DeviceBinding.nsmap"
-#include "soapDeviceBindingService.h"
-#include "soapMediaBindingService.h"
-#include "soapPTZBindingService.h"
-
-
-
-
-
-static const char *help_str =
- " =============== Help ===============\n"
- " Daemon name: " DAEMON_NAME "\n"
- " Daemon ver: " DAEMON_VERSION_STR "\n"
-#ifdef DEBUG
- " Build mode: debug\n"
-#else
- " Build mode: release\n"
-#endif
- " Build date: " __DATE__ "\n"
- " Build time: " __TIME__ "\n\n"
- "Options: description:\n\n"
- " --no_chdir Don't change the directory to '/'\n"
- " --no_fork Don't do fork\n"
- " --no_close Don't close standart IO files\n"
- " --pid_file [value] Set pid file name\n"
- " --log_file [value] Set log file name\n\n"
- " --port [value] Set socket port for Services (default = 1000)\n"
- " --user [value] Set user name for Services (default = admin)\n"
- " --password [value] Set user password for Services (default = admin)\n"
- " --model [value] Set model device for Services (default = Model)\n"
- " --scope [value] Set scope for Services (default don't set)\n"
- " --ifs [value] Set Net interfaces for work (default don't set)\n"
- " --hardware_id [value] Set Hardware ID of device (default = HardwareID)\n"
- " --serial_num [value] Set Serial number of device (default = SerialNumber)\n"
- " --firmware_ver [value] Set firmware version of device (default = FirmwareVersion)\n"
- " --manufacturer [value] Set manufacturer for Services (default = Manufacturer)\n\n"
- " --name [value] Set Name for Profile Media Services\n"
- " --width [value] Set Width for Profile Media Services\n"
- " --height [value] Set Height for Profile Media Services\n"
- " --url [value] Set URL (or template URL) for Profile Media Services\n"
- " --snapurl [value] Set URL (or template URL) for Snapshot\n"
- " in template mode %s will be changed to IP of interface (see opt ifs)\n"
- " --type [value] Set Type for Profile Media Services (JPEG|MPEG4|H264)\n"
- " It is also a sign of the end of the profile parameters\n\n"
- " --ptz Enable PTZ support\n"
- " --move_left [value] Set process to call for PTZ pan left movement\n"
- " --move_right [value] Set process to call for PTZ pan right movement\n"
- " --move_up [value] Set process to call for PTZ tilt up movement\n"
- " --move_down [value] Set process to call for PTZ tilt down movement\n"
- " --move_stop [value] Set process to call for PTZ stop movement\n"
- " --move_preset [value] Set process to call for PTZ goto preset movement\n"
- " -v, --version Display daemon version\n"
- " -h, --help Display this help\n\n";
-
-
-
-
-// indexes for long_opt function
-namespace LongOpts
-{
- enum
- {
- version = 'v',
- help = 'h',
-
- //daemon options
- no_chdir = 1,
- no_fork,
- no_close,
- pid_file,
- log_file,
-
- //ONVIF Service options (context)
- port,
- user,
- password,
- manufacturer,
- model,
- firmware_ver,
- serial_num,
- hardware_id,
- scope,
- ifs,
-
- //Media Profile for ONVIF Media Service
- name,
- width,
- height,
- url,
- snapurl,
- type,
-
- //PTZ Profile for ONVIF PTZ Service
- ptz,
- move_left,
- move_right,
- move_up,
- move_down,
- move_stop,
- move_preset
- };
-}
-
-
-
-static const char *short_opts = "hv";
-
-
-static const struct option long_opts[] =
-{
- { "version", no_argument, NULL, LongOpts::version },
- { "help", no_argument, NULL, LongOpts::help },
-
- //daemon options
- { "no_chdir", no_argument, NULL, LongOpts::no_chdir },
- { "no_fork", no_argument, NULL, LongOpts::no_fork },
- { "no_close", no_argument, NULL, LongOpts::no_close },
- { "pid_file", required_argument, NULL, LongOpts::pid_file },
- { "log_file", required_argument, NULL, LongOpts::log_file },
-
- //ONVIF Service options (context)
- { "port", required_argument, NULL, LongOpts::port },
- { "user", required_argument, NULL, LongOpts::user },
- { "password", required_argument, NULL, LongOpts::password },
- { "manufacturer", required_argument, NULL, LongOpts::manufacturer },
- { "model", required_argument, NULL, LongOpts::model },
- { "firmware_ver", required_argument, NULL, LongOpts::firmware_ver },
- { "serial_num", required_argument, NULL, LongOpts::serial_num },
- { "hardware_id", required_argument, NULL, LongOpts::hardware_id },
- { "scope", required_argument, NULL, LongOpts::scope },
- { "ifs", required_argument, NULL, LongOpts::ifs },
-
- //Media Profile for ONVIF Media Service
- { "name", required_argument, NULL, LongOpts::name },
- { "width", required_argument, NULL, LongOpts::width },
- { "height", required_argument, NULL, LongOpts::height },
- { "url", required_argument, NULL, LongOpts::url },
- { "snapurl", required_argument, NULL, LongOpts::snapurl },
- { "type", required_argument, NULL, LongOpts::type },
-
- //PTZ Profile for ONVIF PTZ Service
- { "ptz", no_argument, NULL, LongOpts::ptz },
- { "move_left", required_argument, NULL, LongOpts::move_left },
- { "move_right", required_argument, NULL, LongOpts::move_right },
- { "move_up", required_argument, NULL, LongOpts::move_up },
- { "move_down", required_argument, NULL, LongOpts::move_down },
- { "move_stop", required_argument, NULL, LongOpts::move_stop },
- { "move_preset", required_argument, NULL, LongOpts::move_preset },
-
- { NULL, no_argument, NULL, 0 }
-};
-
-
-
-
-
-#define FOREACH_SERVICE(APPLY, soap) \
- APPLY(DeviceBindingService, soap) \
- APPLY(MediaBindingService, soap) \
- APPLY(PTZBindingService, soap) \
-
-
-/*
- * If you need support for other services,
- * add the desired option to the macro FOREACH_SERVICE.
- *
- * Note: Do not forget to add the gsoap binding class for the service,
- * and the implementation methods for it, like for DeviceBindingService
-
-
-
- APPLY(ImagingBindingService, soap) \
- APPLY(PTZBindingService, soap) \
- APPLY(RecordingBindingService, soap) \
- APPLY(ReplayBindingService, soap) \
- APPLY(SearchBindingService, soap) \
- APPLY(ReceiverBindingService, soap) \
- APPLY(DisplayBindingService, soap) \
- APPLY(EventBindingService, soap) \
- APPLY(PullPointSubscriptionBindingService, soap) \
- APPLY(NotificationProducerBindingService, soap) \
- APPLY(SubscriptionManagerBindingService, soap) \
-*/
-
-
-#define DECLARE_SERVICE(service, soap) service service ## _inst(soap);
-
-#define DISPATCH_SERVICE(service, soap) \
- else if (service ## _inst.dispatch() != SOAP_NO_METHOD) {\
- soap_send_fault(soap); \
- soap_stream_fault(soap, std::cerr); \
- }
-
-
-
-
-static struct soap *soap;
-
-ServiceContext service_ctx;
-
-
-
-
-
-void daemon_exit_handler(int sig)
-{
- //Here we release resources
-
- UNUSED(sig);
- soap_destroy(soap); // delete managed C++ objects
- soap_end(soap); // delete managed memory
- soap_free(soap); // free the context
-
-
- unlink(daemon_info.pid_file);
-
-
- exit(EXIT_SUCCESS); // good job (we interrupted (finished) main loop)
-}
-
-
-
-void init_signals(void)
-{
- struct sigaction sa;
-
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = daemon_exit_handler;
- if( sigaction(SIGTERM, &sa, NULL) != 0 )
- daemon_error_exit("Can't set daemon_exit_handler: %m\n");
-
-
- signal(SIGCHLD, SIG_IGN); // ignore child
- signal(SIGTSTP, SIG_IGN); // ignore tty signals
- signal(SIGTTOU, SIG_IGN);
- signal(SIGTTIN, SIG_IGN);
- signal(SIGHUP, SIG_IGN);
-}
-
-
-
-void processing_cmd(int argc, char *argv[])
-{
- int opt;
-
- StreamProfile profile;
-
-
- while( (opt = getopt_long(argc, argv, short_opts, long_opts, NULL)) != -1 )
- {
- switch( opt )
- {
-
- case LongOpts::help:
- puts(help_str);
- exit_if_not_daemonized(EXIT_SUCCESS);
- break;
-
- case LongOpts::version:
- puts(DAEMON_NAME " version " DAEMON_VERSION_STR "\n");
- exit_if_not_daemonized(EXIT_SUCCESS);
- break;
-
-
- //daemon options
- case LongOpts::no_chdir:
- daemon_info.no_chdir = 1;
- break;
-
- case LongOpts::no_fork:
- daemon_info.no_fork = 1;
- break;
-
- case LongOpts::no_close:
- daemon_info.no_close_stdio = 1;
- break;
-
- case LongOpts::pid_file:
- daemon_info.pid_file = optarg;
- break;
-
- case LongOpts::log_file:
- daemon_info.log_file = optarg;
- break;
-
-
- //ONVIF Service options (context)
- case LongOpts::port:
- service_ctx.port = atoi(optarg);
- break;
-
- case LongOpts::user:
- service_ctx.user = optarg;
- break;
-
- case LongOpts::password:
- service_ctx.password = optarg;
- break;
-
- case LongOpts::manufacturer:
- service_ctx.manufacturer = optarg;
- break;
-
- case LongOpts::model:
- service_ctx.model = optarg;
- break;
-
- case LongOpts::firmware_ver:
- service_ctx.firmware_version = optarg;
- break;
-
- case LongOpts::serial_num:
- service_ctx.serial_number = optarg;
- break;
-
- case LongOpts::hardware_id:
- service_ctx.hardware_id = optarg;
- break;
-
- case LongOpts::scope:
- service_ctx.scopes.push_back(optarg);
- break;
-
- case LongOpts::ifs:
- service_ctx.eth_ifs.push_back(Eth_Dev_Param());
-
- if( service_ctx.eth_ifs.back().open(optarg) != 0 )
- daemon_error_exit("Can't open ethernet interface: %s - %m\n", optarg);
-
- break;
-
-
- //Media Profile for ONVIF Media Service
- case LongOpts::name:
- if( !profile.set_name(optarg) )
- daemon_error_exit("Can't set name for Profile: %s\n", profile.get_cstr_err());
-
- break;
-
-
- case LongOpts::width:
- if( !profile.set_width(optarg) )
- daemon_error_exit("Can't set width for Profile: %s\n", profile.get_cstr_err());
-
- break;
-
-
- case LongOpts::height:
- if( !profile.set_height(optarg) )
- daemon_error_exit("Can't set height for Profile: %s\n", profile.get_cstr_err());
-
- break;
-
-
- case LongOpts::url:
- if( !profile.set_url(optarg) )
- daemon_error_exit("Can't set URL for Profile: %s\n", profile.get_cstr_err());
-
- break;
-
-
- case LongOpts::snapurl:
- if( !profile.set_snapurl(optarg) )
- daemon_error_exit("Can't set URL for Snapshot: %s\n", profile.get_cstr_err());
-
- break;
-
-
- case LongOpts::type:
- if( !profile.set_type(optarg) )
- daemon_error_exit("Can't set type for Profile: %s\n", profile.get_cstr_err());
-
- if( !service_ctx.add_profile(profile) )
- daemon_error_exit("Can't add Profile: %s\n", service_ctx.get_cstr_err());
-
- profile.clear(); //now we can add new profile (just uses one variable)
-
- break;
-
-
- //PTZ Profile for ONVIF PTZ Service
- case LongOpts::ptz:
- service_ctx.get_ptz_node()->enable = true;
- break;
-
-
- case LongOpts::move_left:
- if( !service_ctx.get_ptz_node()->set_move_left(optarg) )
- daemon_error_exit("Can't set process for pan left movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
-
- break;
-
-
- case LongOpts::move_right:
- if( !service_ctx.get_ptz_node()->set_move_right(optarg) )
- daemon_error_exit("Can't set process for pan right movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
-
- break;
-
-
- case LongOpts::move_up:
- if( !service_ctx.get_ptz_node()->set_move_up(optarg) )
- daemon_error_exit("Can't set process for tilt up movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
-
- break;
-
-
- case LongOpts::move_down:
- if( !service_ctx.get_ptz_node()->set_move_down(optarg) )
- daemon_error_exit("Can't set process for tilt down movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
-
- break;
-
-
- case LongOpts::move_stop:
- if( !service_ctx.get_ptz_node()->set_move_stop(optarg) )
- daemon_error_exit("Can't set process for stop movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
-
- break;
-
-
- case LongOpts::move_preset:
- if( !service_ctx.get_ptz_node()->set_move_preset(optarg) )
- daemon_error_exit("Can't set process for goto preset movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
-
- break;
-
-
- default:
- puts("for more detail see help\n\n");
- exit_if_not_daemonized(EXIT_FAILURE);
- break;
- }
- }
-}
-
-
-
-void check_service_ctx(void)
-{
- if(service_ctx.eth_ifs.empty())
- daemon_error_exit("Error: not set no one ehternet interface more details see opt --ifs\n");
-
-
- if(service_ctx.scopes.empty())
- daemon_error_exit("Error: not set scopes more details see opt --scope\n");
-
-
- if(service_ctx.get_profiles().empty())
- daemon_error_exit("Error: not set no one profile more details see --help\n");
-}
-
-
-
-void init_gsoap(void)
-{
- soap = soap_new();
-
- if(!soap)
- daemon_error_exit("Can't get mem for SOAP\n");
-
-
- soap->bind_flags = SO_REUSEADDR;
-
- if( !soap_valid_socket(soap_bind(soap, NULL, service_ctx.port, 10)) )
- {
- soap_stream_fault(soap, std::cerr);
- exit(EXIT_FAILURE);
- }
-
- soap->send_timeout = 3; // timeout in sec
- soap->recv_timeout = 3; // timeout in sec
-
-
- //save pointer of service_ctx in soap
- soap->user = (void*)&service_ctx;
-}
-
-
-
-void init(void *data)
-{
- UNUSED(data);
- init_signals();
- check_service_ctx();
- init_gsoap();
-}
-
-
-
-int main(int argc, char *argv[])
-{
- processing_cmd(argc, argv);
- daemonize2(init, NULL);
-
- FOREACH_SERVICE(DECLARE_SERVICE, soap)
-
- while( true )
- {
- // wait new client
- if( !soap_valid_socket(soap_accept(soap)) )
- {
- soap_stream_fault(soap, std::cerr);
- return EXIT_FAILURE;
- }
-
-
- // process service
- if( soap_begin_serve(soap) )
- {
- soap_stream_fault(soap, std::cerr);
- }
- FOREACH_SERVICE(DISPATCH_SERVICE, soap)
- else
- {
- DEBUG_MSG("Unknown service\n");
- }
-
- soap_destroy(soap); // delete managed C++ objects
- soap_end(soap); // delete managed memory
- }
-
-
- return EXIT_FAILURE; // Error, normal exit from the main loop only through the signal handler.
-}
diff --git a/src/onvif_srvd/onvif_srvd/src/smacros.h b/src/onvif_srvd/onvif_srvd/src/smacros.h
deleted file mode 100644
index 71b91ec..0000000
--- a/src/onvif_srvd/onvif_srvd/src/smacros.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * smacros.h
- *
- *
- * version 1.1
- *
- *
- * BSD 3-Clause License
- *
- * Copyright (c) 2015, Koynov Stas - skojnov@yandex.ru
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *
- * more details see https://github.com/KoynovStas/smacros
- */
-
-#ifndef SMACROS_HEADER
-#define SMACROS_HEADER
-
-
-#include
-#include //for offsetof
-
-
-
-
-
-#ifdef __cplusplus
- #define EXTERN_PREFIX extern "C"
-#else
- #define EXTERN_PREFIX extern
-#endif
-
-
-
-
-
-#define SET_BIT(reg, num_bit) ( (reg) |= (1 << (num_bit)) )
-#define CLR_BIT(reg, num_bit) ( (reg) &= ~(1 << (num_bit)) )
-#define INV_BIT(reg, num_bit) ( (reg) ^= (1 << (num_bit)) )
-
-
-#define SET_FLAG(reg, flag) ( (reg) |= (flag) )
-#define CLR_FLAG(reg, flag) ( (reg) &= ~(flag) )
-#define INV_FLAG(reg, flag) ( (reg) ^= (flag) )
-
-
-
-
-
-//The count of elements in the array.
-#define COUNT_ELEMENTS(array) (sizeof(array) / sizeof(array[0]))
-
-
-
-
-/*
- * For GCC 4.6 or higher, in C++ you can use a standard right static_assert(exp, msg) in *.c and in *.h files.
- * For GCC 4.6 is required to add CFLAGS += -std="c++0x"
- * Simple C (gcc) have static_assert in std=c11.
- * A lot of variants, it is the most simple and intuitive
- * It can be used in *.c and in *.h files. (macros that use function style can be used in *.c files only)
- *
- * Disadvantages: you can not be set msg to display the console when compiling
- *
- * Example:
- *
- * STATIC_ASSERT( sizeof(char) == 1) //good job
- * STATIC_ASSERT( sizeof(char) != 1) //You will get a compilation error
-*/
-#define ASSERT_CONCAT_(a, b) a##b
-#define ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b)
-#define STATIC_ASSERT(expr) \
- enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(int)(!!(expr)) }
-
-
-
-
-
-#define DEF_TO_STR_(text) #text
-#define DEF_TO_STR(arg) DEF_TO_STR_(arg)
-
-
-
-
-
-// align must be a power of two.
-// Alignment takes place upwards.
-#define ALIGNMENT(val, align) ( ((val) + (align)) & ~( (align) - 1) )
-
-
-
-
-
-// Macros to convert the time in microseconds
-// t have to have struct timespec type
-// TIME_IN_USEC2 is fast variant (have not mul)
-#define TIME_IN_USEC(t) (uint32_t)(t.tv_usec + t.tv_sec * 1000000)
-#define TIME_IN_USEC2(t) (uint32_t)(t.tv_usec + (t.tv_sec << 20) )
-
-
-
-
-
-#define FREE_AND_NULL(ptr_var) ({ \
- free(ptr_var); \
- ptr_var = NULL; \
- })
-
-
-
-#define DELETE_AND_NULL(ptr_var) ({ \
- delete (ptr_var); \
- ptr_var = NULL; \
- })
-
-
-
-#define DELETE_ARRAY_AND_NULL(ptr_var) ({ \
- delete [] (ptr_var); \
- ptr_var = NULL; \
- })
-
-
-
-
-
-#ifdef DEBUG
- #include
-
- #define DEBUG_MSG(...) printf(__VA_ARGS__)
- #define FDEBUG_MSG(fp, ...) fprintf(fp, __VA_ARGS__)
-#else
- #define DEBUG_MSG(...) ({})
- #define FDEBUG_MSG(fp, ...) ({})
-#endif
-
-
-
-#define UNUSED(var) (void)var
-
-
-
-// container_of - cast a member of a structure out to the containing structure
-// ptr: the pointer to the member.
-// type: the type of the container struct this is embedded in.
-// member: the name of the member within the struct.
-//
-#define container_of( ptr, type, member ) \
- ({ (type *)( (const char *)ptr - offsetof(type, member) ); })
-
-
-
-
-/*
- * gSOAP generate a lot of handlers(callbacks) for ONVIF
- * Most of them are empty. Almost everyone takes two arguments,
- * the second is named the first_name + Response.
- * This macro allows you to write the basic behavior in one line:
- * Disable the compiler warning about unused arguments and
- * display a message for the Debug mode.
- */
-#define SOAP_EMPTY_HANDLER(arg1, str_prefix) \
- UNUSED(arg1); \
- UNUSED(arg1##Response); \
- DEBUG_MSG(str_prefix ": %s\n", __FUNCTION__); \
- return SOAP_OK \
-
-
-
-
-
-#endif //SMACROS_HEADER
diff --git a/src/onvif_srvd/onvif_srvd/src/stools.h b/src/onvif_srvd/onvif_srvd/src/stools.h
deleted file mode 100644
index 395d299..0000000
--- a/src/onvif_srvd/onvif_srvd/src/stools.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef STOOLS_H
-#define STOOLS_H
-
-#include
-#include
-
-#include "soapH.h"
-
-
-
-
-
-template
-T* soap_new_ptr(struct soap* soap, T value)
-{
- T* ptr = (T*)soap_malloc(soap, sizeof(T));
- *ptr = value;
-
- return ptr;
-}
-
-
-
-
-
-#endif // STOOLS_H
diff --git a/src/onvif_srvd/onvif_srvd/start_scripts/S90onvif_srvd b/src/onvif_srvd/onvif_srvd/start_scripts/S90onvif_srvd
deleted file mode 100755
index d57beb9..0000000
--- a/src/onvif_srvd/onvif_srvd/start_scripts/S90onvif_srvd
+++ /dev/null
@@ -1,63 +0,0 @@
-#! /bin/sh
-
-DAEMON=onvif_srvd_debug
-DAEMON_PATH=.
-PID_FILE=$DAEMON.pid
-
-DAEMON_ARGS="--pid_file $PID_FILE"
-
-
-# ONVIF Device Service param (more details see help)
-DAEMON_ARGS="$DAEMON_ARGS --ifs eth0"
-DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/name/TestDev"
-DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/location/Unknow"
-DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/Profile/Streaming"
-DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/Profile/S"
-DAEMON_ARGS="$DAEMON_ARGS --name RTSP --width 800 --height 600 --url rtsp://%s:554/unicast --type JPEG"
-
-
-
-d_start()
-{
- if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE); then
- echo "$DAEMON already running"
- return 1
- fi
-
- echo "Starting $DAEMON..."
- $DAEMON_PATH/$DAEMON $DAEMON_ARGS && echo "$DAEMON started"
-}
-
-
-
-d_stop()
-{
- if [ ! -f "$PID_FILE" ] || ! kill -0 $(cat "$PID_FILE"); then
- echo "$DAEMON not running"
- return 1
- fi
-
- echo "Stopping $DAEMON..."
- kill -15 $(cat $PID_FILE) && rm -f $PID_FILE
- echo "$DAEMON stopped"
-}
-
-
-
-case "$1" in
- start)
- d_start
- ;;
- stop)
- d_stop
- ;;
- restart)
- echo "Restarting $DAEMON"
- d_stop
- d_start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- exit 1
- ;;
-esac
diff --git a/src/onvif_srvd/onvif_srvd/start_scripts/onvif_srvd.service b/src/onvif_srvd/onvif_srvd/start_scripts/onvif_srvd.service
deleted file mode 100644
index 732bd72..0000000
--- a/src/onvif_srvd/onvif_srvd/start_scripts/onvif_srvd.service
+++ /dev/null
@@ -1,31 +0,0 @@
-[Unit]
-Description=ONVIF Device(IP camera) Service server
-After=syslog.target
-After=network-online.target
-
-
-
-[Service]
-Type=forking
-WorkingDirectory=/home/xxx/bin
-PIDFile=/tmp/onvif_srvd.pid
-ExecStart=/home/xxx/bin/onvif_srvd \
- --pid_file /tmp/onvif_srvd.pid \
- --ifs eth0 \
- --scope onvif://www.onvif.org/name/TestDev \
- --scope onvif://www.onvif.org/location/Unknow \
- --scope onvif://www.onvif.org/Profile/Streaming \
- --scope onvif://www.onvif.org/Profile/S \
- --name RTSP --width 1200 --height 720 --url rtsp://%%s:554/unicast --type JPEG
-
-TimeoutSec=4
-
-
-
-Restart=always
-RestartSec=2
-StartLimitBurst=0
-
-
-[Install]
-WantedBy=multi-user.target
diff --git a/src/onvif_srvd/onvif_srvd/wsdl/b-2.xsd b/src/onvif_srvd/onvif_srvd/wsdl/b-2.xsd
deleted file mode 100644
index 5c5b04d..0000000
--- a/src/onvif_srvd/onvif_srvd/wsdl/b-2.xsd
+++ /dev/null
@@ -1,580 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/onvif_srvd/onvif_srvd/wsdl/bf-2.xsd b/src/onvif_srvd/onvif_srvd/wsdl/bf-2.xsd
deleted file mode 100644
index 578ad30..0000000
--- a/src/onvif_srvd/onvif_srvd/wsdl/bf-2.xsd
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
- Get access to the xml: attribute groups for xml:lang as declared on 'schema'
- and 'documentation' below
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/onvif_srvd/onvif_srvd/wsdl/common.xsd b/src/onvif_srvd/onvif_srvd/wsdl/common.xsd
deleted file mode 100644
index 44ba72c..0000000
--- a/src/onvif_srvd/onvif_srvd/wsdl/common.xsd
+++ /dev/null
@@ -1,161 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Pan/tilt coordinate space selector. The following options are defined:
- http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace
- http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace
- http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace
- http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace
-
-
-
-
-
-
-
-
-
-
- Zoom coordinate space selector. The following options are defined:
- http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace
- http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace
- http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace
- http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace
-
-
-
-
-
-
-
-
-
- Pan and tilt position. The x component corresponds to pan and the y component to tilt.
-
-
-
-
-
- A zoom position.
-
-
-
-
-
-
-
-
-
-
- Specifies the absolute position of the PTZ unit together with the Space references. The default absolute spaces of the corresponding PTZ configuration MUST be referenced within the Position element.
-
-
-
-
-
-
- Indicates if the Pan/Tilt/Zoom device unit is currently moving, idle or in an unknown state.
-
-
-
-
-
-
- States a current PTZ error.
-
-
-
-
-
-
- Specifies the UTC time when this status was generated.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/onvif_srvd/onvif_srvd/wsdl/devicemgmt.wsdl b/src/onvif_srvd/onvif_srvd/wsdl/devicemgmt.wsdl
deleted file mode 100644
index 0c0c6a0..0000000
--- a/src/onvif_srvd/onvif_srvd/wsdl/devicemgmt.wsdl
+++ /dev/null
@@ -1,4207 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates if the service capabilities (untyped) should be included in the response.
-
-
-
-
-
-
-
-
-
-
- Each Service element contains information about one service.
-
-
-
-
-
-
-
-
-
-
- Namespace of the service being described. This parameter allows to match the service capabilities to the service. Note that only one set of capabilities is supported per namespace.
-
-
-
-
- The transport addresses where the service can be reached. The scheme and IP part shall match the one used in the request (i.e. the GetServices request).
-
-
-
-
-
-
-
- The placeholder for the service capabilities. The service capability element shall be returned here. For example for the device service that would be the tds:DeviceServiceCapabilities element (not complextype).
-
-
-
-
-
-
-
- The version of the service (not the ONVIF core spec version).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The capabilities for the device service is returned in the Capabilities element.
-
-
-
-
-
-
-
-
-
-
- Network capabilities.
-
-
-
-
- Security capabilities.
-
-
-
-
- System capabilities.
-
-
-
-
- Capabilities that do not fit in any of the other categories.
-
-
-
-
-
-
-
-
-
- Indicates support for IP filtering.
-
-
-
-
- Indicates support for zeroconf.
-
-
-
-
- Indicates support for IPv6.
-
-
-
-
- Indicates support for dynamic DNS configuration.
-
-
-
-
- Indicates support for IEEE 802.11 configuration.
-
-
-
-
- Indicates the maximum number of Dot1X configurations supported by the device
-
-
-
-
- Indicates support for retrieval of hostname from DHCP.
-
-
-
-
- Maximum number of NTP servers supported by the devices SetNTP command.
-
-
-
-
- Indicates support for Stateful IPv6 DHCP.
-
-
-
-
-
-
-
-
-
-
-
- Indicates support for TLS 1.0.
-
-
-
-
- Indicates support for TLS 1.1.
-
-
-
-
- Indicates support for TLS 1.2.
-
-
-
-
- Indicates support for onboard key generation.
-
-
-
-
- Indicates support for access policy configuration.
-
-
-
-
- Indicates support for the ONVIF default access policy.
-
-
-
-
- Indicates support for IEEE 802.1X configuration.
-
-
-
-
- Indicates support for remote user configuration. Used when accessing another device.
-
-
-
-
- Indicates support for WS-Security X.509 token.
-
-
-
-
- Indicates support for WS-Security SAML token.
-
-
-
-
- Indicates support for WS-Security Kerberos token.
-
-
-
-
- Indicates support for WS-Security Username token.
-
-
-
-
- Indicates support for WS over HTTP digest authenticated communication layer.
-
-
-
-
- Indicates support for WS-Security REL token.
-
-
-
-
- EAP Methods supported by the device. The int values refer to the IANA EAP Registry .
-
-
-
-
- The maximum number of users that the device supports.
-
-
-
-
- Maximum number of characters supported for the username by CreateUsers.
-
-
-
-
- Maximum number of characters supported for the password by CreateUsers and SetUser.
-
-
-
-
-
-
-
-
- Indicates support for WS Discovery resolve requests.
-
-
-
-
- Indicates support for WS-Discovery Bye.
-
-
-
-
- Indicates support for remote discovery.
-
-
-
-
- Indicates support for system backup through MTOM.
-
-
-
-
- Indicates support for retrieval of system logging through MTOM.
-
-
-
-
- Indicates support for firmware upgrade through MTOM.
-
-
-
-
- Indicates support for firmware upgrade through HTTP.
-
-
-
-
- Indicates support for system backup through HTTP.
-
-
-
-
- Indicates support for retrieval of system logging through HTTP.
-
-
-
-
- Indicates support for retrieving support information through HTTP.
-
-
-
-
- Indicates support for storage configuration interfaces.
-
-
-
-
- Indicates maximum number of storage configurations supported.
-
-
-
-
- If present signals support for geo location. The value signals the supported number of entries.
-
-
-
-
- Signals support for automatic retrieval of geo location.
-
-
-
-
-
-
-
-
- Lists of commands supported by SendAuxiliaryCommand.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The manufactor of the device.
-
-
-
-
- The device model.
-
-
-
-
- The firmware version in the device.
-
-
-
-
- The serial number of the device.
-
-
-
-
- The hardware ID of the device.
-
-
-
-
-
-
-
-
-
-
-
- Defines if the date and time is set via NTP or manually.
-
-
-
-
- Automatically adjust Daylight savings if defined in TimeZone.
-
-
-
-
- The time zone in POSIX 1003.1 format
-
-
-
-
- Date and time in UTC. If time is obtained via NTP, UTCDateTime has no meaning
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains information whether system date and time are set manually or by NTP, daylight savings is on or off, time zone in POSIX 1003.1 format and system date and time in UTC and also local system date and time.
-
-
-
-
-
-
-
-
-
-
-
- Specifies the factory default action type.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the reboot message sent by the device.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the arbitary device diagnostics information.
-
-
-
-
-
-
-
-
-
-
-
- Specifies the type of system log to get.
-
-
-
-
-
-
-
-
-
-
- Contains the system log information.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a list of URI definining the device scopes. Scope parameters can be of two types: fixed and configurable. Fixed parameters can not be altered.
-
-
-
-
-
-
-
-
-
-
-
- Contains a list of scope parameters that will replace all existing configurable scope parameters.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a list of new configurable scope parameters that will be added to the existing configurable scope.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a list of URIs that should be removed from the device scope.
- Note that the response message always will match the request or an error will be returned. The use of the response is for that reason deprecated.
-
-
-
-
-
-
-
-
-
-
-
- Contains a list of URIs that has been removed from the device scope
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicator of discovery mode: Discoverable, NonDiscoverable.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicator of discovery mode: Discoverable, NonDiscoverable.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicator of discovery mode: Discoverable, NonDiscoverable.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicator of discovery mode: Discoverable, NonDiscoverable.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a list of the onvif users and following information is included in each entry: username and user level.
-
-
-
-
-
-
-
-
-
-
-
- Creates new device users and corresponding credentials. Each user entry includes: username, password and user level. Either all users are created successfully or a fault message MUST be returned without creating any user. If trying to create several users with exactly the same username the request is rejected and no users are created. If password is missing, then fault message Too weak password is returned.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Deletes users on an device and there may exist users that cannot be deleted to ensure access to the unit. Either all users are deleted successfully or a fault message MUST be returned and no users be deleted. If a username exists multiple times in the request, then a fault message is returned.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Updates the credentials for one or several users on an device. Either all change requests are processed successfully or a fault message MUST be returned. If the request contains the same username multiple times, a fault message is returned.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of categories to retrieve capability information on.
-
-
-
-
-
-
-
-
-
-
-
-
- Capability information.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the hostname information.
-
-
-
-
-
-
-
-
-
-
-
- The hostname to set.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True if the hostname shall be obtained via DHCP.
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not a reboot is required after configuration updates.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DNS information.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicate if the DNS address is to be retrieved using DHCP.
-
-
-
-
-
-
- DNS search domain.
-
-
-
-
-
-
- DNS address(es) set manually.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- NTP information.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicate if NTP address information is to be retrieved using DHCP.
-
-
-
-
-
-
- Manual NTP settings.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Dynamic DNS information.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Dynamic DNS type.
-
-
-
-
-
-
- DNS name.
-
-
-
-
-
-
- DNS record time to live.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of network interfaces.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Symbolic network interface name.
-
-
-
-
-
-
- Network interface name.
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not a reboot is required after configuration updates.
- If a device responds with RebootNeeded set to false, the device can be reached
- via the new IP address without further action. A client should be aware that a device
- may not be responsive for a short period of time until it signals availability at
- the new address via the discovery Hello messages.
- If a device responds with RebootNeeded set to true, it will be further available under
- its previous IP address. The settings will only be activated when the device is
- rebooted via the SystemReboot command.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains an array of defined protocols supported by the device. There are three protocols defined; HTTP, HTTPS and RTSP. The following parameters can be retrieved for each protocol: port and enable/disable.
-
-
-
-
-
-
-
-
-
-
-
- Configures one or more defined network protocols supported by the device. There are currently three protocols defined; HTTP, HTTPS and RTSP. The following parameters can be set for each protocol: port and enable/disable.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets the default IPv4 and IPv6 gateway settings from the device.
-
-
-
-
-
-
-
-
-
-
-
- Sets IPv4 gateway address used as default setting.
-
-
-
-
- Sets IPv6 gateway address used as default setting.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the zero-configuration.
-
-
-
-
-
-
-
-
-
-
-
- Unique identifier referencing the physical interface.
-
-
-
-
- Specifies if the zero-configuration should be enabled or not.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Certificate id.
-
-
-
-
- Identification of the entity associated with the public-key.
-
-
-
-
- Certificate validity start date.
-
-
-
-
- Certificate expiry start date.
-
-
-
-
-
-
-
-
-
-
-
- base64 encoded DER representation of certificate.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Id and base64 encoded DER representation of all available certificates.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates if a certificate is used in an optional HTTPS configuration of the device.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates if a certificate is to be used in an optional HTTPS configuration of the device.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of ids of certificates to delete.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of ids of certificates to delete.
-
-
-
-
-
-
- Relative Dinstinguished Name(RDN) CommonName(CN).
-
-
-
-
-
-
- Optional base64 encoded DER attributes.
-
-
-
-
-
-
-
-
-
-
-
-
- base64 encoded DER representation of certificate.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Optional id and base64 encoded DER representation of certificate.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not client certificates are required by device.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not client certificates are required by device.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- User name
-
-
-
-
- optional password
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- NFS protocol
-
-
-
-
- CIFS protocol
-
-
-
-
- CDMI protocol
-
-
-
-
-
-
-
-
-
- local path
-
-
-
-
- Storage server address
-
-
-
-
- User credential for the storage server
-
-
-
-
-
-
-
-
-
-
-
-
- StorageType lists the acceptable values for type attribute
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns information about services on the device.
-
-
-
-
- Returns the capabilities of the device service. The result is returned in a typed answer.
-
-
-
-
- This operation gets basic device information from the device.
-
-
-
-
- This operation sets the device system date and time. The device shall support the
- configuration of the daylight saving setting and of the manual system date and time (if
- applicable) or indication of NTP time (if applicable) through the SetSystemDateAndTime
- command.
- If system time and date are set manually, the client shall include UTCDateTime in the request.
- A TimeZone token which is not formed according to the rules of IEEE 1003.1 section 8.3 is considered as invalid timezone.
- The DayLightSavings flag should be set to true to activate any DST settings of the TimeZone string.
- Clear the DayLightSavings flag if the DST portion of the TimeZone settings should be ignored.
-
-
-
-
-
- This operation gets the device system date and time. The device shall support the return of
- the daylight saving setting and of the manual system date and time (if applicable) or indication
- of NTP time (if applicable) through the GetSystemDateAndTime command.
- A device shall provide the UTCDateTime information.
-
-
-
-
- This operation reloads the parameters on the device to their factory default values.
-
-
-
-
- This operation upgrades a device firmware version. After a successful upgrade the response
- message is sent before the device reboots. The device should support firmware upgrade
- through the UpgradeSystemFirmware command. The exact format of the firmware data is
- outside the scope of this standard.
-
-
-
-
- This operation reboots the device.
-
-
-
-
- This operation restores the system backup configuration files(s) previously retrieved from a
- device. The device should support restore of backup configuration file(s) through the
- RestoreSystem command. The exact format of the backup configuration file(s) is outside the
- scope of this standard. If the command is supported, it shall accept backup files returned by
- the GetSystemBackup command.
-
-
-
-
- This operation is retrieves system backup configuration file(s) from a device. The device
- should support return of back up configuration file(s) through the GetSystemBackup command.
- The backup is returned with reference to a name and mime-type together with binary data.
- The exact format of the backup configuration files is outside the scope of this standard.
-
-
-
-
- This operation gets a system log from the device. The exact format of the system logs is outside the scope of this standard.
-
-
-
-
- This operation gets arbitary device diagnostics information from the device.
-
-
-
-
- This operation requests the scope parameters of a device. The scope parameters are used in
- the device discovery to match a probe message, see Section 7. The Scope parameters are of
- two different types:
- Fixed scope parameters are permanent device characteristics and cannot be removed through the device management interface.
- The scope type is indicated in the scope list returned in the get scope parameters response. A device shall support
- retrieval of discovery scope parameters through the GetScopes command. As some scope parameters are mandatory,
- the device shall return a non-empty scope list in the response.
-
-
-
-
- This operation sets the scope parameters of a device. The scope parameters are used in the
- device discovery to match a probe message.
- This operation replaces all existing configurable scope parameters (not fixed parameters). If
- this shall be avoided, one should use the scope add command instead. The device shall
- support configuration of discovery scope parameters through the SetScopes command.
-
-
-
-
- This operation adds new configurable scope parameters to a device. The scope parameters
- are used in the device discovery to match a probe message. The device shall
- support addition of discovery scope parameters through the AddScopes command.
-
-
-
-
- This operation deletes scope-configurable scope parameters from a device. The scope
- parameters are used in the device discovery to match a probe message, see Section 7. The
- device shall support deletion of discovery scope parameters through the RemoveScopes
- command.
- Table
-
-
-
-
- This operation gets the discovery mode of a device. See Section 7.2 for the definition of the
- different device discovery modes. The device shall support retrieval of the discovery mode
- setting through the GetDiscoveryMode command.
-
-
-
-
- This operation sets the discovery mode operation of a device. See Section 7.2 for the
- definition of the different device discovery modes. The device shall support configuration of
- the discovery mode setting through the SetDiscoveryMode command.
-
-
-
-
- This operation gets the remote discovery mode of a device. See Section 7.4 for the definition
- of remote discovery extensions. A device that supports remote discovery shall support
- retrieval of the remote discovery mode setting through the GetRemoteDiscoveryMode
- command.
-
-
-
-
- This operation sets the remote discovery mode of operation of a device. See Section 7.4 for
- the definition of remote discovery remote extensions. A device that supports remote discovery
- shall support configuration of the discovery mode setting through the
- SetRemoteDiscoveryMode command.
-
-
-
-
- This operation gets the remote DP address or addresses from a device. If the device supports
- remote discovery, as specified in Section 7.4, the device shall support retrieval of the remote
- DP address(es) through the GetDPAddresses command.
-
-
-
-
- This operation sets the remote DP address or addresses on a device. If the device supports
- remote discovery, as specified in Section 7.4, the device shall support configuration of the
- remote DP address(es) through the SetDPAddresses command.
-
-
-
-
- A client can ask for the device service endpoint reference address property that can be used
- to derive the password equivalent for remote user operation. The device shall support the
- GetEndpointReference command returning the address property of the device service
- endpoint reference.
-
-
-
-
- This operation returns the configured remote user (if any). A device supporting remote user
- handling shall support this operation. The user is only valid for the WS-UserToken profile or
- as a HTTP / RTSP user.
- The algorithm to use for deriving the password is described in section 5.12.2.1 of the core specification.
-
-
-
-
- This operation sets the remote user. A device supporting remote user handling shall support this
- operation. The user is only valid for the WS-UserToken profile or as a HTTP / RTSP user.
- The password that is set shall always be the original (not derived) password.
- If UseDerivedPassword is set password derivation shall be done by the device when connecting to a
- remote device.The algorithm to use for deriving the password is described in section 5.12.2.1 of the core specification.
- To remove the remote user SetRemoteUser should be called without the RemoteUser parameter.
-
-
-
-
- This operation lists the registered users and corresponding credentials on a device. The
- device shall support retrieval of registered device users and their credentials for the user
- token through the GetUsers command.
-
-
-
-
- This operation creates new device users and corresponding credentials on a device for authentication purposes.
- The device shall support creation of device users and their credentials through the CreateUsers
- command. Either all users are created successfully or a fault message shall be returned
- without creating any user.
- ONVIF compliant devices are recommended to support password length of at least 28 bytes,
- as clients may follow the password derivation mechanism which results in 'password
- equivalent' of length 28 bytes, as described in section 3.1.2 of the ONVIF security white paper.
-
-
-
-
- This operation deletes users on a device. The device shall support deletion of device users and their credentials
- through the DeleteUsers command. A device may have one or more fixed users
- that cannot be deleted to ensure access to the unit. Either all users are deleted successfully or a
- fault message shall be returned and no users be deleted.
-
-
-
-
- This operation updates the settings for one or several users on a device for authentication purposes.
- The device shall support update of device users and their credentials through the SetUser command.
- Either all change requests are processed successfully or a fault message shall be returned and no change requests be processed.
-
-
-
-
- It is possible for an endpoint to request a URL that can be used to retrieve the complete
- schema and WSDL definitions of a device. The command gives in return a URL entry point
- where all the necessary product specific WSDL and schema definitions can be retrieved. The
- device shall provide a URL for WSDL and schema download through the GetWsdlUrl command.
-
-
-
-
- Any endpoint can ask for the capabilities of a device using the capability exchange request
- response operation. The device shall indicate all its ONVIF compliant capabilities through the
- GetCapabilities command.
- The capability list includes references to the addresses (XAddr) of the service implementing
- the interface operations in the category. Apart from the addresses, the
- capabilities only reflect optional functions.
-
-
-
-
- This operation is used by an endpoint to get the hostname from a device. The device shall
- return its hostname configurations through the GetHostname command.
-
-
-
-
- This operation sets the hostname on a device. It shall be possible to set the device hostname
- configurations through the SetHostname command.
- A device shall accept string formated according to RFC 1123 section 2.1 or alternatively to RFC 952,
- other string shall be considered as invalid strings.
-
-
-
-
-
- This operation controls whether the hostname is set manually or retrieved via DHCP.
-
-
-
-
- This operation gets the DNS settings from a device. The device shall return its DNS
- configurations through the GetDNS command.
-
-
-
-
- This operation sets the DNS settings on a device. It shall be possible to set the device DNS
- configurations through the SetDNS command.
-
-
-
-
- This operation gets the NTP settings from a device. If the device supports NTP, it shall be
- possible to get the NTP server settings through the GetNTP command.
-
-
-
-
- This operation sets the NTP settings on a device. If the device supports NTP, it shall be
- possible to set the NTP server settings through the SetNTP command.
- A device shall accept string formated according to RFC 1123 section 2.1 or alternatively to RFC 952,
- other string shall be considered as invalid strings.
- Changes to the NTP server list will not affect the clock mode DateTimeType. Use SetSystemDateAndTime to activate NTP operation.
-
-
-
-
-
- This operation gets the dynamic DNS settings from a device. If the device supports dynamic
- DNS as specified in [RFC 2136] and [RFC 4702], it shall be possible to get the type, name
- and TTL through the GetDynamicDNS command.
-
-
-
-
- This operation sets the dynamic DNS settings on a device. If the device supports dynamic
- DNS as specified in [RFC 2136] and [RFC 4702], it shall be possible to set the type, name
- and TTL through the SetDynamicDNS command.
-
-
-
-
- This operation gets the network interface configuration from a device. The device shall
- support return of network interface configuration settings as defined by the NetworkInterface
- type through the GetNetworkInterfaces command.
-
-
-
-
- This operation sets the network interface configuration on a device. The device shall support
- network configuration of supported network interfaces through the SetNetworkInterfaces
- command.
- For interoperability with a client unaware of the IEEE 802.11 extension a device shall retain
- its IEEE 802.11 configuration if the IEEE 802.11 configuration element isn’t present in the
- request.
-
-
-
-
- This operation gets defined network protocols from a device. The device shall support the
- GetNetworkProtocols command returning configured network protocols.
-
-
-
-
- This operation configures defined network protocols on a device. The device shall support
- configuration of defined network protocols through the SetNetworkProtocols command.
-
-
-
-
- This operation gets the default gateway settings from a device. The device shall support the
- GetNetworkDefaultGateway command returning configured default gateway address(es).
-
-
-
-
- This operation sets the default gateway settings on a device. The device shall support
- configuration of default gateway through the SetNetworkDefaultGateway command.
-
-
-
-
- This operation gets the zero-configuration from a device. If the device supports dynamic IP
- configuration according to [RFC3927], it shall support the return of IPv4 zero configuration
- address and status through the GetZeroConfiguration command.
- Devices supporting zero configuration on more than one interface shall use the extension to list the additional interface settings.
-
-
-
-
- This operation sets the zero-configuration. Use GetCapalities to get if zero-zero-configuration is supported or not.
-
-
-
-
- This operation gets the IP address filter settings from a device. If the device supports device
- access control based on IP filtering rules (denied or accepted ranges of IP addresses), the
- device shall support the GetIPAddressFilter command.
-
-
-
-
- This operation sets the IP address filter settings on a device. If the device supports device
- access control based on IP filtering rules (denied or accepted ranges of IP addresses), the
- device shall support configuration of IP filtering rules through the SetIPAddressFilter
- command.
-
-
-
-
- This operation adds an IP filter address to a device. If the device supports device access
- control based on IP filtering rules (denied or accepted ranges of IP addresses), the device
- shall support adding of IP filtering addresses through the AddIPAddressFilter command.
-
-
-
-
- This operation deletes an IP filter address from a device. If the device supports device access
- control based on IP filtering rules (denied or accepted ranges of IP addresses), the device
- shall support deletion of IP filtering addresses through the RemoveIPAddressFilter command.
-
-
-
-
- Access to different services and sub-sets of services should be subject to access control. The
- WS-Security framework gives the prerequisite for end-point authentication. Authorization
- decisions can then be taken using an access security policy. This standard does not mandate
- any particular policy description format or security policy but this is up to the device
- manufacturer or system provider to choose policy and policy description format of choice.
- However, an access policy (in arbitrary format) can be requested using this command. If the
- device supports access policy settings based on WS-Security authentication, then the device
- shall support this command.
-
-
-
-
- This command sets the device access security policy (for more details on the access security
- policy see the Get command). If the device supports access policy settings
- based on WS-Security authentication, then the device shall support this command.
-
-
-
-
- This operation generates a private/public key pair and also can create a self-signed device
- certificate as a result of key pair generation. The certificate is created using a suitable
- onboard key pair generation mechanism.
- If a device supports onboard key pair generation, the device that supports TLS shall support
- this certificate creation command. And also, if a device supports onboard key pair generation,
- the device that support IEEE 802.1X shall support this command for the purpose of key pair
- generation. Certificates and key pairs are identified using certificate IDs. These IDs are either
- chosen by the certificate generation requester or by the device (in case that no ID value is
- given).
-
-
-
-
- This operation gets all device server certificates (including self-signed) for the purpose of TLS
- authentication and all device client certificates for the purpose of IEEE 802.1X authentication.
- This command lists only the TLS server certificates and IEEE 802.1X client certificates for the
- device (neither trusted CA certificates nor trusted root certificates). The certificates are
- returned as binary data. A device that supports TLS shall support this command and the
- certificates shall be encoded using ASN.1 [X.681], [X.682], [X.683] DER [X.690] encoding
- rules.
-
-
-
-
- This operation is specific to TLS functionality. This operation gets the status
- (enabled/disabled) of the device TLS server certificates. A device that supports TLS shall
- support this command.
-
-
-
-
- This operation is specific to TLS functionality. This operation sets the status (enable/disable)
- of the device TLS server certificates. A device that supports TLS shall support this command.
- Typically only one device server certificate is allowed to be enabled at a time.
-
-
-
-
- This operation deletes a certificate or multiple certificates. The device MAY also delete a
- private/public key pair which is coupled with the certificate to be deleted. The device that
- support either TLS or IEEE 802.1X shall support the deletion of a certificate or multiple
- certificates through this command. Either all certificates are deleted successfully or a fault
- message shall be returned without deleting any certificate.
-
-
-
-
- This operation requests a PKCS #10 certificate signature request from the device. The
- returned information field shall be either formatted exactly as specified in [PKCS#10] or PEM
- encoded [PKCS#10] format. In order for this command to work, the device must already have
- a private/public key pair. This key pair should be referred by CertificateID as specified in the
- input parameter description. This CertificateID refers to the key pair generated using
- CreateCertificate command.
- A device that support onboard key pair generation that supports either TLS or IEEE 802.1X
- using client certificate shall support this command.
-
-
-
-
- TLS server certificate(s) or IEEE 802.1X client certificate(s) created using the PKCS#10
- certificate request command can be loaded into the device using this command (see Section
- 8.4.13). The certificate ID in the request shall be present. The device may sort the received
- certificate(s) based on the public key and subject information in the certificate(s).
- The certificate ID in the request will be the ID value the client wish to have. The device is
- supposed to scan the generated key pairs present in the device to identify which is the
- correspondent key pair with the loaded certificate and then make the link between the
- certificate and the key pair.
- A device that supports onboard key pair generation that support either TLS or IEEE 802.1X
- shall support this command.
- The certificates shall be encoded using ASN.1 [X.681], [X.682], [X.683] DER [X.690] encoding
- rules.
- This command is applicable to any device type, although the parameter name is called for
- historical reasons NVTCertificate.
-
-
-
-
- This operation is specific to TLS functionality. This operation gets the status
- (enabled/disabled) of the device TLS client authentication. A device that supports TLS shall
- support this command.
-
-
-
-
- This operation is specific to TLS functionality. This operation sets the status
- (enabled/disabled) of the device TLS client authentication. A device that supports TLS shall
- support this command.
-
-
-
-
- This operation gets a list of all available relay outputs and their settings.
- This method has been depricated with version 2.0. Refer to the DeviceIO service.
-
-
-
-
- This operation sets the settings of a relay output.
- This method has been depricated with version 2.0. Refer to the DeviceIO service.
-
-
-
-
- This operation sets the state of a relay output.
- This method has been depricated with version 2.0. Refer to the DeviceIO service.
-
-
-
-
- Manage auxiliary commands supported by a device, such as controlling an Infrared (IR) lamp,
- a heater or a wiper or a thermometer that is connected to the device.
- The supported commands can be retrieved via the AuxiliaryCommands capability.
- Although the name of the auxiliary commands can be freely defined, commands starting with the prefix tt: are
- reserved to define frequently used commands and these reserved commands shall all share the "tt:command|parameter" syntax.
-
- tt:Wiper|On – Request to start the wiper.
- tt:Wiper|Off – Request to stop the wiper.
- tt:Washer|On – Request to start the washer.
- tt:Washer|Off – Request to stop the washer.
- tt:WashingProcedure|On – Request to start the washing procedure.
- tt: WashingProcedure |Off – Request to stop the washing procedure.
- tt:IRLamp|On – Request to turn ON an IR illuminator attached to the unit.
- tt:IRLamp|Off – Request to turn OFF an IR illuminator attached to the unit.
- tt:IRLamp|Auto – Request to configure an IR illuminator attached to the unit so that it automatically turns ON and OFF.
-
- A device that indicates auxiliary service capability shall support this command.
-
-
-
-
- CA certificates will be loaded into a device and be used for the sake of following two cases.
- The one is for the purpose of TLS client authentication in TLS server function. The other one
- is for the purpose of Authentication Server authentication in IEEE 802.1X function. This
- operation gets all CA certificates loaded into a device. A device that supports either TLS client
- authentication or IEEE 802.1X shall support this command and the returned certificates shall
- be encoded using ASN.1 [X.681], [X.682], [X.683] DER [X.690] encoding rules.
-
-
-
-
- There might be some cases that a Certificate Authority or some other equivalent creates a
- certificate without having PKCS#10 certificate signing request. In such cases, the certificate
- will be bundled in conjunction with its private key. This command will be used for such use
- case scenarios. The certificate ID in the request is optionally set to the ID value the client
- wish to have. If the certificate ID is not specified in the request, device can choose the ID
- accordingly.
- This operation imports a private/public key pair into the device.
- The certificates shall be encoded using ASN.1 [X.681], [X.682], [X.683] DER [X.690] encoding
- rules.
- A device that does not support onboard key pair generation and support either TLS or IEEE
- 802.1X using client certificate shall support this command. A device that support onboard key
- pair generation MAY support this command. The security policy of a device that supports this
- operation should make sure that the private key is sufficiently protected.
-
-
-
-
- This operation requests the information of a certificate specified by certificate ID. The device
- should respond with its “Issuer DN”, “Subject DN”, “Key usage”, "Extended key usage”, “Key
- Length”, “Version”, “Serial Number”, “Signature Algorithm” and “Validity” data as the
- information of the certificate, as long as the device can retrieve such information from the
- specified certificate.
- A device that supports either TLS or IEEE 802.1X should support this command.
-
-
-
-
- This command is used when it is necessary to load trusted CA certificates or trusted root
- certificates for the purpose of verification for its counterpart i.e. client certificate verification in
- TLS function or server certificate verification in IEEE 802.1X function.
- A device that support either TLS or IEEE 802.1X shall support this command. As for the
- supported certificate format, either DER format or PEM format is possible to be used. But a
- device that support this command shall support at least DER format as supported format type.
- The device may sort the received certificate(s) based on the public key and subject
- information in the certificate(s). Either all CA certificates are loaded successfully or a fault
- message shall be returned without loading any CA certificate.
-
-
-
-
- This operation newly creates IEEE 802.1X configuration parameter set of the device. The
- device shall support this command if it supports IEEE 802.1X. If the device receives this
- request with already existing configuration token (Dot1XConfigurationToken) specification, the
- device should respond with 'ter:ReferenceToken ' error to indicate there is some configuration
- conflict.
-
-
-
-
- While the CreateDot1XConfiguration command is trying to create a new configuration
- parameter set, this operation modifies existing IEEE 802.1X configuration parameter set of
- the device. A device that support IEEE 802.1X shall support this command.
-
-
-
-
- This operation gets one IEEE 802.1X configuration parameter set from the device by
- specifying the configuration token (Dot1XConfigurationToken).
- A device that supports IEEE 802.1X shall support this command.
- Regardless of whether the 802.1X method in the retrieved configuration has a password or
- not, the device shall not include the Password element in the response.
-
-
-
-
- This operation gets all the existing IEEE 802.1X configuration parameter sets from the device.
- The device shall respond with all the IEEE 802.1X configurations so that the client can get to
- know how many IEEE 802.1X configurations are existing and how they are configured.
- A device that support IEEE 802.1X shall support this command.
- Regardless of whether the 802.1X method in the retrieved configuration has a password or
- not, the device shall not include the Password element in the response.
-
-
-
-
- This operation deletes an IEEE 802.1X configuration parameter set from the device. Which
- configuration should be deleted is specified by the 'Dot1XConfigurationToken' in the request.
- A device that support IEEE 802.1X shall support this command.
-
-
-
-
- This operation returns the IEEE802.11 capabilities. The device shall support
- this operation.
-
-
-
-
- This operation returns the status of a wireless network interface. The device shall support this
- command.
-
-
-
-
- This operation returns a lists of the wireless networks in range of the device. A device should
- support this operation.
-
-
-
-
- This operation is used to retrieve URIs from which system information may be downloaded
- using HTTP. URIs may be returned for the following system information:
- System Logs. Multiple system logs may be returned, of different types. The exact format of
- the system logs is outside the scope of this specification.
- Support Information. This consists of arbitrary device diagnostics information from a device.
- The exact format of the diagnostic information is outside the scope of this specification.
- System Backup. The received file is a backup file that can be used to restore the current
- device configuration at a later date. The exact format of the backup configuration file is
- outside the scope of this specification.
- If the device allows retrieval of system logs, support information or system backup data, it
- should make them available via HTTP GET. If it does, it shall support the GetSystemUris
- command.
-
-
-
-
- This operation initiates a firmware upgrade using the HTTP POST mechanism. The response
- to the command includes an HTTP URL to which the upgrade file may be uploaded. The
- actual upgrade takes place as soon as the HTTP POST operation has completed. The device
- should support firmware upgrade through the StartFirmwareUpgrade command. The exact
- format of the firmware data is outside the scope of this specification.
- Firmware upgrade over HTTP may be achieved using the following steps:
- Client calls StartFirmwareUpgrade.
- Server responds with upload URI and optional delay value.
- Client waits for delay duration if specified by server.
- Client transmits the firmware image to the upload URI using HTTP POST.
- Server reprograms itself using the uploaded image, then reboots.
-
- If the firmware upgrade fails because the upgrade file was invalid, the HTTP POST response
- shall be “415 Unsupported Media Type”. If the firmware upgrade fails due to an error at the
- device, the HTTP POST response shall be “500 Internal Server Error”.
- The value of the Content-Type header in the HTTP POST request shall be “application/octetstream”.
-
-
-
-
- This operation initiates a system restore from backed up configuration data using the HTTP
- POST mechanism. The response to the command includes an HTTP URL to which the backup
- file may be uploaded. The actual restore takes place as soon as the HTTP POST operation
- has completed. Devices should support system restore through the StartSystemRestore
- command. The exact format of the backup configuration data is outside the scope of this
- specification.
- System restore over HTTP may be achieved using the following steps:
- Client calls StartSystemRestore.
- Server responds with upload URI.
- Client transmits the configuration data to the upload URI using HTTP POST.
- Server applies the uploaded configuration, then reboots if necessary.
-
- If the system restore fails because the uploaded file was invalid, the HTTP POST response
- shall be “415 Unsupported Media Type”. If the system restore fails due to an error at the
- device, the HTTP POST response shall be “500 Internal Server Error”.
- The value of the Content-Type header in the HTTP POST request shall be “application/octetstream”.
-
-
-
-
-
-
- This operation lists all existing storage configurations for the device.
-
-
-
-
-
-
- This operation creates a new storage configuration.
- The configuration data shall be created in the device and shall be persistent (remain after reboot).
-
-
-
-
-
-
- This operation retrieves the Storage configuration associated with the given storage configuration token.
-
-
-
-
-
-
- This operation modifies an existing Storage configuration.
-
-
-
-
-
-
- This operation deletes the given storage configuration and configuration change shall always be persistent.
-
-
-
-
-
-
-
- This operation lists all existing geo location configurations for the device.
-
-
-
-
-
-
- This operation allows to modify one or more geo configuration entries.
-
-
-
-
-
-
- This operation deletes the given geo location entries.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/onvif_srvd/onvif_srvd/wsdl/media.wsdl b/src/onvif_srvd/onvif_srvd/wsdl/media.wsdl
deleted file mode 100644
index f7978ad..0000000
--- a/src/onvif_srvd/onvif_srvd/wsdl/media.wsdl
+++ /dev/null
@@ -1,3687 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The capabilities for the media service is returned in the Capabilities element.
-
-
-
-
-
-
-
-
-
-
- Media profile capabilities.
-
-
-
-
- Streaming capabilities.
-
-
-
-
-
-
- Indicates if GetSnapshotUri is supported.
-
-
-
-
- Indicates whether or not Rotation feature is supported.
-
-
-
-
- Indicates the support for changing video source mode.
-
-
-
-
- Indicates if OSD is supported.
-
-
-
-
- Indicates the support for the Efficient XML Interchange (EXI) binary XML format.
-
-
-
-
-
-
-
-
-
-
-
-
- Maximum number of profiles supported.
-
-
-
-
-
-
-
-
-
-
-
- Indicates support for RTP multicast.
-
-
-
-
- Indicates support for RTP over TCP.
-
-
-
-
- Indicates support for RTP/RTSP/TCP.
-
-
-
-
- Indicates support for non aggregate RTSP control.
-
-
-
-
- Indicates the device does not support live media streaming via RTSP.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of existing Video Sources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of existing Audio Sources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of existing Audio Outputs
-
-
-
-
-
-
-
-
-
-
-
- friendly name of the profile to be created
-
-
-
-
- Optional token, specifying the unique identifier of the new profile. A device supports at least a token length of 12 characters and characters "A-Z" | "a-z" | "0-9" | "-.".
-
-
-
-
-
-
-
-
-
-
- returns the new created profile
-
-
-
-
-
-
-
-
-
-
-
- this command requests a specific profile
-
-
-
-
-
-
-
-
-
-
- returns the requested media profile
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- lists all profiles that exist in the media service
-
-
-
-
-
-
-
-
-
-
-
- Reference to the profile where the configuration should be added
-
-
-
-
- Contains a reference to the VideoEncoderConfiguration to add
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a reference to the media profile from which the
-VideoEncoderConfiguration shall be removed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to the profile where the configuration should be added
-
-
-
-
- Contains a reference to the VideoSourceConfiguration to add
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a reference to the media profile from which the
-VideoSourceConfiguration shall be removed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to the profile where the configuration should be added
-
-
-
-
- Contains a reference to the AudioEncoderConfiguration to add
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a reference to the media profile from which the
-AudioEncoderConfiguration shall be removed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to the profile where the configuration should be added
-
-
-
-
- Contains a reference to the AudioSourceConfiguration to add
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a reference to the media profile from which the
-AudioSourceConfiguration shall be removed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to the profile where the configuration should be added
-
-
-
-
- Contains a reference to the PTZConfiguration to add
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a reference to the media profile from which the
-PTZConfiguration shall be removed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to the profile where the configuration should be added
-
-
-
-
- Contains a reference to the VideoAnalyticsConfiguration to add
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a reference to the media profile from which the
-VideoAnalyticsConfiguration shall be removed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to the profile where the configuration should be added
-
-
-
-
- Contains a reference to the MetadataConfiguration to add
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a reference to the media profile from which the
-MetadataConfiguration shall be removed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to the profile where the configuration should be added
-
-
-
-
- Contains a reference to the AudioOutputConfiguration to add
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a reference to the media profile from which the
-AudioOutputConfiguration shall be removed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a reference to the profile where the configuration should be added.
-
-
-
-
- This element contains a reference to the AudioDecoderConfiguration to add.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a reference to the media profile from which the AudioDecoderConfiguration shall be removed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a reference to the profile that should be deleted.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a list of video encoder configurations.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a list of video source configurations.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a list of audio encoder configurations.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a list of audio source configurations.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a list of VideoAnalytics configurations.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a list of metadata configurations
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a list of audio output configurations
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a list of audio decoder configurations
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested video source configuration.
-
-
-
-
-
-
-
-
-
-
-
- The requested video source configuration.
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested video encoder configuration.
-
-
-
-
-
-
-
-
-
-
- The requested video encoder configuration.
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested audio source configuration.
-
-
-
-
-
-
-
-
-
-
- The requested audio source configuration.
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested audio encoder configuration.
-
-
-
-
-
-
-
-
-
-
- The requested audio encoder configuration
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested video analytics configuration.
-
-
-
-
-
-
-
-
-
-
- The requested video analytics configuration.
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested metadata configuration.
-
-
-
-
-
-
-
-
-
-
- The requested metadata configuration.
-
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested audio output configuration.
-
-
-
-
-
-
-
-
-
-
-
- The requested audio output configuration.
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested audio decoder configuration.
-
-
-
-
-
-
-
-
-
-
-
- The requested audio decoder configuration
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of an existing media profile the configurations shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- Contains a list of video encoder configurations that are compatible with the specified media profile.
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of an existing media profile the configurations shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- Contains a list of video source configurations that are compatible with the specified media profile.
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of an existing media profile the configurations shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- Contains a list of audio encoder configurations that are compatible with the specified media profile.
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of an existing media profile the configurations shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- Contains a list of audio source configurations that are compatible with the specified media profile.
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of an existing media profile the configurations shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- Contains a list of video analytics configurations that are compatible with the specified media profile.
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of an existing media profile the configurations shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- Contains a list of metadata configurations that are compatible with the specified media profile.
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of an existing media profile the configurations shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- Contains a list of audio output configurations that are compatible with the specified media profile.
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of an existing media profile the configurations shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- Contains a list of audio decoder configurations that are compatible with the specified media profile.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the modified video encoder configuration. The configuration shall exist in the device.
-
-
-
-
- The ForcePersistence element is obsolete and should always be assumed to be true.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the modified video source configuration. The configuration shall exist in the device.
-
-
-
-
- The ForcePersistence element is obsolete and should always be assumed to be true.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the modified audio encoder configuration. The configuration shall exist in the device.
-
-
-
-
- The ForcePersistence element is obsolete and should always be assumed to be true.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the modified audio source configuration. The configuration shall exist in the device.
-
-
-
-
- The ForcePersistence element is obsolete and should always be assumed to be true.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the modified video analytics configuration. The configuration shall exist in the device.
-
-
-
-
- The ForcePersistence element is obsolete and should always be assumed to be true.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the modified metadata configuration. The configuration shall exist in the device.
-
-
-
-
- The ForcePersistence element is obsolete and should always be assumed to be true.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the modified audio output configuration. The configuration shall exist in the device.
-
-
-
-
- The ForcePersistence element is obsolete and should always be assumed to be true.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the modified audio decoder configuration. The configuration shall exist in the device.
-
-
-
-
- The ForcePersistence element is obsolete and should always be assumed to be true.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Optional video source configurationToken that specifies an existing configuration that the options are intended for.
-
-
-
-
- Optional ProfileToken that specifies an existing media profile that the options shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- This message contains the video source configuration options. If a video source configuration is specified, the options shall concern that particular configuration. If a media profile is specified, the options shall be compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.
-
-
-
-
-
-
-
-
-
-
-
- Optional video encoder configuration token that specifies an existing configuration that the options are intended for.
-
-
-
-
- Optional ProfileToken that specifies an existing media profile that the options shall be compatible with.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Optional audio source configuration token that specifies an existing configuration that the options are intended for.
-
-
-
-
- Optional ProfileToken that specifies an existing media profile that the options shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- This message contains the audio source configuration options. If a audio source configuration is specified, the options shall concern that particular configuration. If a media profile is specified, the options shall be compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.
-
-
-
-
-
-
-
-
-
-
-
- Optional audio encoder configuration token that specifies an existing configuration that the options are intended for.
-
-
-
-
- Optional ProfileToken that specifies an existing media profile that the options shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- This message contains the audio encoder configuration options. If a audio encoder configuration is specified, the options shall concern that particular configuration. If a media profile is specified, the options shall be compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.
-
-
-
-
-
-
-
-
-
-
-
- Optional metadata configuration token that specifies an existing configuration that the options are intended for.
-
-
-
-
- Optional ProfileToken that specifies an existing media profile that the options shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- This message contains the metadata configuration options. If a metadata configuration is specified, the options shall concern that particular configuration. If a media profile is specified, the options shall be compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.
-
-
-
-
-
-
-
-
-
-
-
- Optional audio output configuration token that specifies an existing configuration that the options are intended for.
-
-
-
-
- Optional ProfileToken that specifies an existing media profile that the options shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- This message contains the audio output configuration options. If a audio output configuration is specified, the options shall concern that particular configuration. If a media profile is specified, the options shall be compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.
-
-
-
-
-
-
-
-
-
-
-
- Optional audio decoder configuration token that specifies an existing configuration that the options are intended for.
-
-
-
-
- Optional ProfileToken that specifies an existing media profile that the options shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- This message contains the audio decoder configuration options. If a audio decoder configuration is specified, the options shall concern that particular configuration. If a media profile is specified, the options shall be compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.
-
-
-
-
-
-
-
-
-
-
-
- Token of the video source configuration
-
-
-
-
-
-
-
-
-
-
- The minimum guaranteed total number of encoder instances (applications) per VideoSourceConfiguration. The device is able to deliver the TotalNumber of streams
-
-
-
-
- If a device limits the number of instances for respective Video Codecs the response contains the information how many Jpeg streams can be set up at the same time per VideoSource.
-
-
-
-
- If a device limits the number of instances for respective Video Codecs the response contains the information how many H264 streams can be set up at the same time per VideoSource.
-
-
-
-
- If a device limits the number of instances for respective Video Codecs the response contains the information how many Mpeg4 streams can be set up at the same time per VideoSource.
-
-
-
-
-
-
-
-
-
-
-
- Stream Setup that should be used with the uri
-
-
-
-
- The ProfileToken element indicates the media profile to use and will define the configuration of the content of the stream.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of the Profile that is used to define the multicast stream.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of the Profile that is used to define the multicast stream.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a Profile reference for which a Synchronization Point is requested.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The ProfileToken element indicates the media profile to use and will define the source and dimensions of the snapshot.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a video source reference for which a video source mode is requested.
-
-
-
-
-
-
-
-
-
-
- Return the information for specified video source mode.
-
-
-
-
-
-
-
-
-
-
-
- Contains a video source reference for which a video source mode is requested.
-
-
-
-
- Indicate video source mode.
-
-
-
-
-
-
-
-
-
-
- The response contains information about rebooting after returning response. When Reboot is set true, a device will reboot automatically after setting mode.
-
-
-
-
-
-
-
-
- Indication which encodings are supported for this video source. The list may contain one or more enumeration values of tt:VideoEncoding.
-
-
-
-
-
-
-
-
- Max frame rate in frames per second for this video source mode.
-
-
-
-
- Max horizontal and vertical resolution for this video source mode.
-
-
-
-
- Indication which encodings are supported for this video source. The list may contain one or more enumeration values of tt:VideoEncoding.
-
-
-
-
- After setting the mode if a device starts to reboot this value is true. If a device change the mode without rebooting this value is false. If true, configured parameters may not be guaranteed by the device after rebooting.
-
-
-
-
- Informative description of this video source mode. This field should be described in English.
-
-
-
-
-
-
- Indicate token for video source mode.
-
-
-
-
- Indication of whether this mode is active. If active this value is true. In case of non-indication, it means as false. The value of true shall be had by only one video source mode.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Token of the Video Source Configuration, which has OSDs associated with are requested. If token not exist, request all available OSDs.
-
-
-
-
-
-
-
-
-
-
- This element contains a list of requested OSDs.
-
-
-
-
-
-
-
-
-
-
-
- The GetOSD command fetches the OSD configuration if the OSD token is known.
-
-
-
-
-
-
-
-
-
-
-
- The requested OSD configuration.
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the modified OSD configuration.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Video Source Configuration Token that specifies an existing video source configuration that the options shall be compatible with.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contain the initial OSD configuration for create.
-
-
-
-
-
-
-
-
-
-
-
- Returns Token of the newly created OSD
-
-
-
-
-
-
-
-
-
-
-
-
- This element contains a reference to the OSD configuration that should be deleted.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns the capabilities of the media service. The result is returned in a typed answer.
-
-
-
-
-
- This command lists all available physical video inputs of the device.
-
-
-
-
- This command lists all available physical audio inputs of the device.
-
-
-
-
- This command lists all available physical audio outputs of the device.
-
-
-
-
-
- This operation creates a new empty media profile. The media profile shall be created in the
-device and shall be persistent (remain after reboot). A created profile shall be deletable and a device shall set the “fixed” attribute to false in the
-returned Profile.
-
-
-
-
- If the profile token is already known, a profile can be fetched through the GetProfile command.
-
-
-
-
- Any endpoint can ask for the existing media profiles of a device using the GetProfiles
-command. Pre-configured or dynamically configured profiles can be retrieved using this
-command. This command lists all configured profiles in a device. The client does not need to
-know the media profile in order to use the command.
-
-
-
-
- This operation adds a VideoEncoderConfiguration to an existing media profile. If a
-configuration exists in the media profile, it will be replaced. The change shall be persistent. A device shall
-support adding a compatible VideoEncoderConfiguration to a Profile containing a VideoSourceConfiguration and shall
-support streaming video data of such a profile.
-
-
-
-
-
- This operation removes a VideoEncoderConfiguration from an existing media profile. If the
-media profile does not contain a VideoEncoderConfiguration, the operation has no effect. The removal shall be persistent.
-
-
-
-
- This operation adds a VideoSourceConfiguration to an existing media profile. If such a
-configuration exists in the media profile, it will be replaced. The change shall be persistent.
-
-
-
-
- This operation removes a VideoSourceConfiguration from an existing media profile. If the
-media profile does not contain a VideoSourceConfiguration, the operation has no effect. The removal shall be persistent. Video source configurations should only be removed after removing a
-VideoEncoderConfiguration from the media profile.
-
-
-
-
- This operation adds an AudioEncoderConfiguration to an existing media profile. If a
-configuration exists in the media profile, it will be replaced. The change shall be persistent. A device shall
-support adding a compatible AudioEncoderConfiguration to a profile containing an AudioSourceConfiguration and shall
-support streaming audio data of such a profile.
-
-
-
-
-
- This operation removes an AudioEncoderConfiguration from an existing media profile. If the
-media profile does not contain an AudioEncoderConfiguration, the operation has no effect.
-The removal shall be persistent.
-
-
-
-
- This operation adds an AudioSourceConfiguration to an existing media profile. If a
-configuration exists in the media profile, it will be replaced. The change shall be persistent.
-
-
-
-
- This operation removes an AudioSourceConfiguration from an existing media profile. If the
-media profile does not contain an AudioSourceConfiguration, the operation has no effect. The
-removal shall be persistent. Audio source configurations should only be removed after removing an
-AudioEncoderConfiguration from the media profile.
-
-
-
-
- This operation adds a PTZConfiguration to an existing media profile. If a configuration exists
-in the media profile, it will be replaced. The change shall be persistent. Adding a PTZConfiguration to a media profile means that streams using that media profile can
-contain PTZ status (in the metadata), and that the media profile can be used for controlling
-PTZ movement.
-
-
-
-
- This operation removes a PTZConfiguration from an existing media profile. If the media profile
-does not contain a PTZConfiguration, the operation has no effect. The removal shall be persistent.
-
-
-
-
- This operation adds a VideoAnalytics configuration to an existing media profile. If a
-configuration exists in the media profile, it will be replaced. The change shall be persistent. Adding a VideoAnalyticsConfiguration to a media profile means that streams using that media
-profile can contain video analytics data (in the metadata) as defined by the submitted configuration reference. A profile containing only a video analytics configuration but no video source configuration is incomplete. Therefore, a client should first add a video source configuration to a profile before adding a video analytics configuration. The device can deny adding of a video analytics
-configuration before a video source configuration.
-
-
-
-
- This operation removes a VideoAnalyticsConfiguration from an existing media profile. If the media profile does not contain a VideoAnalyticsConfiguration, the operation has no effect.
-The removal shall be persistent.
-
-
-
-
- This operation adds a Metadata configuration to an existing media profile. If a configuration exists in the media profile, it will be replaced. The change shall be persistent. Adding a MetadataConfiguration to a Profile means that streams using that profile contain metadata. Metadata can consist of events, PTZ status, and/or video analytics data.
-
-
-
-
- This operation removes a MetadataConfiguration from an existing media profile. If the media profile does not contain a MetadataConfiguration, the operation has no effect. The removal shall be persistent.
-
-
-
-
- This operation adds an AudioOutputConfiguration to an existing media profile. If a configuration exists in the media profile, it will be replaced. The change shall be persistent.
-
-
-
-
- This operation removes an AudioOutputConfiguration from an existing media profile. If the media profile does not contain an AudioOutputConfiguration, the operation has no effect. The removal shall be persistent.
-
-
-
-
- This operation adds an AudioDecoderConfiguration to an existing media profile. If a configuration exists in the media profile, it shall be replaced. The change shall be persistent.
-
-
-
-
- This operation removes an AudioDecoderConfiguration from an existing media profile. If the media profile does not contain an AudioDecoderConfiguration, the operation has no effect. The removal shall be persistent.
-
-
-
-
- This operation deletes a profile. This change shall always be persistent. Deletion of a profile is only possible for non-fixed profiles
-
-
-
-
-
- This operation lists all existing video source configurations for a device. The client need not know anything about the video source configurations in order to use the command.
-
-
-
-
- This operation lists all existing video encoder configurations of a device. This command lists all configured video encoder configurations in a device. The client need not know anything apriori about the video encoder configurations in order to use the command.
-
-
-
-
- This operation lists all existing audio source configurations of a device. This command lists all audio source configurations in a device. The client need not know anything apriori about the audio source configurations in order to use the command.
-
-
-
-
- This operation lists all existing device audio encoder configurations. The client need not know anything apriori about the audio encoder configurations in order to use the command.
-
-
-
-
- This operation lists all video analytics configurations of a device. This command lists all configured video analytics in a device. The client need not know anything apriori about the video analytics in order to use the command.
-
-
-
-
- This operation lists all existing metadata configurations. The client need not know anything apriori about the metadata in order to use the command.
-
-
-
-
- This command lists all existing AudioOutputConfigurations of a device. The NVC need not know anything apriori about the audio configurations to use this command.
-
-
-
-
- This command lists all existing AudioDecoderConfigurations of a device. The NVC need not know anything apriori about the audio decoder configurations in order to
-use this command.
-
-
-
-
- If the video source configuration token is already known, the video source configuration can be fetched through the GetVideoSourceConfiguration command.
-
-
-
-
- If the video encoder configuration token is already known, the encoder configuration can be fetched through the GetVideoEncoderConfiguration command.
-
-
-
-
- The GetAudioSourceConfiguration command fetches the audio source configurations if the audio source configuration token is already known. An
-
-
-
-
- The GetAudioEncoderConfiguration command fetches the encoder configuration if the audio encoder configuration token is known.
-
-
-
-
- The GetVideoAnalyticsConfiguration command fetches the video analytics configuration if the video analytics token is known.
-
-
-
-
- The GetMetadataConfiguration command fetches the metadata configuration if the metadata token is known.
-
-
-
-
- If the audio output configuration token is already known, the output configuration can be fetched through the GetAudioOutputConfiguration command.
-
-
-
-
- If the audio decoder configuration token is already known, the decoder configuration can be fetched through the GetAudioDecoderConfiguration command.
-
-
-
-
-
- This operation lists all the video encoder configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddVideoEncoderConfiguration command on the media profile. The result will vary depending on the capabilities, configurations and settings in the device.
-
-
-
-
- This operation requests all the video source configurations of the device that are compatible
-with a certain media profile. Each of the returned configurations shall be a valid input
-parameter for the AddVideoSourceConfiguration command on the media profile. The result
-will vary depending on the capabilities, configurations and settings in the device.
-
-
-
-
- This operation requests all audio encoder configurations of a device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddAudioSourceConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
-
-
-
-
- This operation requests all audio source configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddAudioEncoderConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
-
-
-
-
- This operation requests all video analytic configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddVideoAnalyticsConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
-
-
-
-
- This operation requests all the metadata configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddMetadataConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
-
-
-
-
- This command lists all audio output configurations of a device that are compatible with a certain media profile. Each returned configuration shall be a valid input for the
-AddAudioOutputConfiguration command.
-
-
-
-
- This operation lists all the audio decoder configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddAudioDecoderConfiguration command on the media profile.
-
-
-
-
-
- This operation modifies a video source configuration. The ForcePersistence flag indicates if the changes shall remain after reboot of the device. Running streams using this configuration may be immediately updated according to the new settings. The changes are not guaranteed to take effect unless the client requests a new stream URI and restarts any affected stream. NVC methods for changing a running stream are out of scope for this specification.
-
-
-
-
- This operation modifies a video encoder configuration. The ForcePersistence flag indicates if the changes shall remain after reboot of the device. Changes in the Multicast settings shall always be persistent. Running streams using this configuration may be immediately updated according to the new settings. The changes are not guaranteed to take effect unless the client requests a new stream URI and restarts any affected stream. NVC methods for changing a running stream are out of scope for this specification. SessionTimeout is provided as a hint for keeping rtsp session by a device. If necessary the device may adapt parameter values for SessionTimeout elements without returning an error. For the time between keep alive calls the client shall adhere to the timeout value signaled via RTSP.
-
-
-
-
- This operation modifies an audio source configuration. The ForcePersistence flag indicates if
-the changes shall remain after reboot of the device. Running streams using this configuration
-may be immediately updated according to the new settings. The changes are not guaranteed
-to take effect unless the client requests a new stream URI and restarts any affected stream
-NVC methods for changing a running stream are out of scope for this specification.
-
-
-
-
- This operation modifies an audio encoder configuration. The ForcePersistence flag indicates if
-the changes shall remain after reboot of the device. Running streams using this configuration may be immediately updated
-according to the new settings. The changes are not guaranteed to take effect unless the client
-requests a new stream URI and restarts any affected streams. NVC methods for changing a
-running stream are out of scope for this specification.
-
-
-
-
- A video analytics configuration is modified using this command. The ForcePersistence flag
-indicates if the changes shall remain after reboot of the device or not. Running streams using
-this configuration shall be immediately updated according to the new settings. Otherwise
-inconsistencies can occur between the scene description processed by the rule engine and
-the notifications produced by analytics engine and rule engine which reference the very same
-video analytics configuration token.
-
-
-
-
- This operation modifies a metadata configuration. The ForcePersistence flag indicates if the
-changes shall remain after reboot of the device. Changes in the Multicast settings shall
-always be persistent. Running streams using this configuration may be updated immediately
-according to the new settings. The changes are not guaranteed to take effect unless the client
-requests a new stream URI and restarts any affected streams. NVC methods for changing a
-running stream are out of scope for this specification.
-
-
-
-
- This operation modifies an audio output configuration. The ForcePersistence flag indicates if
-the changes shall remain after reboot of the device.
-
-
-
-
- This operation modifies an audio decoder configuration. The ForcePersistence flag indicates if
-the changes shall remain after reboot of the device.
-
-
-
-
-
- This operation returns the available options (supported values and ranges for video source configuration parameters) when the video source parameters are
-reconfigured If a video source configuration is specified, the options shall concern that
-particular configuration. If a media profile is specified, the options shall be compatible with
-that media profile.
-
-
-
-
- This operation returns the available options (supported values and ranges for video encoder
- configuration parameters) when the video encoder parameters are reconfigured.
- For JPEG, MPEG4 and H264 extension elements have been defined that provide additional information. A device must provide the
- XxxOption information for all encodings supported and should additionally provide the corresponding XxxOption2 information.
- This response contains the available video encoder configuration options. If a video encoder configuration is specified,
- the options shall concern that particular configuration. If a media profile is specified, the options shall be
- compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.
-
-
-
-
-
- This operation returns the available options (supported values and ranges for audio source configuration parameters) when the audio source parameters are
-reconfigured. If an audio source configuration is specified, the options shall concern that
-particular configuration. If a media profile is specified, the options shall be compatible with
-that media profile.
-
-
-
-
- This operation returns the available options (supported values and ranges for audio encoder configuration parameters) when the audio encoder parameters are
-reconfigured.
-
-
-
-
- This operation returns the available options (supported values and ranges for metadata configuration parameters) for changing the metadata configuration.
-
-
-
-
- This operation returns the available options (supported values and ranges for audio output configuration parameters) for configuring an audio output.
-
-
-
-
- This command list the audio decoding capabilities for a given profile and configuration of a
-device.
-
-
-
-
-
- The GetGuaranteedNumberOfVideoEncoderInstances command can be used to request the
-minimum number of guaranteed video encoder instances (applications) per Video Source
-Configuration.
-
-
-
-
-
- This operation requests a URI that can be used to initiate a live media stream using RTSP as
-the control protocol. The returned URI shall remain valid indefinitely even if the profile is
-changed. The ValidUntilConnect, ValidUntilReboot and Timeout Parameter shall be set
-accordingly (ValidUntilConnect=false, ValidUntilReboot=false, timeout=PT0S).
- The correct syntax for the StreamSetup element for these media stream setups defined in 5.1.1 of the streaming specification are as follows:
-
- RTP unicast over UDP: StreamType = "RTP_unicast", TransportProtocol = "UDP"
- RTP over RTSP over HTTP over TCP: StreamType = "RTP_unicast", TransportProtocol = "HTTP"
- RTP over RTSP over TCP: StreamType = "RTP_unicast", TransportProtocol = "RTSP"
-
-
-If a multicast stream is requested the VideoEncoderConfiguration, AudioEncoderConfiguration and MetadataConfiguration element inside the corresponding
-media profile must be configured with valid multicast settings.
-For full compatibility with other ONVIF services a device should not generate Uris longer than
-128 octets.
-
-
-
-
- This command starts multicast streaming using a specified media profile of a device.
-Streaming continues until StopMulticastStreaming is called for the same Profile. The
-streaming shall continue after a reboot of the device until a StopMulticastStreaming request is
-received. The multicast address, port and TTL are configured in the
-VideoEncoderConfiguration, AudioEncoderConfiguration and MetadataConfiguration
-respectively.
-
-
-
-
- This command stop multicast streaming using a specified media profile of a device
-
-
-
-
- Synchronization points allow clients to decode and correctly use all data after the
-synchronization point.
-For example, if a video stream is configured with a large I-frame distance and a client loses a
-single packet, the client does not display video until the next I-frame is transmitted. In such
-cases, the client can request a Synchronization Point which enforces the device to add an I-Frame as soon as possible. Clients can request Synchronization Points for profiles. The device
-shall add synchronization points for all streams associated with this profile.
-Similarly, a synchronization point is used to get an update on full PTZ or event status through
-the metadata stream.
-If a video stream is associated with the profile, an I-frame shall be added to this video stream.
-If a PTZ metadata stream is associated to the profile,
-the PTZ position shall be repeated within the metadata stream.
-
-
-
-
- A client uses the GetSnapshotUri command to obtain a JPEG snapshot from the
-device. The returned URI shall remain valid indefinitely even if the profile is changed. The
-ValidUntilConnect, ValidUntilReboot and Timeout Parameter shall be set accordingly
-(ValidUntilConnect=false, ValidUntilReboot=false, timeout=PT0S). The URI can be used for
-acquiring a JPEG image through a HTTP GET operation. The image encoding will always be
-JPEG regardless of the encoding setting in the media profile. The Jpeg settings
-(like resolution or quality) may be taken from the profile if suitable. The provided
-image will be updated automatically and independent from calls to GetSnapshotUri.
-
-
-
-
- A device returns the information for current video source mode and settable video source modes of specified video source. A device that indicates a capability of VideoSourceModes shall support this command.
-
-
-
-
- SetVideoSourceMode changes the media profile structure relating to video source for the specified video source mode. A device that indicates a capability of VideoSourceModes shall support this command. The behavior after changing the mode is not defined in this specification.
-
-
-
-
-
- Get the OSDs.
-
-
-
-
- Get the OSD.
-
-
-
-
- Get the OSD Options.
-
-
-
-
- Set the OSD
-
-
-
-
- Create the OSD.
-
-
-
-
- Delete the OSD.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/onvif_srvd/onvif_srvd/wsdl/onvif.xsd b/src/onvif_srvd/onvif_srvd/wsdl/onvif.xsd
deleted file mode 100644
index 64852d8..0000000
--- a/src/onvif_srvd/onvif_srvd/wsdl/onvif.xsd
+++ /dev/null
@@ -1,8822 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Base class for physical entities like inputs and outputs.
-
-
-
- Unique identifier referencing the physical entity.
-
-
-
-
-
-
- Unique identifier for a physical or logical resource.
- Tokens should be assigned such that they are unique within a device. Tokens must be at least unique within its class.
- Length up to 64 characters.
-
-
-
-
-
-
-
-
- User readable name. Length up to 64 characters.
-
-
-
-
-
-
-
-
- Rectangle defined by lower left corner position and size. Units are pixel.
-
-
-
-
-
-
-
-
-
- Range of a rectangle. The rectangle itself is defined by lower left corner position and size. Units are pixel.
-
-
-
-
- Range of X-axis.
-
-
-
-
- Range of Y-axis.
-
-
-
-
- Range of width.
-
-
-
-
- Range of height.
-
-
-
-
-
-
-
- Range of values greater equal Min value and less equal Max value.
-
-
-
-
-
-
-
-
-
- Range of values greater equal Min value and less equal Max value.
-
-
-
-
-
-
-
-
-
- Range of duration greater equal Min duration and less equal Max duration.
-
-
-
-
-
-
-
-
-
- List of values.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Representation of a physical video input.
-
-
-
-
-
-
- Frame rate in frames per second.
-
-
-
-
- Horizontal and vertical resolution
-
-
-
-
- Optional configuration of the image sensor.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Optional configuration of the image sensor. To be used if imaging service 2.00 is supported.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Representation of a physical audio input.
-
-
-
-
-
-
- number of available audio channels. (1: mono, 2: stereo)
-
-
-
-
-
-
-
-
-
-
-
-
- A media profile consists of a set of media configurations. Media profiles are used by a client
- to configure properties of a media stream from an NVT.
- An NVT shall provide at least one media profile at boot. An NVT should provide “ready to use”
- profiles for the most common media configurations that the device offers.
- A profile consists of a set of interconnected configuration entities. Configurations are provided
- by the NVT and can be either static or created dynamically by the NVT. For example, the
- dynamic configurations can be created by the NVT depending on current available encoding
- resources.
-
-
-
-
-
- User readable name of the profile.
-
-
-
-
- Optional configuration of the Video input.
-
-
-
-
- Optional configuration of the Audio input.
-
-
-
-
- Optional configuration of the Video encoder.
-
-
-
-
- Optional configuration of the Audio encoder.
-
-
-
-
- Optional configuration of the video analytics module and rule engine.
-
-
-
-
- Optional configuration of the pan tilt zoom unit.
-
-
-
-
- Optional configuration of the metadata stream.
-
-
-
-
- Extensions defined in ONVIF 2.0
-
-
-
-
-
- Unique identifier of the profile.
-
-
-
-
- A value of true signals that the profile cannot be deleted. Default is false.
-
-
-
-
-
-
-
-
-
-
- Optional configuration of the Audio output.
-
-
-
-
- Optional configuration of the Audio decoder.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Base type defining the common properties of a configuration.
-
-
-
-
- User readable name. Length up to 64 characters.
-
-
-
-
- Number of internal references currently using this configuration. This informational parameter is read-only. Deprecated for Media2 Service.
-
-
-
-
-
- Token that uniquely refernces this configuration. Length up to 64 characters.
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to the physical input.
-
-
-
-
- Rectangle specifying the Video capturing area. The capturing area shall not be larger than the whole Video source area.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Optional element to configure rotation of captured image.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameter to enable/disable Rotation feature.
-
-
-
-
- Optional parameter to configure how much degree of clockwise rotation of image for On mode. Omitting this parameter for On mode means 180 degree rotation.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Angle of incidence.
-
-
- Mapping radius as a consequence of the emergent angle.
-
-
- Optional ray absorption at the given angle due to vignetting. A value of one means no absorption.
-
-
-
-
-
-
-
-
- Optional horizontal offset of the lens center in normalized coordinates.
-
-
- Optional vertical offset of the lens center in normalized coordinates.
-
-
-
-
-
-
-
-
-
-
-
-
- Optional focal length of the optical system.
-
-
-
-
-
-
-
-
- Supported range for the capturing area.
-
-
-
-
- List of physical inputs.
-
-
-
-
-
-
-
-
-
-
-
-
- Options of parameters for Rotation feature.
-
-
-
-
-
-
-
-
-
-
- Scene orientation modes supported by the device for this configuration.
-
-
-
-
-
-
-
-
-
-
- Supported options of Rotate mode parameter.
-
-
-
-
- List of supported degree value for rotation.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines the acceptable values for the Orientation element of the SceneOrientation type
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameter to assign the way the camera determines the scene orientation.
-
-
-
-
-
-
- Assigned or determined scene orientation based on the Mode. When assigning the Mode to AUTO, this field
- is optional and will be ignored by the device. When assigning the Mode to MANUAL, this field is required
- and the device will return an InvalidArgs fault if missing.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Used video codec, either Jpeg, H.264 or Mpeg4
-
-
-
-
- Configured video resolution
-
-
-
-
- Relative value for the video quantizers and the quality of the video. A high value within supported quality range means higher quality
-
-
-
-
- Optional element to configure rate control related parameters.
-
-
-
-
- Optional element to configure Mpeg4 related parameters.
-
-
-
-
- Optional element to configure H.264 related parameters.
-
-
-
-
- Defines the multicast settings that could be used for video streaming.
-
-
-
-
- The rtsp session timeout for the related video stream
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Number of the columns of the Video image.
-
-
-
-
- Number of the lines of the Video image.
-
-
-
-
-
-
-
-
-
- Maximum output framerate in fps. If an EncodingInterval is provided the resulting encoded framerate will be reduced by the given factor.
-
-
-
-
- Interval at which images are encoded and transmitted. (A value of 1 means that every frame is encoded, a value of 2 means that every 2nd frame is encoded ...)
-
-
-
-
- the maximum output bitrate in kbps
-
-
-
-
-
-
-
-
-
- Determines the interval in which the I-Frames will be coded. An entry of 1 indicates I-Frames are continuously generated. An entry of 2 indicates that every 2nd image is an I-Frame, and 3 only every 3rd frame, etc. The frames in between are coded as P or B Frames.
-
-
-
-
- the Mpeg4 profile, either simple profile (SP) or advanced simple profile (ASP)
-
-
-
-
-
-
-
-
-
- Group of Video frames length. Determines typically the interval in which the I-Frames will be coded. An entry of 1 indicates I-Frames are continuously generated. An entry of 2 indicates that every 2nd image is an I-Frame, and 3 only every 3rd frame, etc. The frames in between are coded as P or B Frames.
-
-
-
-
- the H.264 profile, either baseline, main, extended or high
-
-
-
-
-
-
-
-
-
- Range of the quality values. A high value means higher quality.
-
-
-
-
- Optional JPEG encoder settings ranges (See also Extension element).
-
-
-
-
- Optional MPEG-4 encoder settings ranges (See also Extension element).
-
-
-
-
- Optional H.264 encoder settings ranges (See also Extension element).
-
-
-
-
-
-
-
-
-
-
-
-
- Optional JPEG encoder settings ranges.
-
-
-
-
- Optional MPEG-4 encoder settings ranges.
-
-
-
-
- Optional H.264 encoder settings ranges.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of supported image sizes.
-
-
-
-
- Supported frame rate in fps (frames per second).
-
-
-
-
- Supported encoding interval range. The encoding interval corresponds to the number of frames devided by the encoded frames. An encoding interval value of "1" means that all frames are encoded.
-
-
-
-
-
-
-
-
-
-
-
- Supported range of encoded bitrate in kbps.
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of supported image sizes.
-
-
-
-
- Supported group of Video frames length. This value typically corresponds to the I-Frame distance.
-
-
-
-
- Supported frame rate in fps (frames per second).
-
-
-
-
- Supported encoding interval range. The encoding interval corresponds to the number of frames devided by the encoded frames. An encoding interval value of "1" means that all frames are encoded.
-
-
-
-
- List of supported MPEG-4 profiles.
-
-
-
-
-
-
-
-
-
-
-
- Supported range of encoded bitrate in kbps.
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of supported image sizes.
-
-
-
-
- Supported group of Video frames length. This value typically corresponds to the I-Frame distance.
-
-
-
-
- Supported frame rate in fps (frames per second).
-
-
-
-
- Supported encoding interval range. The encoding interval corresponds to the number of frames devided by the encoded frames. An encoding interval value of "1" means that all frames are encoded.
-
-
-
-
- List of supported H.264 profiles.
-
-
-
-
-
-
-
-
-
-
-
- Supported range of encoded bitrate in kbps.
-
-
-
-
-
-
-
-
-
-
-
-
-
- ONVIF prominent MIME type names as referenced by IANA. See also IANA Media Types .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Mime name of the supported video format. For name definitions see tt:VideoEncodingMimeNames and IANA Media Types .
-
-
-
-
- Configured video resolution
-
-
-
-
- Optional element to configure rate control related parameters.
-
-
-
-
- Defines the multicast settings that could be used for video streaming.
-
-
-
-
- Relative value for the video quantizers and the quality of the video. A high value within supported quality range means higher quality
-
-
-
-
-
-
- Group of Video frames length. Determines typically the interval in which the I-Frames will be coded. An entry of 1 indicates I-Frames are continuously generated. An entry of 2 indicates that every 2nd image is an I-Frame, and 3 only every 3rd frame, etc. The frames in between are coded as P or B Frames.
-
-
-
-
- The encoder profile as defined in tt:VideoEncodingProfiles.
-
-
-
-
-
-
-
-
-
-
-
- Number of the columns of the Video image.
-
-
-
-
- Number of the lines of the Video image.
-
-
-
-
-
-
-
-
-
-
-
- Desired frame rate in fps. The actual rate may be lower due to e.g. performance limitations.
-
-
-
-
- the maximum output bitrate in kbps
-
-
-
-
-
-
- Enforce constant bitrate.
-
-
-
-
-
-
-
-
-
- Mime name of the supported Video format. For name definitions see tt:VideoEncodingMimeNames and IANA Media Types .
-
-
-
-
- Range of the quality values. A high value means higher quality.
-
-
-
-
- List of supported image sizes.
-
-
-
-
- Supported range of encoded bitrate in kbps.
-
-
-
-
-
-
- Exactly two values, which define the Lower and Upper bounds for the supported group of Video frames length. These values typically correspond to the I-Frame distance.
-
-
-
-
- List of supported target frame rates in fps (frames per second). The list shall be sorted with highest values first.
-
-
-
-
- List of supported encoder profiles as defined in tt::VideoEncodingProfiles.
-
-
-
-
- Signal whether enforcing constant bitrate is supported.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Token of the Audio Source the configuration applies to
-
-
-
-
-
-
-
-
-
-
-
-
-
- Tokens of the audio source the configuration can be used for.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Audio codec used for encoding the audio input (either G.711, G.726 or AAC)
-
-
-
-
- The output bitrate in kbps.
-
-
-
-
- The output sample rate in kHz.
-
-
-
-
- Defines the multicast settings that could be used for video streaming.
-
-
-
-
- The rtsp session timeout for the related audio stream
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list of supported AudioEncoderConfigurations
-
-
-
-
-
-
-
-
-
-
- The enoding used for audio data (either G.711, G.726 or AAC)
-
-
-
-
- List of supported bitrates in kbps for the specified Encoding
-
-
-
-
- List of supported Sample Rates in kHz for the specified Encoding
-
-
-
-
-
-
-
-
-
-
-
- ONVIF prominent MIME type names as referenced by IANA. See also IANA Media Types .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Mime name of the supported audio format. For definitions see tt:AudioEncodingMimeNames and IANA Media Types .
-
-
-
-
- Optional multicast configuration of the audio stream.
-
-
-
-
- The output bitrate in kbps.
-
-
-
-
- The output sample rate in kHz.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Mime name of the supported audio format. For definitions see tt:AudioEncodingMimeNames and IANA Media Types .
-
-
-
-
- List of supported bitrates in kbps for the specified Encoding
-
-
-
-
- List of supported Sample Rates in kHz for the specified Encoding
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- optional element to configure which PTZ related data is to include in the metadata stream
-
-
-
-
- Optional element to configure the streaming of events. A client might be interested in receiving all,
- none or some of the events produced by the device:
- To get all events: Include the Events element but do not include a filter.
- To get no events: Do not include the Events element.
- To get only some events: Include the Events element and include a filter in the element.
-
-
-
-
-
-
- Defines whether the streamed metadata will include metadata from the analytics engines (video, cell motion, audio etc.)
-
-
-
-
- Defines the multicast settings that could be used for video streaming.
-
-
-
-
- The rtsp session timeout for the related audio stream (when using Media2 Service, this value is deprecated and ignored)
-
-
-
-
-
-
-
-
- Optional parameter to configure compression type of Metadata payload. Use values from enumeration MetadataCompressionType.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True if the metadata stream shall contain the PTZ status (IDLE, MOVING or UNKNOWN)
-
-
-
-
- True if the metadata stream shall contain the PTZ position
-
-
-
-
-
-
-
-
- Subcription handling in the same way as base notification subscription.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of supported metadata compression type. Its options shall be chosen from tt:MetadataCompressionType.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True if the device is able to stream pan or tilt status information.
-
-
-
-
- True if the device is able to stream zoom status inforamtion.
-
-
-
-
-
- True if the device is able to stream the pan or tilt position.
-
-
-
-
- True if the device is able to stream zoom position information.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Representation of a physical video outputs.
-
-
-
-
-
-
-
- Resolution of the display in Pixel.
-
-
-
-
- Refresh rate of the display in Hertz.
-
-
-
-
- Aspect ratio of the display as physical extent of width divided by height.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Token of the Video Output the configuration applies to
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- If the device is able to decode Jpeg streams this element describes the supported codecs and configurations
-
-
-
-
- If the device is able to decode H.264 streams this element describes the supported codecs and configurations
-
-
-
-
- If the device is able to decode Mpeg4 streams this element describes the supported codecs and configurations
-
-
-
-
-
-
-
-
-
-
-
- List of supported H.264 Video Resolutions
-
-
-
-
- List of supported H264 Profiles (either baseline, main, extended or high)
-
-
-
-
- Supported H.264 bitrate range in kbps
-
-
-
-
- Supported H.264 framerate range in fps
-
-
-
-
-
-
-
-
-
-
-
- List of supported Jpeg Video Resolutions
-
-
-
-
- Supported Jpeg bitrate range in kbps
-
-
-
-
- Supported Jpeg framerate range in fps
-
-
-
-
-
-
-
-
-
-
-
- List of supported Mpeg4 Video Resolutions
-
-
-
-
- List of supported Mpeg4 Profiles (either SP or ASP)
-
-
-
-
- Supported Mpeg4 bitrate range in kbps
-
-
-
-
- Supported Mpeg4 framerate range in fps
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Representation of a physical audio outputs.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Token of the phsycial Audio output.
-
-
-
-
-
- An audio channel MAY support different types of audio transmission. While for full duplex
- operation no special handling is required, in half duplex operation the transmission direction
- needs to be switched.
- The optional SendPrimacy parameter inside the AudioOutputConfiguration indicates which
- direction is currently active. An NVC can switch between different modes by setting the
- AudioOutputConfiguration.
- The following modes for the Send-Primacy are defined:
- www.onvif.org/ver20/HalfDuplex/Server
- The server is allowed to send audio data to the client. The client shall not send
- audio data via the backchannel to the NVT in this mode.
- www.onvif.org/ver20/HalfDuplex/Client
- The client is allowed to send audio data via the backchannel to the server. The
- NVT shall not send audio data to the client in this mode.
- www.onvif.org/ver20/HalfDuplex/Auto
- It is up to the device how to deal with sending and receiving audio data.
-
- Acoustic echo cancellation is out of ONVIF scope.
-
-
-
-
- Volume setting of the output. The applicable range is defined via the option AudioOutputOptions.OutputLevelRange.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Tokens of the physical Audio outputs (typically one).
-
-
-
-
-
- An audio channel MAY support different types of audio transmission. While for full duplex
- operation no special handling is required, in half duplex operation the transmission direction
- needs to be switched.
- The optional SendPrimacy parameter inside the AudioOutputConfiguration indicates which
- direction is currently active. An NVC can switch between different modes by setting the
- AudioOutputConfiguration.
- The following modes for the Send-Primacy are defined:
- www.onvif.org/ver20/HalfDuplex/Server
- The server is allowed to send audio data to the client. The client shall not send
- audio data via the backchannel to the NVT in this mode.
- www.onvif.org/ver20/HalfDuplex/Client
- The client is allowed to send audio data via the backchannel to the server. The
- NVT shall not send audio data to the client in this mode.
- www.onvif.org/ver20/HalfDuplex/Auto
- It is up to the device how to deal with sending and receiving audio data.
-
- Acoustic echo cancellation is out of ONVIF scope.
-
-
-
-
- Minimum and maximum level range supported for this Output.
-
-
-
-
-
-
-
-
-
-
-
- The Audio Decoder Configuration does not contain any that parameter to configure the
-decoding .A decoder shall decode every data it receives (according to its capabilities).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- If the device is able to decode AAC encoded audio this section describes the supported configurations
-
-
-
-
- If the device is able to decode G711 encoded audio this section describes the supported configurations
-
-
-
-
- If the device is able to decode G726 encoded audio this section describes the supported configurations
-
-
-
-
-
-
-
-
-
-
-
- List of supported bitrates in kbps
-
-
-
-
- List of supported sample rates in kHz
-
-
-
-
-
-
-
-
-
-
-
- List of supported bitrates in kbps
-
-
-
-
- List of supported sample rates in kHz
-
-
-
-
-
-
-
-
-
-
-
- List of supported bitrates in kbps
-
-
-
-
- List of supported sample rates in kHz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The multicast address (if this address is set to 0 no multicast streaming is enaled)
-
-
-
-
- The RTP mutlicast destination port. A device may support RTCP. In this case the port value shall be even to allow the corresponding RTCP stream to be mapped to the next higher (odd) destination port number as defined in the RTSP specification.
-
-
-
-
- In case of IPv6 the TTL value is assumed as the hop limit. Note that for IPV6 and administratively scoped IPv4 multicast the primary use for hop limit / TTL is to prevent packets from (endlessly) circulating and not limiting scope. In these cases the address contains the scope.
-
-
-
-
- Read only property signalling that streaming is persistant. Use the methods StartMulticastStreaming and StopMulticastStreaming to switch its state.
-
-
-
-
-
-
-
-
-
-
-
- Defines if a multicast or unicast stream is requested
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines the network protocol for streaming, either UDP=RTP/UDP, RTSP=RTP/RTSP/TCP or HTTP=RTP/RTSP/HTTP/TCP
-
-
-
-
- Optional element to describe further tunnel options. This element is normally not needed
-
-
-
-
-
-
-
-
-
-
- This value is deprecated.
-
-
-
-
-
-
-
-
-
-
-
- Stable Uri to be used for requesting the media stream
-
-
-
-
- Indicates if the Uri is only valid until the connection is established. The value shall be set to "false".
-
-
-
-
- Indicates if the Uri is invalid after a reboot of the device. The value shall be set to "false".
-
-
-
-
- Duration how long the Uri is valid. This parameter shall be set to PT0S to indicate that this stream URI is indefinitely valid even if the profile changes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates if the scope is fixed or configurable.
-
-
-
-
- Scope item URI.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not an interface is enabled.
-
-
-
-
- Network interface information
-
-
-
-
- Link configuration.
-
-
-
-
- IPv4 network interface configuration.
-
-
-
-
- IPv6 network interface configuration.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Extension point prepared for future 802.3 configuration.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Configured link settings.
-
-
-
-
- Current active link settings.
-
-
-
-
- Integer indicating interface type, for example: 6 is ethernet.
-
-
-
-
-
-
-
-
-
- Auto negotiation on/off.
-
-
-
-
- Speed.
-
-
-
-
- Duplex type, Half or Full.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- For valid numbers, please refer to http://www.iana.org/assignments/ianaiftype-mib.
-
-
-
-
-
-
-
-
-
- Network interface name, for example eth0.
-
-
-
-
- Network interface MAC address.
-
-
-
-
- Maximum transmission unit.
-
-
-
-
-
-
-
-
-
- Indicates whether or not IPv6 is enabled.
-
-
-
-
- IPv6 configuration.
-
-
-
-
-
-
-
-
-
- Indicates whether or not IPv4 is enabled.
-
-
-
-
- IPv4 configuration.
-
-
-
-
-
-
-
-
-
- List of manually added IPv4 addresses.
-
-
-
-
- Link local address.
-
-
-
-
- IPv4 address configured by using DHCP.
-
-
-
-
- Indicates whether or not DHCP is used.
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether router advertisment is used.
-
-
-
-
- DHCP configuration.
-
-
-
-
- List of manually entered IPv6 addresses.
-
-
-
-
- List of link local IPv6 addresses.
-
-
-
-
- List of IPv6 addresses configured by using DHCP.
-
-
-
-
- List of IPv6 addresses configured by using router advertisment.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Network protocol type string.
-
-
-
-
- Indicates if the protocol is enabled or not.
-
-
-
-
- The port that is used by the protocol.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Network host type: IPv4, IPv6 or DNS.
-
-
-
-
- IPv4 address.
-
-
-
-
- IPv6 address.
-
-
-
-
- DNS name.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates if the address is an IPv4 or IPv6 address.
-
-
-
-
- IPv4 address.
-
-
-
-
- IPv6 address
-
-
-
-
-
-
-
-
-
- IPv4 address
-
-
-
-
- Prefix/submask length
-
-
-
-
-
-
-
-
-
-
-
-
-
- IPv6 address
-
-
-
-
- Prefix/submask length
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the hostname is obtained from DHCP or not.
-
-
-
-
- Indicates the hostname.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not DNS information is retrieved from DHCP.
-
-
-
-
- Search domain.
-
-
-
-
- List of DNS addresses received from DHCP.
-
-
-
-
- List of manually entered DNS addresses.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates if NTP information is to be retrieved by using DHCP.
-
-
-
-
- List of NTP addresses retrieved by using DHCP.
-
-
-
-
- List of manually entered NTP addresses.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Dynamic DNS type.
-
-
-
-
- DNS name.
-
-
-
-
- Time to live.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not an interface is enabled.
-
-
-
-
- Link configuration.
-
-
-
-
- Maximum transmission unit.
-
-
-
-
- IPv4 network interface configuration.
-
-
-
-
- IPv6 network interface configuration.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not IPv6 is enabled.
-
-
-
-
- Indicates whether router advertisment is used.
-
-
-
-
- List of manually added IPv6 addresses.
-
-
-
-
- DHCP configuration.
-
-
-
-
-
-
-
-
-
- Indicates whether or not IPv4 is enabled.
-
-
-
-
- List of manually added IPv4 addresses.
-
-
-
-
- Indicates whether or not DHCP is used.
-
-
-
-
-
-
-
-
-
- IPv4 address string.
-
-
-
-
- IPv6 address string.
-
-
-
-
-
-
-
-
-
- Unique identifier of network interface.
-
-
-
-
- Indicates whether the zero-configuration is enabled or not.
-
-
-
-
- The zero-configuration IPv4 address(es)
-
-
-
-
-
-
-
-
-
-
-
-
- Optional array holding the configuration for the second and possibly further interfaces.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- According to IEEE802.11-2007 H.4.1 the RSNA PSK consists of 256 bits, or 64 octets when represented in hex
- Either Key or Passphrase shall be given, if both are supplied Key shall be used by the device and Passphrase ignored.
-
-
-
-
-
-
- According to IEEE802.11-2007 H.4.1 a pass-phrase is a sequence of between 8 and 63 ASCII-encoded characters and
- each character in the pass-phrase must have an encoding in the range of 32 to 126 (decimal),inclusive.
- If only Passpharse is supplied the Key shall be derived using the algorithm described in IEEE802.11-2007 section H.4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- See IEEE802.11 7.3.2.25.2 for details.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Analytics capabilities
-
-
-
-
- Device capabilities
-
-
-
-
- Event capabilities
-
-
-
-
- Imaging capabilities
-
-
-
-
- Media capabilities
-
-
-
-
- PTZ capabilities
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Analytics service URI.
-
-
-
-
- Indicates whether or not rules are supported.
-
-
-
-
- Indicates whether or not modules are supported.
-
-
-
-
-
-
-
-
-
-
-
- Device service URI.
-
-
-
-
- Network capabilities.
-
-
-
-
- System capabilities.
-
-
-
-
- I/O capabilities.
-
-
-
-
- Security capabilities.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Event service URI.
-
-
-
-
- Indicates whether or not WS Subscription policy is supported.
-
-
-
-
- Indicates whether or not WS Pull Point is supported.
-
-
-
-
- Indicates whether or not WS Pausable Subscription Manager Interface is supported.
-
-
-
-
-
-
-
-
-
-
-
- Number of input connectors.
-
-
-
-
- Number of relay outputs.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Media service URI.
-
-
-
-
- Streaming capabilities.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not RTP multicast is supported.
-
-
-
-
- Indicates whether or not RTP over TCP is supported.
-
-
-
-
- Indicates whether or not RTP/RTSP/TCP is supported.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Maximum number of profiles.
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not IP filtering is supported.
-
-
-
-
- Indicates whether or not zeroconf is supported.
-
-
-
-
- Indicates whether or not IPv6 is supported.
-
-
-
-
- Indicates whether or not is supported.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not TLS 1.1 is supported.
-
-
-
-
- Indicates whether or not TLS 1.2 is supported.
-
-
-
-
- Indicates whether or not onboard key generation is supported.
-
-
-
-
- Indicates whether or not access policy configuration is supported.
-
-
-
-
- Indicates whether or not WS-Security X.509 token is supported.
-
-
-
-
- Indicates whether or not WS-Security SAML token is supported.
-
-
-
-
- Indicates whether or not WS-Security Kerberos token is supported.
-
-
-
-
- Indicates whether or not WS-Security REL token is supported.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- EAP Methods supported by the device. The int values refer to the IANA EAP Registry .
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not WS Discovery resolve requests are supported.
-
-
-
-
- Indicates whether or not WS-Discovery Bye is supported.
-
-
-
-
- Indicates whether or not remote discovery is supported.
-
-
-
-
- Indicates whether or not system backup is supported.
-
-
-
-
- Indicates whether or not system logging is supported.
-
-
-
-
- Indicates whether or not firmware upgrade is supported.
-
-
-
-
- Indicates supported ONVIF version(s).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Major version number.
-
-
-
-
-
- Two digit minor version number.
- If major version number is less than "16", X.0.1 maps to "01" and X.2.1 maps to "21" where X stands for Major version number.
- Otherwise, minor number is month of release, such as "06" for June.
-
-
-
-
-
-
-
-
-
-
- Imaging service URI.
-
-
-
-
-
-
-
-
-
-
- PTZ service URI.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indication that the SetLayout command supports only predefined layouts.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The address of the replay service.
-
-
-
-
-
-
-
-
-
-
-
- The address of the receiver service.
-
-
-
-
- Indicates whether the device can receive RTP multicast streams.
-
-
-
-
- Indicates whether the device can receive RTP/TCP streams
-
-
-
-
- Indicates whether the device can receive RTP/RTSP/TCP streams.
-
-
-
-
- The maximum number of receivers supported by the device.
-
-
-
-
- The maximum allowed length for RTSP URIs.
-
-
-
-
-
-
-
-
-
-
-
-
- Obsolete property.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Enumeration describing the available system log modes.
-
-
-
-
- Indicates that a system log is requested.
-
-
-
-
- Indicates that a access log is requested.
-
-
-
-
-
-
-
-
-
- The log information as attachment data.
-
-
-
-
- The log information as character data.
-
-
-
-
-
-
-
-
-
- The support information as attachment data.
-
-
-
-
- The support information as character data.
-
-
-
-
-
-
-
-
-
- base64 encoded binary data.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Enumeration describing the available factory default modes.
-
-
-
-
- Indicates that a hard factory default is requested.
-
-
-
-
- Indicates that a soft factory default is requested.
-
-
-
-
-
-
-
-
-
- Indicates that the date and time are set manually.
-
-
-
-
- Indicates that the date and time are set through NTP
-
-
-
-
-
-
-
- General date time inforamtion returned by the GetSystemDateTime method.
-
-
-
-
- Indicates if the time is set manully or through NTP.
-
-
-
-
- Informative indicator whether daylight savings is currently on/off.
-
-
-
-
- Timezone information in Posix format.
-
-
-
-
- Current system date and time in UTC format. This field is mandatory since version 2.0.
-
-
-
-
- Date and time in local format.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Range is 1 to 12.
-
-
-
-
- Range is 1 to 31.
-
-
-
-
-
-
-
-
-
- Range is 0 to 23.
-
-
-
-
- Range is 0 to 59.
-
-
-
-
- Range is 0 to 61 (typically 59).
-
-
-
-
-
-
-
-
- The TZ format is specified by POSIX, please refer to POSIX 1003.1 section 8.3
- Example: Europe, Paris TZ=CET-1CEST,M3.5.0/2,M10.5.0/3
- CET = designation for standard time when daylight saving is not in force
- -1 = offset in hours = negative so 1 hour east of Greenwich meridian
- CEST = designation when daylight saving is in force ("Central European Summer Time")
- , = no offset number between code and comma, so default to one hour ahead for daylight saving
- M3.5.0 = when daylight saving starts = the last Sunday in March (the "5th" week means the last in the month)
- /2, = the local time when the switch occurs = 2 a.m. in this case
- M10.5.0 = when daylight saving ends = the last Sunday in October.
- /3, = the local time when the switch occurs = 3 a.m. in this case
-
-
-
-
-
- Posix timezone string.
-
-
-
-
-
-
-
-
-
-
-
- East west location as angle.
-
-
-
-
- North south location as angle.
-
-
-
-
- Hight in meters above sea level.
-
-
-
-
-
-
-
-
-
-
-
- Rotation around the x axis.
-
-
-
-
- Rotation around the y axis.
-
-
-
-
- Rotation around the z axis.
-
-
-
-
-
-
-
-
-
-
-
- East west location as angle.
-
-
-
-
- North south location as angle.
-
-
-
-
- Offset in meters from the sea level.
-
-
-
-
-
-
-
-
-
-
-
- Rotation around the y axis.
-
-
-
-
- Rotation around the z axis.
-
-
-
-
- Rotation around the x axis.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Location on earth.
-
-
- Orientation relative to earth.
-
-
- Indoor location offset.
-
-
- Indoor orientation offset.
-
-
-
- Entity type the entry refers to as defined in tds:Entity.
-
-
- Optional entity token.
-
-
- If this value is true the entity cannot be deleted.
-
-
- Optional reference to the XAddr of another devices DeviceManagement service.
-
-
- If set the geo location is obtained internally.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Username string.
-
-
-
-
- Password string.
-
-
-
-
- User level string.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Certificate id.
-
-
-
-
- base64 encoded DER representation of certificate.
-
-
-
-
-
-
-
-
-
- Certificate id.
-
-
-
-
- Indicates whether or not a certificate is used in a HTTPS configuration.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Validity Range is from "NotBefore" to "NotAfter"; the corresponding DateTimeRange is from "From" to "Until"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- EAP Method type as defined in IANA EAP Registry .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Confgiuration information for TLS Method.
-
-
-
-
- Password for those EAP Methods that require a password. The password shall never be returned on a get method.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 'Bistable' or 'Monostable'
-
- Bistable – After setting the state, the relay remains in this state.
- Monostable – After setting the state, the relay returns to its idle state after the specified time.
-
-
-
-
-
-
- Time after which the relay returns to its idle state if it is in monostable mode. If the Mode field is set to bistable mode the value of the parameter can be ignored.
-
-
-
-
-
- 'open' or 'closed'
-
- 'open' means that the relay is open when the relay state is set to 'inactive' through the trigger command and closed when the state is set to 'active' through the same command.
- 'closed' means that the relay is closed when the relay state is set to 'inactive' through the trigger command and open when the state is set to 'active' through the same command.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicate the Digital IdleState status.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A unique identifier that is used to reference PTZ Nodes.
-
-
-
-
-
-
- A list of Coordinate Systems available for the PTZ Node. For each Coordinate System, the PTZ Node MUST specify its allowed range.
-
-
-
-
-
-
- All preset operations MUST be available for this PTZ Node if one preset is supported.
-
-
-
-
-
-
- A boolean operator specifying the availability of a home position. If set to true, the Home Position Operations MUST be available for this PTZ Node.
-
-
-
-
-
-
- A list of supported Auxiliary commands. If the list is not empty, the Auxiliary Operations MUST be available for this PTZ Node.
-
-
-
-
-
-
-
-
- Indication whether the HomePosition of a Node is fixed or it can be changed via the SetHomePosition command.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Detail of supported Preset Tour feature.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates number of preset tours that can be created. Required preset tour operations shall be available for this PTZ Node if one or more preset tour is supported.
-
-
-
-
- Indicates which preset tour operations are available for this PTZ Node.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A mandatory reference to the PTZ Node that the PTZ Configuration belongs to.
-
-
-
-
-
-
- If the PTZ Node supports absolute Pan/Tilt movements, it shall specify one Absolute Pan/Tilt Position Space as default.
-
-
-
-
-
-
- If the PTZ Node supports absolute zoom movements, it shall specify one Absolute Zoom Position Space as default.
-
-
-
-
-
-
- If the PTZ Node supports relative Pan/Tilt movements, it shall specify one RelativePan/Tilt Translation Space as default.
-
-
-
-
-
-
- If the PTZ Node supports relative zoom movements, it shall specify one Relative Zoom Translation Space as default.
-
-
-
-
-
-
- If the PTZ Node supports continuous Pan/Tilt movements, it shall specify one Continuous Pan/Tilt Velocity Space as default.
-
-
-
-
-
-
- If the PTZ Node supports continuous zoom movements, it shall specify one Continuous Zoom Velocity Space as default.
-
-
-
-
-
-
- If the PTZ Node supports absolute or relative PTZ movements, it shall specify corresponding default Pan/Tilt and Zoom speeds.
-
-
-
-
-
-
- If the PTZ Node supports continuous movements, it shall specify a default timeout, after which the movement stops.
-
-
-
-
-
-
- The Pan/Tilt limits element should be present for a PTZ Node that supports an absolute Pan/Tilt. If the element is present it signals the support for configurable Pan/Tilt limits. If limits are enabled, the Pan/Tilt movements shall always stay within the specified range. The Pan/Tilt limits are disabled by setting the limits to –INF or +INF.
-
-
-
-
-
-
- The Zoom limits element should be present for a PTZ Node that supports absolute zoom. If the element is present it signals the supports for configurable Zoom limits. If limits are enabled the zoom movements shall always stay within the specified range. The Zoom limits are disabled by settings the limits to -INF and +INF.
-
-
-
-
-
-
-
-
-
-
-
-
- The optional acceleration ramp used by the device when moving.
-
-
-
-
- The optional acceleration ramp used by the device when recalling presets.
-
-
-
-
- The optional acceleration ramp used by the device when executing PresetTours.
-
-
-
-
-
-
-
-
-
-
-
-
- Optional element to configure PT Control Direction related features.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Optional element to configure related parameters for E-Flip.
-
-
-
-
- Optional element to configure related parameters for reversing of PT Control Direction.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameter to enable/disable E-Flip feature.
-
-
-
-
-
-
-
-
-
-
-
- Parameter to enable/disable Reverse feature.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A list of supported coordinate systems including their range limitations.
-
-
-
-
-
-
- A timeout Range within which Timeouts are accepted by the PTZ Node.
-
-
-
-
-
-
- Supported options for PT Direction Control.
-
-
-
-
-
-
-
- The list of acceleration ramps supported by the device. The
- smallest acceleration value corresponds to the minimal index, the
- highest acceleration corresponds to the maximum index.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Supported options for EFlip feature.
-
-
-
-
- Supported options for Reverse feature.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Options of EFlip mode parameter.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Options of Reverse mode parameter.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A range of pan tilt limits.
-
-
-
-
-
-
-
-
-
-
-
- A range of zoom limit
-
-
-
-
-
-
-
-
-
-
-
- The Generic Pan/Tilt Position space is provided by every PTZ node that supports absolute Pan/Tilt, since it does not relate to a specific physical range.
- Instead, the range should be defined as the full range of the PTZ unit normalized to the range -1 to 1 resulting in the following space description.
-
-
-
-
-
-
- The Generic Zoom Position Space is provided by every PTZ node that supports absolute Zoom, since it does not relate to a specific physical range.
- Instead, the range should be defined as the full range of the Zoom normalized to the range 0 (wide) to 1 (tele).
- There is no assumption about how the generic zoom range is mapped to magnification, FOV or other physical zoom dimension.
-
-
-
-
-
-
- The Generic Pan/Tilt translation space is provided by every PTZ node that supports relative Pan/Tilt, since it does not relate to a specific physical range.
- Instead, the range should be defined as the full positive and negative translation range of the PTZ unit normalized to the range -1 to 1,
- where positive translation would mean clockwise rotation or movement in right/up direction resulting in the following space description.
-
-
-
-
-
-
- The Generic Zoom Translation Space is provided by every PTZ node that supports relative Zoom, since it does not relate to a specific physical range.
- Instead, the corresponding absolute range should be defined as the full positive and negative translation range of the Zoom normalized to the range -1 to1,
- where a positive translation maps to a movement in TELE direction. The translation is signed to indicate direction (negative is to wide, positive is to tele).
- There is no assumption about how the generic zoom range is mapped to magnification, FOV or other physical zoom dimension. This results in the following space description.
-
-
-
-
-
-
- The generic Pan/Tilt velocity space shall be provided by every PTZ node, since it does not relate to a specific physical range.
- Instead, the range should be defined as a range of the PTZ unit’s speed normalized to the range -1 to 1, where a positive velocity would map to clockwise
- rotation or movement in the right/up direction. A signed speed can be independently specified for the pan and tilt component resulting in the following space description.
-
-
-
-
-
-
- The generic zoom velocity space specifies a zoom factor velocity without knowing the underlying physical model. The range should be normalized from -1 to 1,
- where a positive velocity would map to TELE direction. A generic zoom velocity space description resembles the following.
-
-
-
-
-
-
- The speed space specifies the speed for a Pan/Tilt movement when moving to an absolute position or to a relative translation.
- In contrast to the velocity spaces, speed spaces do not contain any directional information. The speed of a combined Pan/Tilt
- movement is represented by a single non-negative scalar value.
-
-
-
-
-
-
- The speed space specifies the speed for a Zoom movement when moving to an absolute position or to a relative translation.
- In contrast to the velocity spaces, speed spaces do not contain any directional information.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A URI of coordinate systems.
-
-
-
-
-
-
- A range of x-axis.
-
-
-
-
-
-
- A range of y-axis.
-
-
-
-
-
-
-
-
-
-
-
- A URI of coordinate systems.
-
-
-
-
-
-
- A range of x-axis.
-
-
-
-
-
-
-
-
-
-
- Pan and tilt speed. The x component corresponds to pan and the y component to tilt. If omitted in a request, the current (if any) PanTilt movement should not be affected.
-
-
-
-
-
- A zoom speed. If omitted in a request, the current (if any) Zoom movement should not be affected.
-
-
-
-
-
-
-
-
-
-
-
- A list of preset position name.
-
-
-
-
-
-
- A list of preset position.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Readable name of the preset tour.
-
-
-
-
- Read only parameters to indicate the status of the preset tour.
-
-
-
-
- Auto Start flag of the preset tour. True allows the preset tour to be activated always.
-
-
-
-
- Parameters to specify the detail behavior of the preset tour.
-
-
-
-
- A list of detail of touring spots including preset positions.
-
-
-
-
-
-
- Unique identifier of this preset tour.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Detail definition of preset position of the tour spot.
-
-
-
-
- Optional parameter to specify Pan/Tilt and Zoom speed on moving toward this tour spot.
-
-
-
-
- Optional parameter to specify time duration of staying on this tour sport.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Option to specify the preset position with Preset Token defined in advance.
-
-
-
-
- Option to specify the preset position with the home position of this PTZ Node. "False" to this parameter shall be treated as an invalid argument.
-
-
-
-
- Option to specify the preset position with vector of PTZ node directly.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates state of this preset tour by Idle/Touring/Paused.
-
-
-
-
- Indicates a tour spot currently staying.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Optional parameter to specify how many times the preset tour is recurred.
-
-
-
-
- Optional parameter to specify how long time duration the preset tour is recurred.
-
-
-
-
- Optional parameter to choose which direction the preset tour goes. Forward shall be chosen in case it is omitted.
-
-
-
-
-
-
- Execute presets in random order. If set to true and Direction is also present, Direction will be ignored and presets of the Tour will be recalled randomly.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not the AutoStart is supported.
-
-
-
-
- Supported options for Preset Tour Starting Condition.
-
-
-
-
- Supported options for Preset Tour Spot.
-
-
-
-
-
-
-
-
-
-
-
- Supported options for detail definition of preset position of the tour spot.
-
-
-
-
- Supported range of stay time for a tour spot.
-
-
-
-
-
-
-
-
-
-
-
- A list of available Preset Tokens for tour spots.
-
-
-
-
- An option to indicate Home postion for tour spots.
-
-
-
-
- Supported range of Pan and Tilt for tour spots.
-
-
-
-
- Supported range of Zoom for a tour spot.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Supported range of Recurring Time.
-
-
-
-
- Supported range of Recurring Duration.
-
-
-
-
- Supported options for Direction of Preset Tour.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Status of focus position.
-
-
-
-
-
-
- Status of focus MoveStatus.
-
-
-
-
-
-
- Error status of focus.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameter to set autofocus near limit (unit: meter).
-
-
-
-
- Parameter to set autofocus far limit (unit: meter).
-If set to 0.0, infinity will be used.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Enabled/disabled BLC mode (on/off).
-
-
-
-
- Image brightness (unit unspecified).
-
-
-
-
- Color saturation of the image (unit unspecified).
-
-
-
-
- Contrast of the image (unit unspecified).
-
-
-
-
- Exposure mode of the device.
-
-
-
-
- Focus configuration.
-
-
-
-
- Infrared Cutoff Filter settings.
-
-
-
-
- Sharpness of the Video image.
-
-
-
-
- WDR settings.
-
-
-
-
- White balance settings.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Exposure Mode
-
- Auto – Enabled the exposure algorithm on the NVT.
- Manual – Disabled exposure algorithm on the NVT.
-
-
-
-
-
-
-
- The exposure priority mode (low noise/framerate).
-
-
-
-
-
-
- Rectangular exposure mask.
-
-
-
-
-
-
- Minimum value of exposure time range allowed to be used by the algorithm.
-
-
-
-
-
-
- Maximum value of exposure time range allowed to be used by the algorithm.
-
-
-
-
-
-
- Minimum value of the sensor gain range that is allowed to be used by the algorithm.
-
-
-
-
-
-
- Maximum value of the sensor gain range that is allowed to be used by the algorithm.
-
-
-
-
-
-
- Minimum value of the iris range allowed to be used by the algorithm.
-
-
-
-
-
-
- Maximum value of the iris range allowed to be used by the algorithm.
-
-
-
-
-
-
- The fixed exposure time used by the image sensor (μs).
-
-
-
-
-
-
- The fixed gain used by the image sensor (dB).
-
-
-
-
-
-
- The fixed attenuation of input light affected by the iris (dB). 0dB maps to a fully opened iris.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- White dynamic range (on/off)
-
-
-
-
-
-
- Optional level parameter (unitless)
-
-
-
-
-
-
-
-
- Enumeration describing the available backlight compenstation modes.
-
-
-
-
- Backlight compensation is disabled.
-
-
-
-
- Backlight compensation is enabled.
-
-
-
-
-
-
-
-
-
- Backlight compensation mode (on/off).
-
-
-
-
- Optional level parameter (unit unspecified).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameters for the absolute focus control.
-
-
-
-
-
-
- Parameters for the relative focus control.
-
-
-
-
-
-
- Parameter for the continuous focus control.
-
-
-
-
-
-
-
-
-
-
-
- Position parameter for the absolute focus control.
-
-
-
-
-
-
- Speed parameter for the absolute focus control.
-
-
-
-
-
-
-
-
-
-
-
- Distance parameter for the relative focus control.
-
-
-
-
-
-
- Speed parameter for the relative focus control.
-
-
-
-
-
-
-
-
-
-
-
- Speed parameter for the Continuous focus control.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Valid ranges of the position.
-
-
-
-
-
-
- Valid ranges of the speed.
-
-
-
-
-
-
-
-
-
-
-
- Valid ranges of the distance.
-
-
-
-
-
-
- Valid ranges of the speed.
-
-
-
-
-
-
-
-
-
-
-
- Valid ranges of the speed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Auto whitebalancing mode (auto/manual).
-
-
-
-
- Rgain (unitless).
-
-
-
-
- Bgain (unitless).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Status of focus.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Status of focus position.
-
-
-
-
-
-
- Status of focus MoveStatus.
-
-
-
-
-
-
- Error status of focus.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Type describing the ImagingSettings of a VideoSource. The supported options and ranges can be obtained via the GetOptions command.
-
-
-
-
- Enabled/disabled BLC mode (on/off).
-
-
-
-
- Image brightness (unit unspecified).
-
-
-
-
- Color saturation of the image (unit unspecified).
-
-
-
-
- Contrast of the image (unit unspecified).
-
-
-
-
- Exposure mode of the device.
-
-
-
-
- Focus configuration.
-
-
-
-
- Infrared Cutoff Filter settings.
-
-
-
-
- Sharpness of the Video image.
-
-
-
-
- WDR settings.
-
-
-
-
- White balance settings.
-
-
-
-
-
-
-
-
-
-
-
-
- Optional element to configure Image Stabilization feature.
-
-
-
-
-
-
-
-
-
-
- An optional parameter applied to only auto mode to adjust timing of toggling Ir cut filter.
-
-
-
-
-
-
-
-
-
-
- Optional element to configure Image Contrast Compensation.
-
-
-
-
- Optional element to configure Image Defogging.
-
-
-
-
- Optional element to configure Image Noise Reduction.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameter to enable/disable Image Stabilization feature.
-
-
-
-
- Optional level parameter (unit unspecified)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Specifies which boundaries to automatically toggle Ir cut filter following parameters are applied to. Its options shall be chosen from tt:IrCutFilterAutoBoundaryType.
-
-
-
-
- Adjusts boundary exposure level for toggling Ir cut filter to on/off specified with unitless normalized value from +1.0 to -1.0. Zero is default and -1.0 is the darkest adjustment (Unitless).
-
-
-
-
- Delay time of toggling Ir cut filter to on/off after crossing of the boundary exposure levels.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Type describing whether WDR mode is enabled or disabled (on/off).
-
-
-
-
- Wide dynamic range mode (on/off).
-
-
-
-
- Optional level parameter (unit unspecified).
-
-
-
-
-
-
-
- Type describing whether BLC mode is enabled or disabled (on/off).
-
-
-
-
- Backlight compensation mode (on/off).
-
-
-
-
- Optional level parameter (unit unspecified).
-
-
-
-
-
-
-
- Type describing the exposure settings.
-
-
-
-
-
- Exposure Mode
-
- Auto – Enabled the exposure algorithm on the device.
- Manual – Disabled exposure algorithm on the device.
-
-
-
-
-
-
-
- The exposure priority mode (low noise/framerate).
-
-
-
-
-
-
- Rectangular exposure mask.
-
-
-
-
-
-
- Minimum value of exposure time range allowed to be used by the algorithm.
-
-
-
-
-
-
- Maximum value of exposure time range allowed to be used by the algorithm.
-
-
-
-
-
-
- Minimum value of the sensor gain range that is allowed to be used by the algorithm.
-
-
-
-
-
-
- Maximum value of the sensor gain range that is allowed to be used by the algorithm.
-
-
-
-
-
-
- Minimum value of the iris range allowed to be used by the algorithm.
-
-
-
-
-
-
- Maximum value of the iris range allowed to be used by the algorithm.
-
-
-
-
-
-
- The fixed exposure time used by the image sensor (μs).
-
-
-
-
-
-
- The fixed gain used by the image sensor (dB).
-
-
-
-
-
-
- The fixed attenuation of input light affected by the iris (dB). 0dB maps to a fully opened iris.
-
-
-
-
-
-
-
-
-
-
- Parameter to enable/disable or automatic ToneCompensation feature.
-
-
-
-
- Optional level parameter specified with unitless normalized value from 0.0 to +1.0.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameter to enable/disable or automatic Defogging feature.
-
-
-
-
- Optional level parameter specified with unitless normalized value from 0.0 to +1.0.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Level parameter specified with unitless normalized value from 0.0 to +1.0. Level=0 means no noise reduction or minimal noise reduction.
-
-
-
-
-
-
-
-
-
-
-
-
- Valid range of Backlight Compensation.
-
-
-
-
-
-
- Valid range of Brightness.
-
-
-
-
-
-
- Valid range of Color Saturation.
-
-
-
-
-
-
- Valid range of Contrast.
-
-
-
-
-
-
- Valid range of Exposure.
-
-
-
-
-
-
- Valid range of Focus.
-
-
-
-
-
-
- Valid range of IrCutFilterModes.
-
-
-
-
-
-
- Valid range of Sharpness.
-
-
-
-
-
-
- Valid range of WideDynamicRange.
-
-
-
-
-
-
- Valid range of WhiteBalance.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Options of parameters for Image Stabilization feature.
-
-
-
-
-
-
-
-
-
-
- Options of parameters for adjustment of Ir cut filter auto mode.
-
-
-
-
-
-
-
-
-
-
- Options of parameters for Tone Compensation feature.
-
-
-
-
- Options of parameters for Defogging feature.
-
-
-
-
- Options of parameter for Noise Reduction feature.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Supported options of Image Stabilization mode parameter.
-
-
-
-
- Valid range of the Image Stabilization.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Supported options of boundary types for adjustment of Ir cut filter auto mode. The opptions shall be chosen from tt:IrCutFilterAutoBoundaryType.
-
-
-
-
- Indicates whether or not boundary offset for toggling Ir cut filter is supported.
-
-
-
-
- Supported range of delay time for toggling Ir cut filter.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 'ON' or 'OFF'
-
-
-
-
-
-
- Level range of BacklightCompensation.
-
-
-
-
-
-
-
-
-
-
-
- Exposure Mode
-
- Auto – Enabled the exposure algorithm on the device.
- Manual – Disabled exposure algorithm on the device.
-
-
-
-
-
-
-
- The exposure priority mode (low noise/framerate).
-
-
-
-
-
-
- Valid range of the Minimum ExposureTime.
-
-
-
-
-
-
- Valid range of the Maximum ExposureTime.
-
-
-
-
-
-
- Valid range of the Minimum Gain.
-
-
-
-
-
-
- Valid range of the Maximum Gain.
-
-
-
-
-
-
- Valid range of the Minimum Iris.
-
-
-
-
-
-
- Valid range of the Maximum Iris.
-
-
-
-
-
-
- Valid range of the ExposureTime.
-
-
-
-
-
-
- Valid range of the Gain.
-
-
-
-
-
-
- Valid range of the Iris.
-
-
-
-
-
-
-
-
-
-
-
- Valid ranges for the absolute control.
-
-
-
-
-
-
- Valid ranges for the relative control.
-
-
-
-
-
-
- Valid ranges for the continuous control.
-
-
-
-
-
-
-
-
-
-
-
- Valid ranges of the distance.
-
-
-
-
-
-
- Valid ranges of the speed.
-
-
-
-
-
-
-
-
-
-
-
- 'AUTO' or 'MANUAL'
-
-
-
-
-
-
- Rgain (unitless).
-
-
-
-
-
-
- Bgain (unitless).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Mode of auto focus.
-
- AUTO - The device automatically adjusts focus.
- MANUAL - The device does not automatically adjust focus.
-
- Note: for devices supporting both manual and auto operation at the same time manual operation may be supported even if the Mode parameter is set to Auto.
-
-
-
-
-
-
- Parameter to set autofocus near limit (unit: meter).
-
-
-
-
- Parameter to set autofocus far limit (unit: meter).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Mode of WhiteBalance.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Supported modes for auto focus.
-
- AUTO - The device supports automatic focus adjustment.
- MANUAL - The device supports manual focus adjustment.
-
-
-
-
-
-
-
- Valid range of DefaultSpeed.
-
-
-
-
-
-
- Valid range of NearLimit.
-
-
-
-
-
-
- Valid range of FarLimit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Supported options for Tone Compensation mode. Its options shall be chosen from tt:ToneCompensationMode Type.
-
-
-
-
- Indicates whether or not support Level parameter for Tone Compensation.
-
-
-
-
-
-
-
-
-
-
-
- Supported options for Defogging mode. Its options shall be chosen from tt:DefoggingMode Type.
-
-
-
-
- Indicates whether or not support Level parameter for Defogging.
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not support Level parameter for NoiseReduction.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Token value pairs that triggered this message. Typically only one item is present.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of parameters according to the corresponding ItemListDescription.
- Each item in the list shall have a unique name.
-
-
-
-
-
- Value name pair as defined by the corresponding description.
-
-
-
-
- Item name.
-
-
-
-
- Item value. The type is defined in the corresponding description.
-
-
-
-
-
-
- Complex value structure.
-
-
-
-
-
- XML tree contiaing the element value as defined in the corresponding description.
-
-
-
-
-
- Item name.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Set of tokens producing this message. The list may only contain SimpleItemDescription items.
- The set of tokens identify the component within the WS-Endpoint, which is responsible for the producing the message.
- For analytics events the token set shall include the VideoSourceConfigurationToken, the VideoAnalyticsConfigurationToken
- and the name of the analytics module or rule.
-
-
-
-
-
- Describes optional message payload parameters that may be used as key. E.g. object IDs of tracked objects are conveyed as key.
-
-
-
-
- Describes the payload of the message.
-
-
-
-
-
-
- Must be set to true when the described Message relates to a property. An alternative term of "property" is a "state" in contrast to a pure event, which contains relevant information for only a single point in time. Default is false.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Describes a list of items. Each item in the list shall have a unique name.
- The list is designed as linear structure without optional or unbounded elements.
- Use ElementItems only when complex structures are inevitable.
-
-
-
-
-
- Description of a simple item. The type must be of cathegory simpleType (xs:string, xs:integer, xs:float, ...).
-
-
-
-
- Item name. Must be unique within a list.
-
-
-
-
-
-
-
-
- Description of a complex type. The Type must reference a defined type.
-
-
-
-
-
- Item name. Must be unique within a list.
-
-
-
-
- The type of the item. The Type must reference a defined type.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of configuration parameters as defined in the correspding description.
-
-
-
-
-
- Name of the configuration.
-
-
-
-
- The Type attribute specifies the type of rule and shall be equal to value of one of Name attributes of ConfigDescription elements returned by GetSupportedRules and GetSupportedAnalyticsModules command.
-
-
-
-
-
-
-
-
-
- List describing the configuration parameters. The names of the parameters must be unique. If possible SimpleItems
- should be used to transport the information to ease parsing of dynamically defined messages by a client
- application.
-
-
-
-
-
-
- The analytics modules and rule engine produce Events, which must be listed within the Analytics Module Description. In order to do so
- the structure of the Message is defined and consists of three groups: Source, Key, and Data. It is recommended to use SimpleItemDescriptions wherever applicable.
- The name of all Items must be unique within all Items contained in any group of this Message.
- Depending on the component multiple parameters or none may be needed to identify the component uniquely.
-
-
-
-
-
-
-
-
-
- The ParentTopic labels the message (e.g. "nn:RuleEngine/LineCrossing"). The real message can extend the ParentTopic
- by for example the name of the instaniated rule (e.g. "nn:RuleEngine/LineCrossing/corssMyFirstLine").
- Even without knowing the complete topic name, the subscriber will be able to distiguish the
- messages produced by different rule instances of the same type via the Source fields of the message.
- There the name of the rule instance, which produced the message, must be listed.
-
-
-
-
-
-
-
-
-
-
-
-
- The Name attribute (e.g. "tt::LineDetector") uniquely identifies the type of rule, not a type definition in a schema.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Lists the location of all schemas that are referenced in the rules.
-
-
-
-
- List of rules supported by the Video Analytics configuration..
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- It optionally contains a list of URLs that provide the location of schema files.
- These schema files describe the types and elements used in the analytics module descriptions.
- If the analytics module descriptions reference types or elements of the ONVIF schema file,
- the ONVIF schema file MUST be explicitly listed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains Polygon configuration for rule parameters
-
-
-
-
-
-
-
-
-
-
-
- Contains array of Polyline
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains PolylineArray configuration data
-
-
-
-
-
-
-
-
-
-
-
- Motion Expression data structure contains motion expression which is based on Scene Descriptor schema with XPATH syntax. The Type argument could allow introduction of different dialects
-
-
-
-
-
-
-
-
-
-
-
-
- Contains Rule MotionExpression configuration
-
-
-
-
-
-
-
-
-
-
-
- Mapping of the cell grid to the Video frame. The cell grid is starting from the upper left corner and x dimension is going from left to right and the y dimension from up to down.
-
-
-
-
-
-
- Number of columns of the cell grid (x dimension)
-
-
-
-
- Number of rows of the cell grid (y dimension)
-
-
-
-
-
-
-
-
-
-
-
-
- Configuration of the streaming and coding settings of a Video window.
-
-
-
-
- Optional name of the pane configuration.
-
-
-
-
- If the device has audio outputs, this element contains a pointer to the audio output that is associated with the pane. A client
-can retrieve the available audio outputs of a device using the GetAudioOutputs command of the DeviceIO service.
-
-
-
-
- If the device has audio sources, this element contains a pointer to the audio source that is associated with this pane.
-The audio connection from a decoder device to the NVT is established using the backchannel mechanism. A client can retrieve the available audio sources of a device using the GetAudioSources command of the
-DeviceIO service.
-
-
-
-
- The configuration of the audio encoder including codec, bitrate
-and sample rate.
-
-
-
-
- A pointer to a Receiver that has the necessary information to receive
- data from a Transmitter. This Receiver can be connected and the network video decoder displays the received data on the specified outputs. A client can retrieve the available Receivers using the
- GetReceivers command of the Receiver Service.
-
-
-
-
- A unique identifier in the display device.
-
-
-
-
-
-
-
-
-
- A pane layout describes one Video window of a display. It links a pane configuration to a region of the screen.
-
-
-
-
- Reference to the configuration of the streaming and coding parameters.
-
-
-
-
- Describes the location and size of the area on the monitor. The area coordinate values are espressed in normalized units [-1.0, 1.0].
-
-
-
-
-
-
-
-
-
- A layout describes a set of Video windows that are displayed simultaniously on a display.
-
-
-
-
- List of panes assembling the display layout.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This type contains the Audio and Video coding capabilities of a display service.
-
-
-
-
- If the device supports audio encoding this section describes the supported codecs and their configuration.
-
-
-
-
- If the device supports audio decoding this section describes the supported codecs and their settings.
-
-
-
-
- This section describes the supported video codesc and their configuration.
-
-
-
-
-
-
-
-
-
- The options supported for a display layout.
-
-
-
-
- Lists the possible Pane Layouts of the Video Output
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Description of a pane layout describing a complete display layout.
-
-
-
-
- List of areas assembling a layout. Coordinate values are in the range [-1.0, 1.0].
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Description of a receiver, including its token and configuration.
-
-
-
-
-
- Unique identifier of the receiver.
-
-
-
-
- Describes the configuration of the receiver.
-
-
-
-
-
-
-
-
-
-
- Describes the configuration of a receiver.
-
-
-
-
-
- The following connection modes are defined:
-
-
-
-
- Details of the URI to which the receiver should connect.
-
-
-
-
- Stream connection parameters.
-
-
-
-
-
-
-
-
-
-
- Specifies a receiver connection mode.
-
-
-
-
-
- The receiver connects on demand, as required by consumers of the media streams.
-
-
-
-
- The receiver attempts to maintain a persistent connection to the configured endpoint.
-
-
-
-
- The receiver does not attempt to connect.
-
-
-
-
- This case should never happen.
-
-
-
-
-
-
-
-
- Specifies the current connection state of the receiver.
-
-
-
-
-
- The receiver is not connected.
-
-
-
-
- The receiver is attempting to connect.
-
-
-
-
- The receiver is connected.
-
-
-
-
- This case should never happen.
-
-
-
-
-
-
-
-
- Contains information about a receiver's current state.
-
-
-
-
-
- The connection state of the receiver may have one of the following states:
-
-
-
-
- Indicates whether or not the receiver was created automatically.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The earliest point in time where there is recorded data on the device.
-
-
-
-
- The most recent point in time where there is recorded data on the device.
-
-
-
-
- The device contains this many recordings.
-
-
-
-
-
-
-
-
-
- A structure for defining a limited scope when searching in recorded data.
-
-
-
-
- A list of sources that are included in the scope. If this list is included, only data from one of these sources shall be searched.
-
-
-
-
- A list of recordings that are included in the scope. If this list is included, only data from one of these recordings shall be searched.
-
-
-
-
- An xpath expression used to specify what recordings to search. Only those recordings with an RecordingInformation structure that matches the filter shall be searched.
-
-
-
-
- Extension point
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The lower boundary of the PTZ volume to look for.
-
-
-
-
- The upper boundary of the PTZ volume to look for.
-
-
-
-
- If true, search for when entering the specified PTZ volume.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The state of the search when the result is returned. Indicates if there can be more results, or if the search is completed.
-
-
-
-
- A RecordingInformation structure for each found recording matching the search.
-
-
-
-
-
-
-
-
-
- The state of the search when the result is returned. Indicates if there can be more results, or if the search is completed.
-
-
-
-
- A FindEventResult structure for each found event matching the search.
-
-
-
-
-
-
-
-
-
- The recording where this event was found. Empty string if no recording is associated with this event.
-
-
-
-
- A reference to the track where this event was found. Empty string if no track is associated with this event.
-
-
-
-
- The time when the event occured.
-
-
-
-
- The description of the event.
-
-
-
-
- If true, indicates that the event is a virtual event generated for this particular search session to give the state of a property at the start time of the search.
-
-
-
-
-
-
-
-
-
-
-
- The state of the search when the result is returned. Indicates if there can be more results, or if the search is completed.
-
-
-
-
- A FindPTZPositionResult structure for each found PTZ position matching the search.
-
-
-
-
-
-
-
-
-
- A reference to the recording containing the PTZ position.
-
-
-
-
- A reference to the metadata track containing the PTZ position.
-
-
-
-
- The time when the PTZ position was valid.
-
-
-
-
- The PTZ position.
-
-
-
-
-
-
-
-
-
-
-
- The state of the search when the result is returned. Indicates if there can be more results, or if the search is completed.
-
-
-
-
- A FindMetadataResult structure for each found set of Metadata matching the search.
-
-
-
-
-
-
-
-
-
- A reference to the recording containing the metadata.
-
-
-
-
- A reference to the metadata track containing the matching metadata.
-
-
-
-
- The point in time when the matching metadata occurs in the metadata track.
-
-
-
-
-
-
-
-
-
-
-
- The search is queued and not yet started.
-
-
-
-
- The search is underway and not yet completed.
-
-
-
-
- The search has been completed and no new results will be found.
-
-
-
-
- The state of the search is unknown. (This is not a valid response from GetSearchState.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Information about the source of the recording. This gives a description of where the data in the recording comes from. Since a single
- recording is intended to record related material, there is just one source. It is indicates the physical location or the
- major data source for the recording. Currently the recordingconfiguration cannot describe each individual data source.
-
-
-
-
-
-
-
-
- Basic information about the track. Note that a track may represent a single contiguous time span or consist of multiple slices.
-
-
-
-
-
-
-
-
-
-
-
- A set of informative desciptions of a data source. The Search searvice allows a client to filter on recordings based on information in this structure.
-
-
-
-
-
-
- Identifier for the source chosen by the client that creates the structure.
- This identifier is opaque to the device. Clients may use any type of URI for this field. A device shall support at least 128 characters.
-
-
-
-
- Informative user readable name of the source, e.g. "Camera23". A device shall support at least 20 characters.
-
-
-
-
- Informative description of the physical location of the source, e.g. the coordinates on a map.
-
-
-
-
- Informative description of the source.
-
-
-
-
- URI provided by the service supplying data to be recorded. A device shall support at least 128 characters.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This case should never happen.
-
-
-
-
-
-
-
-
-
-
- Type of the track: "Video", "Audio" or "Metadata".
- The track shall only be able to hold data of that type.
-
-
-
-
- Informative description of the contents of the track.
-
-
-
-
- The start date and time of the oldest recorded data in the track.
-
-
-
-
- The stop date and time of the newest recorded data in the track.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Placeholder for future extension.
-
-
-
-
-
-
-
- A set of media attributes valid for a recording at a point in time or for a time interval.
-
-
-
-
- A reference to the recording that has these attributes.
-
-
-
-
- A set of attributes for each track.
-
-
-
-
- The attributes are valid from this point in time in the recording.
-
-
-
-
- The attributes are valid until this point in time in the recording. Can be equal to 'From' to indicate that the attributes are only known to be valid for this particular point in time.
-
-
-
-
-
-
-
-
-
-
-
- The basic information about the track. Note that a track may represent a single contiguous time span or consist of multiple slices.
-
-
-
-
- If the track is a video track, exactly one of this structure shall be present and contain the video attributes.
-
-
-
-
- If the track is an audio track, exactly one of this structure shall be present and contain the audio attributes.
-
-
-
-
- If the track is an metadata track, exactly one of this structure shall be present and contain the metadata attributes.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Average bitrate in kbps.
-
-
-
-
- The width of the video in pixels.
-
-
-
-
- The height of the video in pixels.
-
-
-
-
- Video encoding of the track. Use values from tt:VideoEncoding for JPEG, MPEG4 and H264. Otherwise use type definitions as defined by IANA .
-
-
-
-
- Average framerate in frames per second.
-
-
-
-
-
-
-
-
-
-
-
- The bitrate in kbps.
-
-
-
-
- Audio encoding of the track. Use values from tt:AudioEncoding for G711, G726, AAC. Otherwise use type definitions as defined by IANA .
-
-
-
-
- The sample rate in kHz.
-
-
-
-
-
-
-
-
-
-
-
- Indicates that there can be PTZ data in the metadata track in the specified time interval.
-
-
-
-
- Indicates that there can be analytics data in the metadata track in the specified time interval.
-
-
-
-
- Indicates that there can be notifications in the metadata track in the specified time interval.
-
-
-
-
-
-
- List of all PTZ spaces active for recording. Note that events are only recorded on position changes and the actual point of recording may not necessarily contain an event of the specified type.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Information about the source of the recording.
-
-
-
-
- Informative description of the source.
-
-
-
-
- Sspecifies the maximum time that data in any track within the
- recording shall be stored. The device shall delete any data older than the maximum retention
- time. Such data shall not be accessible anymore. If the MaximumRetentionPeriod is set to 0,
- the device shall not limit the retention time of stored data, except by resource constraints.
- Whatever the value of MaximumRetentionTime, the device may automatically delete
- recordings to free up storage space for new recordings.
-
-
-
-
-
-
-
-
-
-
-
- Type of the track. It shall be equal to the strings “Video”,
- “Audio” or “Metadata”. The track shall only be able to hold data of that type.
-
-
-
-
- Informative description of the track.
-
-
-
-
-
-
-
-
-
-
-
- Token of the recording.
-
-
-
-
- Configuration of the recording.
-
-
-
-
- List of tracks.
-
-
-
-
-
-
-
-
-
-
-
- Configuration of a track.
-
-
-
-
-
-
-
-
-
-
- Token of the track.
-
-
-
-
- Configuration of the track.
-
-
-
-
-
-
-
-
-
-
-
- Identifies the recording to which this job shall store the received data.
-
-
-
-
- The mode of the job. If it is idle, nothing shall happen. If it is active, the device shall try
- to obtain data from the receivers. A client shall use GetRecordingJobState to determine if data transfer is really taking place.
- The only valid values for Mode shall be “Idle” and “Active”.
-
-
-
-
- This shall be a non-negative number. If there are multiple recording jobs that store data to
- the same track, the device will only store the data for the recording job with the highest
- priority. The priority is specified per recording job, but the device shall determine the priority
- of each track individually. If there are two recording jobs with the same priority, the device
- shall record the data corresponding to the recording job that was activated the latest.
-
-
-
-
- Source of the recording.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This field shall be a reference to the source of the data. The type of the source
- is determined by the attribute Type in the SourceToken structure. If Type is
- http://www.onvif.org/ver10/schema/Receiver, the token is a ReceiverReference. In this case
- the device shall receive the data over the network. If Type is
- http://www.onvif.org/ver10/schema/Profile, the token identifies a media profile, instructing the
- device to obtain data from a profile that exists on the local device.
-
-
-
-
- If this field is TRUE, and if the SourceToken is omitted, the device
- shall create a receiver object (through the receiver service) and assign the
- ReceiverReference to the SourceToken field. When retrieving the RecordingJobConfiguration
- from the device, the AutoCreateReceiver field shall never be present.
-
-
-
-
- List of tracks associated with the recording.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- If the received RTSP stream contains multiple tracks of the same type, the
- SourceTag differentiates between those Tracks. This field can be ignored in case of recording a local source.
-
-
-
-
- The destination is the tracktoken of the track to which the device shall store the
- received data.
-
-
-
-
-
-
-
-
-
-
-
- Identification of the recording that the recording job records to.
-
-
-
-
- Holds the aggregated state over the whole RecordingJobInformation structure.
-
-
-
-
- Identifies the data source of the recording job.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Identifies the data source of the recording job.
-
-
-
-
- Holds the aggregated state over all substructures of RecordingJobStateSource.
-
-
-
-
- List of track items.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Identifies the track of the data source that provides the data.
-
-
-
-
- Indicates the destination track.
-
-
-
-
- Optionally holds an implementation defined string value that describes the error.
- The string should be in the English language.
-
-
-
-
- Provides the job state of the track. The valid
- values of state shall be “Idle”, “Active” and “Error”. If state equals “Error”, the Error field may be filled in with an implementation defined value.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Configuration parameters for the replay service.
-
-
-
-
-
- The RTSP session timeout.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Token of the analytics engine (AnalyticsEngine) being controlled.
-
-
-
-
- Token of the analytics engine configuration (VideoAnalyticsConfiguration) in effect.
-
-
-
-
- Tokens of the input (AnalyticsEngineInput) configuration applied.
-
-
-
-
- Tokens of the receiver providing media input data. The order of ReceiverToken shall exactly match the order of InputToken.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This case should never happen.
-
-
-
-
-
-
-
-
-
- Token of the control object whose status is requested.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Action Engine Event Payload data structure contains the information about the ONVIF command invocations. Since this event could be generated by other or proprietary actions, the command invocation specific fields are defined as optional and additional extension mechanism is provided for future or additional action definitions.
-
-
-
-
- Request Message
-
-
-
-
- Response Message
-
-
-
-
- Fault Message
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- AudioClassType acceptable values are;
- gun_shot, scream, glass_breaking, tire_screech
-
-
-
-
-
-
-
-
-
- Indicates audio class label
-
-
-
-
- A likelihood/probability that the corresponding audio event belongs to this class. The sum of the likelihoods shall NOT exceed 1
-
-
-
-
-
-
-
-
-
-
-
- Array of audio class label and class probability
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- For OSD position type, following are the pre-defined: UpperLeft
- UpperRight
- LowerLeft
- LowerRight
- Custom
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The value range of "Transparent" could be defined by vendors only should follow this rule: the minimum value means non-transparent and the maximum value maens fully transparent.
-
-
-
-
-
-
-
-
-
-
-
-
-
- The following OSD Text Type are defined:
- Plain - The Plain type means the OSD is shown as a text string which defined in the "PlainText" item.
- Date - The Date type means the OSD is shown as a date, format of which should be present in the "DateFormat" item.
- Time - The Time type means the OSD is shown as a time, format of which should be present in the "TimeFormat" item.
- DateAndTime - The DateAndTime type means the OSD is shown as date and time, format of which should be present in the "DateFormat" and the "TimeFormat" item.
-
-
-
-
-
-
-
- List of supported OSD date formats. This element shall be present when the value of Type field has Date or DateAndTime. The following DateFormat are defined:
- M/d/yyyy - e.g. 3/6/2013
- MM/dd/yyyy - e.g. 03/06/2013
- dd/MM/yyyy - e.g. 06/03/2013
- yyyy/MM/dd - e.g. 2013/03/06
- yyyy-MM-dd - e.g. 2013-06-03
- dddd, MMMM dd, yyyy - e.g. Wednesday, March 06, 2013
- MMMM dd, yyyy - e.g. March 06, 2013
- dd MMMM, yyyy - e.g. 06 March, 2013
-
-
-
-
-
-
-
- List of supported OSD time formats. This element shall be present when the value of Type field has Time or DateAndTime. The following TimeFormat are defined:
- h:mm:ss tt - e.g. 2:14:21 PM
- hh:mm:ss tt - e.g. 02:14:21 PM
- H:mm:ss - e.g. 14:14:21
- HH:mm:ss - e.g. 14:14:21
-
-
-
-
-
-
- Font size of the text in pt.
-
-
-
-
- Font color of the text.
-
-
-
-
- Background color of the text.
-
-
-
-
- The content of text to be displayed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The URI of the image which to be displayed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Describe the option of the color supported. Either list each color or define the range of color value. The following values are acceptable for Colourspace attribute.http://www.onvif.org/ver10/colorspace/YCbCr - YCbCr colourspace
- http://www.onvif.org/ver10/colorspace/CIELUV - CIE LUV
- http://www.onvif.org/ver10/colorspace/CIELAB - CIE 1976 (L*a*b*)
- http://www.onvif.org/ver10/colorspace/HSV - HSV colourspace
-
-
-
-
-
- List the supported color.
-
-
-
-
- Define the rang of color supported.
-
-
-
-
-
-
-
-
- Describe the option of the color and its transparency.
-
-
-
-
- Optional list of supported colors.
-
-
-
-
- Range of the transparent level. Larger means more tranparent.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of supported OSD text type. When a device indicates the supported number relating to Text type in MaximumNumberOfOSDs, the type shall be presented.
-
-
-
-
- Range of the font size value.
-
-
-
-
- List of supported date format.
-
-
-
-
- List of supported time format.
-
-
-
-
- List of supported font color.
-
-
-
-
- List of supported background color.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List of avaiable uris of image.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to the video source configuration.
-
-
-
-
- Type of OSD.
-
-
-
-
- Position configuration of OSD.
-
-
-
-
- Text configuration of OSD. It shall be present when the value of Type field is Text.
-
-
-
-
- Image configuration of OSD. It shall be present when the value of Type field is Image
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The maximum number of OSD configurations supported for the specificate video source configuration. If a device limits the number of instances by OSDType, it should indicate the supported number via the related attribute.
-
-
-
-
- List supported type of OSD configuration. When a device indicates the supported number for each types in MaximumNumberOfOSDs, related type shall be presented. A device shall return Option element relating to listed type.
-
-
-
-
- List available OSD position type. Following are the pre-defined:UpperLeft
- UpperRight
- LowerLeft
- LowerRight
- Custom
-
-
-
-
-
- Option of the OSD text configuration. This element shall be returned if the device is signaling the support for Text.
-
-
-
-
- Option of the OSD image configuration. This element shall be returned if the device is signaling the support for Image.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Exported file name
-
-
-
-
- Normalized percentage completion for uploading the exported file
-
-
-
-
-
-
-
-
-
-
-
- Exported file name and export progress information
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- identifier of an existing Storage Configuration.
-
-
-
-
- gives the relative directory path on the storage
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/onvif_srvd/onvif_srvd/wsdl/ptz.wsdl b/src/onvif_srvd/onvif_srvd/wsdl/ptz.wsdl
deleted file mode 100644
index 4540e7b..0000000
--- a/src/onvif_srvd/onvif_srvd/wsdl/ptz.wsdl
+++ /dev/null
@@ -1,1292 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The capabilities for the PTZ service is returned in the Capabilities element.
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether or not EFlip is supported.
-
-
-
-
- Indicates whether or not reversing of PT control direction is supported.
-
-
-
-
- Indicates support for the GetCompatibleConfigurations command.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A list of the existing PTZ Nodes on the device.
-
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested PTZNode.
-
-
-
-
-
-
-
-
-
-
-
- A requested PTZNode.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A list of all existing PTZConfigurations on the device.
-
-
-
-
-
-
-
-
-
-
-
-
- Token of the requested PTZConfiguration.
-
-
-
-
-
-
-
-
-
-
-
- A requested PTZConfiguration.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Flag that makes configuration persistent. Example: User wants the configuration to exist after reboot.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Token of an existing configuration that the options are intended for.
-
-
-
-
-
-
-
-
-
-
-
- The requested PTZ configuration options.
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile where the operation should take place.
-
-
-
-
-
- The Auxiliary request data.
-
-
-
-
-
-
-
-
-
-
-
- The response contains the auxiliary response.
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile where the operation should take place.
-
-
-
-
-
-
-
-
-
-
-
- A list of presets which are available for the requested MediaProfile.
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile where the operation should take place.
-
-
-
-
-
- A requested preset name.
-
-
-
-
-
- A requested preset token.
-
-
-
-
-
-
-
-
-
-
-
- A token to the Preset which has been set.
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile where the operation should take place.
-
-
-
-
-
- A requested preset token.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile where the operation should take place.
-
-
-
-
-
- A requested preset token.
-
-
-
-
-
- A requested speed.The speed parameter can only be specified when Speed Spaces are available for the PTZ Node.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile where the PTZStatus should be requested.
-
-
-
-
-
-
-
-
-
-
-
- The PTZStatus for the requested MediaProfile.
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile where the operation should take place.
-
-
-
-
-
- A requested speed.The speed parameter can only be specified when Speed Spaces are available for the PTZ Node.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile where the home position should be set.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile.
-
-
-
-
-
- A Velocity vector specifying the velocity of pan, tilt and zoom.
-
-
-
-
-
- An optional Timeout parameter.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile.
-
-
-
-
-
- A positional Translation relative to the current position
-
-
-
-
-
- An optional Speed parameter.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile.
-
-
-
-
-
- A Position vector specifying the absolute target position.
-
-
-
-
-
- An optional Speed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A reference to the MediaProfile that indicate what should be stopped.
-
-
-
-
-
- Set true when we want to stop ongoing pan and tilt movements.If PanTilt arguments are not present, this command stops these movements.
-
-
-
-
-
- Set true when we want to stop ongoing zoom movement.If Zoom arguments are not present, this command stops ongoing zoom movement.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains the token of an existing media profile the configurations shall be compatible with.
-
-
-
-
-
-
-
-
-
-
- A list of all existing PTZConfigurations on the NVT that is suitable to be added to the addressed media profile.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns the capabilities of the PTZ service. The result is returned in a typed answer.
-
-
-
-
-
- Get the descriptions of the available PTZ Nodes.
-
- A PTZ-capable device may have multiple PTZ Nodes. The PTZ Nodes may represent
- mechanical PTZ drivers, uploaded PTZ drivers or digital PTZ drivers. PTZ Nodes are the
- lowest level entities in the PTZ control API and reflect the supported PTZ capabilities. The
- PTZ Node is referenced either by its name or by its reference token.
-
-
-
-
-
- Get a specific PTZ Node identified by a reference
- token or a name.
-
-
-
-
-
- Get a specific PTZonfiguration from the device, identified by its reference token or name.
-
- The default Position/Translation/Velocity Spaces are introduced to allow NVCs sending move
- requests without the need to specify a certain coordinate system. The default Speeds are
- introduced to control the speed of move requests (absolute, relative, preset), where no
- explicit speed has been set.
- The allowed pan and tilt range for Pan/Tilt Limits is defined by a two-dimensional space range
- that is mapped to a specific Absolute Pan/Tilt Position Space. At least one Pan/Tilt Position
- Space is required by the PTZNode to support Pan/Tilt limits. The limits apply to all supported
- absolute, relative and continuous Pan/Tilt movements. The limits shall be checked within the
- coordinate system for which the limits have been specified. That means that even if
- movements are specified in a different coordinate system, the requested movements shall be
- transformed to the coordinate system of the limits where the limits can be checked. When a
- relative or continuous movements is specified, which would leave the specified limits, the PTZ
- unit has to move along the specified limits. The Zoom Limits have to be interpreted
- accordingly.
-
-
-
-
-
-
- Get all the existing PTZConfigurations from the device.
-
- The default Position/Translation/Velocity Spaces are introduced to allow NVCs sending move
- requests without the need to specify a certain coordinate system. The default Speeds are
- introduced to control the speed of move requests (absolute, relative, preset), where no
- explicit speed has been set.
- The allowed pan and tilt range for Pan/Tilt Limits is defined by a two-dimensional space range
- that is mapped to a specific Absolute Pan/Tilt Position Space. At least one Pan/Tilt Position
- Space is required by the PTZNode to support Pan/Tilt limits. The limits apply to all supported
- absolute, relative and continuous Pan/Tilt movements. The limits shall be checked within the
- coordinate system for which the limits have been specified. That means that even if
- movements are specified in a different coordinate system, the requested movements shall be
- transformed to the coordinate system of the limits where the limits can be checked. When a
- relative or continuous movements is specified, which would leave the specified limits, the PTZ
- unit has to move along the specified limits. The Zoom Limits have to be interpreted
- accordingly.
-
-
-
-
-
-
- Set/update a existing PTZConfiguration on the device.
-
-
-
-
-
-
- List supported coordinate systems including their range limitations. Therefore, the options
- MAY differ depending on whether the PTZ Configuration is assigned to a Profile containing a
- Video Source Configuration. In that case, the options may additionally contain coordinate
- systems referring to the image coordinate system described by the Video Source
- Configuration. If the PTZ Node supports continuous movements, it shall return a Timeout Range within
- which Timeouts are accepted by the PTZ Node.
-
-
-
-
-
-
- Operation to send auxiliary commands to the PTZ device
- mapped by the PTZNode in the selected profile. The
- operation is supported
- if the AuxiliarySupported element of the PTZNode is true
-
-
-
-
-
-
- Operation to request all PTZ presets for the PTZNode
- in the selected profile. The operation is supported if there is support
- for at least on PTZ preset by the PTZNode.
-
-
-
-
-
- The SetPreset command saves the current device position parameters so that the device can
- move to the saved preset position through the GotoPreset operation.
- In order to create a new preset, the SetPresetRequest contains no PresetToken. If creation is
- successful, the Response contains the PresetToken which uniquely identifies the Preset. An
- existing Preset can be overwritten by specifying the PresetToken of the corresponding Preset.
- In both cases (overwriting or creation) an optional PresetName can be specified. The
- operation fails if the PTZ device is moving during the SetPreset operation.
- The device MAY internally save additional states such as imaging properties in the PTZ
- Preset which then should be recalled in the GotoPreset operation.
-
-
-
-
-
- Operation to remove a PTZ preset for the Node in
- the
- selected profile. The operation is supported if the
- PresetPosition
- capability exists for teh Node in the
- selected profile.
-
-
-
-
-
-
- Operation to go to a saved preset position for the
- PTZNode in the selected profile. The operation is supported if there is
- support for at least on PTZ preset by the PTZNode.
-
-
-
-
-
- Operation to move the PTZ device to it's "home" position. The operation is supported if the HomeSupported element in the PTZNode is true.
-
-
-
-
- Operation to save current position as the home position.
- The SetHomePosition command returns with a failure if the “home” position is fixed and
- cannot be overwritten. If the SetHomePosition is successful, it is possible to recall the
- Home Position with the GotoHomePosition command.
-
-
-
-
- Operation for continuous Pan/Tilt and Zoom movements. The operation is supported if the PTZNode supports at least one continuous Pan/Tilt or Zoom space. If the space argument is omitted, the default space set by the PTZConfiguration will be used.
-
-
-
-
- Operation for Relative Pan/Tilt and Zoom Move. The operation is supported if the PTZNode supports at least one relative Pan/Tilt or Zoom space.
- The speed argument is optional. If an x/y speed value is given it is up to the device to either use
- the x value as absolute resoluting speed vector or to map x and y to the component speed.
- If the speed argument is omitted, the default speed set by the PTZConfiguration will be used.
-
-
-
-
-
-
- Operation to request PTZ status for the Node in the
- selected profile.
-
-
-
-
- Operation to move pan,tilt or zoom to a absolute destination.
- The speed argument is optional. If an x/y speed value is given it is up to the device to either use
- the x value as absolute resoluting speed vector or to map x and y to the component speed.
- If the speed argument is omitted, the default speed set by the PTZConfiguration will be used.
-
-
-
-
-
- Operation to stop ongoing pan, tilt and zoom movements of absolute relative and continuous type.
-If no stop argument for pan, tilt or zoom is set, the device will stop all ongoing pan, tilt and zoom movements.
-
-
-
-
- Operation to request PTZ preset tours in the selected media profiles.
-
-
-
-
- Operation to request a specific PTZ preset tour in the selected media profile.
-
-
-
-
- Operation to request available options to configure PTZ preset tour.
-
-
-
-
- Operation to create a preset tour for the selected media profile.
-
-
-
-
- Operation to modify a preset tour for the selected media profile.
-
-
-
-
- Operation to perform specific operation on the preset tour in selected media profile.
-
-
-
-
- Operation to delete a specific preset tour from the media profile.
-
-
-
-
- Operation to get all available PTZConfigurations that can be added to the referenced media profile.
- A device providing more than one PTZConfiguration or more than one VideoSourceConfiguration or which has any other resource
- interdependency between PTZConfiguration entities and other resources listable in a media profile should implement this operation.
- PTZConfiguration entities returned by this operation shall not fail on adding them to the referenced media profile.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/onvif_srvd/onvif_srvd/wsdl/t-1.xsd b/src/onvif_srvd/onvif_srvd/wsdl/t-1.xsd
deleted file mode 100644
index 6e93314..0000000
--- a/src/onvif_srvd/onvif_srvd/wsdl/t-1.xsd
+++ /dev/null
@@ -1,185 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TopicPathExpression ::= TopicPath ( '|' TopicPath )*
- TopicPath ::= RootTopic ChildTopicExpression*
- RootTopic ::= NamespacePrefix? ('//')? (NCName | '*')
- NamespacePrefix ::= NCName ':'
- ChildTopicExpression ::= '/' '/'? (QName | NCName | '*'| '.')
-
-
-
-
-
-
-
-
-
-
-
-
- The pattern allows strings matching the following EBNF:
- ConcreteTopicPath ::= RootTopic ChildTopic*
- RootTopic ::= QName
- ChildTopic ::= '/' (QName | NCName)
-
-
-
-
-
-
-
-
-
-
-
-
- The pattern allows strings matching the following EBNF:
- RootTopic ::= QName
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/onvif_srvd/onvif_srvd/wsdl/typemap.dat b/src/onvif_srvd/onvif_srvd/wsdl/typemap.dat
deleted file mode 100644
index a3f7403..0000000
--- a/src/onvif_srvd/onvif_srvd/wsdl/typemap.dat
+++ /dev/null
@@ -1,539 +0,0 @@
-# typemap.dat
-
-# Use this file to define XML namespace prefixes and type bindings for
-# interface header files generated by the wsdl2h tool.
-#
-# This typemap.dat file is the default file used by wsdl2h to customize
-# its output. You can use wsdl2h option -t to specify an alternate file.
-
-####### XML NAMESPACE BINDINGS
-
-# You can define XML namespace prefix bindings to override the default
-# choice of the ns1, ns2, ... prefixes generated by wsdl2h. It is highly
-# recommended to provide namespace prefixes for your project's XML
-# namespaces. In this way, changes to the WSDL (or newer releases of
-# wsdl2h) will have a minimal impact on coding and project maintenance.
-#
-# Bindings for namespace prefixes are of the form:
-#
-# prefix = "URI"
-#
-# For example, to bind prefix s3 to the AWS S3 namespace:
-#
-# s3 = "http://s3.amazonaws.com/doc/2006-03-01/"
-
-####### XSD TYPE BINDINGS
-
-# Type bindings can be provided to bind XML schema types to C/C++
-# types for your project.
-#
-# Type bindings are of the form:
-#
-# prefix__type = declaration | use | ptr-use
-#
-# where 'prefix__type' is the C/C++-translation of the schema type,
-# 'declaration' introduces the type in the header file, the optional
-# 'use' specifies how the type is used directly, and the optional
-# 'ptr-use' specifies how the type is used as a pointer type.
-#
-# For example, to use wide strings in C:
-#
-# xsd__string = | wchar_t* | wchar_t*
-#
-# this replaces the default char* mapping in C for xsd:string.
-# To use C++ std::wstring for xsd:string:
-#
-# xsd__string = | std::wstring
-#
-# After enabling one of these lines, all XSD strings will be changed in
-# the interface file generated by wsdl2h. Rerun wsdl2h if necessary.
-# Note that the 'declaration' part above is empta,y as expected.
-#
-# When a type binding requires only the usage to be changed and the
-# declaration part must be kept intact, then the declaration part should
-# be specified as an elipsis '...':
-#
-# prefix__type = ... | use | ptr-use
-#
-# This ensure that the wsdl2h-generated type definition is preserved,
-# while the use and ptr-use are changed.
-#
-# For example, this is useful to map schema polymorphic types to C types,
-# where we need to be able to both handle a base type and its extensions
-# as per schema extensibility. Say base type ns:base allows derived
-# extensions and we need to map this to C types as follows:
-#
-# ns__base = ... | int __type_base; void*
-#
-# where __type_base and void* are used to (de)serialize any data type,
-# including base and its derived types.
-
-####### CLASS/STRUCT MEMBER ADDITIONS
-
-# Additional data and function members can be provided to extend a
-# wsdl2h-generated struct or class.
-#
-# Class and struct extensions are of the form:
-#
-# prefix__type = $ member-declaration
-#
-# For example, to add a constructor and destructor to class myns__record:
-#
-# myns__record = $ myns__record();
-# myns__record = $ ~myns__record();
-
-####### TYPE EQUIVALENCES
-
-# Type equivalence mappings can be given to replace a type with another:
-#
-# prefix__type1 == prefix__type2
-#
-# This replaces 'prefix__type1' by 'prefix__type2' in the wsdl2h output.
-#
-# For example:
-#
-# SOAP_ENC__boolean == xsd__boolean
-#
-# replaces 'SOAP_ENC__boolean' with the C/C++ type information that
-# corresponds to `xsd__boolean' which is 'bool' for C++.
-#
-# Target C/C++ type names (names without prefix) can also be replaced:
-#
-# float == double
-#
-# which replaces all 'float' with 'double' in the wsdl2h output. Beware
-# that replacing types may lead to xsi:type mismatches and SOAP
-# encoding id-ref mismatches when parsing inbound XML messages.
-
-####### BUILT-IN VARIABLES
-
-# The variable '$CONTAINER' defines the container to emit in the
-# generated declarations, which is std::vector by default.
-#
-# For example:
-#
-# $CONTAINER = std::list
-#
-# The variable '$POINTER' defines the smart pointer to emit in the
-# generated declarations, replacing '*'. For example:
-#
-# $POINTER = std::shared_ptr
-#
-# Not all pointers in the generated output can be replaced by smart
-# pointers when standard pointers are used as union members and pointers
-# to arrays.
-
-####### USER-DEFINED CONTENT
-
-# Any other content to be included in the generated header file can be
-# provided by enclosing it within brackets [ and ]. These brackets MUST
-# appear at the start of a new line.
-#
-# For example, to add an #import directive to the wsdl2h-generated output:
-#
-# [
-# #import "wsa5.h"
-# ]
-
-#-------------------------------------------------------------------------------
-#gSOAP XML Web services tools
-#Copyright (C) 2000-2015, Robert van Engelen, Genivia Inc. All Rights Reserved.
-#This software is released under one of the following two licenses:
-#GPL or Genivia's license for commercial use.
-#-------------------------------------------------------------------------------
-#A commercial use license is available from Genivia, Inc., contact@genivia.com
-#-------------------------------------------------------------------------------
-
-[
-// Reminder: Modify typemap.dat to customize the header file generated by wsdl2h
-]
-
-# Remember: type bindings are given on a single line (use \ to continue
-# with the next line). Here is an example binding for the XSD int type
-# that maps to an 'int':
-# xsd__int = | int
-
-# To use regular char* strings instead of std::string, use:
-# xsd__string = | char* | char*
-
-# For char* serialized with xsi:type when using soapcpp2 option -t, use:
-# xsd__string = typedef char *xsd__string; | xsd__string | xsd__string
-
-# The following mapping is internally applied by wsdl2h for C (not C++):
-# (assuming option -e is used to remove the xsd__boolean__ name prefix)
-# xsd__boolean = enum xsd__boolean { false_, true_ }; | enum xsd__boolean
-
-# Uncomment the line below to use __int128_t for xsd:integer instead of
-# mapping xsd:integer to string.
-# Then rerun wsdl2h and also compile and link custom/int128.c
-# xsd__integer = #import "custom/int128.h" | xsd__integer
-#
-# Or if the xsd:integer value range is bounded to int64_t, then:
-# xsd__integer = typedef LONG64 xsd__integer;
-#
-# Also, to enable XSD integer types that are restrictions of xsd:integer
-# to be mapped to int128 or LONG64, uncomment:
-# xsd__nonNegativeInteger = typedef xsd__integer xsd__nonNegativeInteger 0 : ;
-# xsd__nonPositiveInteger = typedef xsd__integer xsd__nonPositiveInteger : 0 ;
-# xsd__positiveInteger = typedef xsd__integer xsd__positiveInteger 1 : ;
-# xsd__negativeInteger = typedef xsd__integer xsd__negativeInteger : -1;
-
-# Uncomment the line below to use long double for xsd:decimal instead of
-# mapping xsd:decimal to string.
-# Then rerun wsdl2h and also compile and link custom/long_double.c.
-# xsd__decimal = #import "custom/long_double.h" | long double
-#
-# Or if your system supports __float128 then you can use:
-# xsd__decimal = #import "custom/float128.h" | xsd__decimal
-#
-# Or if the xsd:decimal value range is bounded to double, then:
-# xsd__decimal = typedef double xsd__decimal;
-
-# Uncomment the line below to use struct tm instead of time_t xsd:dateTime
-# Then rerun wsdl2h and also compile and link custom/struct_tm.c.
-# xsd__dateTime = #import "custom/struct_tm.h" | xsd__dateTime
-
-# Uncomment the line below to use timeval with usec precision xsd:dateTime
-# Then rerun wsdl2h and also compile and link custom/struct_timeval.c.
-# xsd__dateTime = #import "custom/struct_timeval.h" | xsd__dateTime
-
-# Uncomment the line below to use std::chrono::system_clock::time_point
-# for xsd:dateTime.
-# Then rerun wsdl2h and also compile and link custom/chrono_time_point.c.
-# xsd__dateTime = #import "custom/chrono_time_point.h" | xsd__dateTime
-
-# Uncomment the line below to use struct tm for xsd:date instead of
-# mapping xsd:date to string.
-# Then rerun wsdl2h and also compile and link custom/struct_tm_date.c.
-# xsd__date = #import "custom/struct_tm_date.h" | xsd__date
-
-# Uncomment the line below to use LONG64 int for xsd:duration instead of
-# mapping xsd:duration to string (in milliseconds precision).
-# Then rerun wsdl2h and also compile and link custom/duration.c.
-
-xsd__duration = #import "custom/duration.h" | xsd__duration
-
-# Uncomment the line below to use C++11 std::chrono::nanoseconds for
-# xsd:duration instead of mapping xsd:duration to string.
-# Then rerun wsdl2h and also compile and link custom/chrono_duration.cpp.
-# xsd__duration = #import "custom/chrono_duration.h" | xsd__duration
-
-# Uncomment the line below to use ULONG64 int for xsd:time instead of
-# mapping xsd:time to string (also comes with high usec precision)
-# Then rerun wsdl2h and also compile and link custom/time.c
-# xsd__time = #import "custom/long_time.h" | xsd__time
-
-# When compiling WITH_LEAN there is no hexBinary serializer. You can
-# remap the hexBinary type to a string as follows:
-# xsd__hexBinary = | char*
-
-# When wsdl2h option -d is used, xsd:any is mapped to xsd__anyType DOM
-# declared in dom.h and implemented in dom.c/dom.cpp. You can remap
-# xsd:any, for example to a pointer to a DOM node as follows:
-# xsd__any = | xsd__anyType*
-
-# When SOAP 1.2 Faults should carry multiple SOAP_ENV__Text elements with
-# xml:lang attributes, then remap SOAP_ENV__Reason as follows:
-# [
-# struct SOAP_ENV__Reason
-# {
-# char *SOAP_ENV__Text; // at least one SOAP-ENV:Text for the gSOAP engine
-# $int size;
-# struct SOAP_ENV__Text *SOAP_ENV__Text_; // array of more SOAP-ENV:Text
-# };
-# struct SOAP_ENV__Text
-# {
-# char *__item;
-# @char *xml__lang;
-# };
-# ]
-
-# SOAP-ENV mapping (note: SOAP Body content is mapped to an XML string)
-
-SOAP_ENV__Envelope = struct SOAP_ENV__Envelope { struct SOAP_ENV__Header *SOAP_ENV__Header; _XML SOAP_ENV__Body; }; | struct SOAP_ENV__Envelope
-SOAP_ENV__Header = | struct SOAP_ENV__Header
-SOAP_ENV__Fault = | struct SOAP_ENV__Fault
-SOAP_ENV__Detail = | struct SOAP_ENV__Detail
-SOAP_ENV__Code = | struct SOAP_ENV__Code
-SOAP_ENV__Subcode = | struct SOAP_ENV__Subcode
-SOAP_ENV__Reason = | struct SOAP_ENV__Reason
-
-# Temporary URI
-
-tempuri = "http://tempuri.org/"
-
-# Empty URI
-
-empty = ""
-
-# .NET WCF DataContract Serialization Schema
-
-ser =
-arr = "http://schemas.microsoft.com/2003/10/Serialization/Arrays"
-
-# .NET WCF DataContract Serialization Schema remappings
-
-_ser__anyURI == xsd__anyURI
-_ser__boolean == xsd__boolean
-_ser__base64Binary == xsd__base64Binary
-_ser__byte == xsd__byte
-_ser__dateTime == xsd__dateTime
-_ser__decimal == xsd__decimal
-_ser__double == xsd__double
-_ser__float == xsd__float
-_ser__int == xsd__int
-_ser__long == xsd__long
-_ser__QName == xsd__QName
-_ser__short == xsd__short
-_ser__string == xsd__string
-_ser__unsignedByte == xsd__unsignedByte
-_ser__unsignedInt == xsd__unsignedInt
-_ser__unsignedLong == xsd__unsignedLong
-_ser__unsignedShort == xsd__unsignedShort
-
-# .NET WCF ser:anyType represents an object (see import/ser.h):
-
-_ser__anyType = | struct __ser__anyType | struct __ser__anyType
-
-# .NET WCF ser:char element and type represents a Unicode character
-
-_ser__char = | int
-ser__char = | int
-
-# .NET WCF ser:duration element and type maps to xsd:duration
-
-_ser__duration == xsd__duration
-ser__duration == xsd__duration
-
-# .NET WCF ser:guid pattern = "[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"
-
-_ser__guid = | char*
-ser__guid = | char*
-
-# .NET WCF samples
-
-mssamh = "http://Microsoft.Samples.Http"
-mssamhi = "http://Microsoft.Samples.Http/Imports"
-
-mssamt = "http://Microsoft.Samples.TransportSecurity"
-mssamti = "http://Microsoft.Samples.TransportSecurity/Imports"
-
-mssamm = "http://Microsoft.Samples.MessageSecurity"
-mssammi = "http://Microsoft.Samples.MessageSecurity/Imports"
-
-mssadh = "http://Microsoft.Samples.DualHttp"
-mssadhi = "http://Microsoft.Samples.DualHttp/Imports"
-
-# MTOM xop and xmime are imported from xop.h, xmime.h, and xmlmime.h:
-# Note: changed xmlmime to xmime to avoid other MTOM tools from
-# complaining that 'xml' is reserved.
-
-xop =
-xmime =
-xmime4 =
-xmime5 =
-
-# xop:Include is imported from xop.h and redefined as _xop__Include:
-
-xop__Include = #import "xop.h" | _xop__Include
-
-# xmime/xmlmime:contentType attribute is a string:
-
-_xmime__contentType = | char* | char*
-_xmime4__contentType = | char* | char*
-_xmime5__contentType = | char* | char*
-
-# exc-c14n
-
-c14n =
-
-# WS-Addressing (2003, 2004, and 2005 schemas)
-# See import/wsa.h, import/wsa3.h etc for definitions and code examples
-# The API is defined in plugin/wsaapi.c, plugin/wsaapi3.c, etc.
-
-wsa =
-wsa3 =
-wsa4 =
-wsa5 =
-
-# The types below should not use pointers, so we add a 3rd column:
-
-_wsa__Action = | | _wsa__Action
-_wsa__MessageID = | | _wsa__MessageID
-_wsa__To = | | _wsa__To
-
-_wsa3__Action = | | _wsa3__Action
-_wsa3__MessageID = | | _wsa3__MessageID
-_wsa3__To = | | _wsa3__To
-
-_wsa4__Action = | | _wsa4__Action
-_wsa4__MessageID = | | _wsa4__MessageID
-_wsa4__To = | | _wsa4__To
-
-_wsa5__Action = | | _wsa5__Action
-_wsa5__MessageID = | | _wsa5__MessageID
-_wsa5__To = | | _wsa5__To
-
-# WS-ReliableMessaging 1.1 and 1.0 (and obsolete WS-Reliability 2004)
-
-wsrm =
-wsrm5 =
-wsrm4 =
-
-# WS-Discovery 1.1 (2009/01) and 1.0 (2004/08 with WS-Addressing)
-# To upgrade WS-Discovery to WS-Addressing 2005/08, uncomment wsdd5:
-
-wsdd =
-#wsdd5 =
-wsdd10 =
-
-wsdd5__HelloType = | wsdd__HelloType
-wsdd5__ByeType = | wsdd__ByeType
-wsdd5__ProbeType = | wsdd__ProbeType
-wsdd5__ProbeMatchesType = | wsdd__ProbeMatchesType
-wsdd5__ProbeMatchType = | wsdd__ProbeMatchType
-wsdd5__ResolveType = | wsdd__ResolveType
-wsdd5__ResolveMatchesType = | wsdd__ResolveMatchesType
-wsdd5__ResolveMatchType = | wsdd__ResolveMatchType
-wsdd5__ScopesType = | wsdd__ScopesType
-wsdd5__SecurityType = | wsdd__SecurityType
-wsdd5__SigType = | wsdd__SigType
-wsdd5__AppSequenceType = | wsdd__AppSequenceType
-
-wsdd10__HelloType = | wsdd__HelloType
-wsdd10__ByeType = | wsdd__ByeType
-wsdd10__ProbeType = | wsdd__ProbeType
-wsdd10__ProbeMatchesType = | wsdd__ProbeMatchesType
-wsdd10__ProbeMatchType = | wsdd__ProbeMatchType
-wsdd10__ResolveType = | wsdd__ResolveType
-wsdd10__ResolveMatchesType = | wsdd__ResolveMatchesType
-wsdd10__ResolveMatchType = | wsdd__ResolveMatchType
-wsdd10__ScopesType = | wsdd__ScopesType
-wsdd10__SecurityType = | wsdd__SecurityType
-wsdd10__SigType = | wsdd__SigType
-wsdd10__AppSequenceType = | wsdd__AppSequenceType
-
-# WS-Policy
-
-wsp =
-
-# WS-SecureConversation 1.4
-
-wsc =
-wsc2 =
-
-# WS-Trust 1.2 and 1.3
-
-wst =
-wst12 =
-
-# SAML bindings
-
-saml1 =
-saml2 =
-
-# WS-Security wsse 2004 v1.0 and 1.1 and old wsse 2002 schema
-
-wsse11 =
-wsse =
-wsse2 =
-
-_wsse2__Security == _wsse__Security
-wsse2__Security == wsse__Security
-
-# wsu 2004
-
-wsu =
-
-_wsu__Id = | char*
-_wsu__Created = | time_t
-_wsu__Expires = | time_t
-
-wsu__AttributedDateTime = | time_t
-wsu__AttributedURI = | char*
-
-# Bindings for ds and xenc for WS-Security protocols:
-
-ds =
-xenc =
-
-# xlink
-
-xlink = "http://www.w3.org/1999/xlink"
-
-# wsrp routing protocol (deprecated)
-
-wsrp =
-
-# BPEL 2.0
-
-bpel = "http://docs.oasis-open.org/wsbpel/2.0/process/executable"
-bpelabs = "http://docs.oasis-open.org/wsbpel/2.0/process/abstract"
-plnk = "http://docs.oasis-open.org/wsbpel/2.0/plnktype"
-sref = "http://docs.oasis-open.org/wsbpel/2.0/serviceref"
-vprop = "http://docs.oasis-open.org/wsbpel/2.0/varprop"
-
-# ONVIF recommended prefixes as per 8/20/12
-# http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
-# http://www.onvif.org/onvif/ver10/event/wsdl/event.wsdl
-# http://www.onvif.org/onvif/ver10/display.wsdl
-# http://www.onvif.org/onvif/ver10/deviceio.wsdl
-# http://www.onvif.org/onvif/ver20/imaging/wsdl/imaging.wsdl
-# http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl
-# http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl
-# http://www.onvif.org/onvif/ver10/receiver.wsdl
-# http://www.onvif.org/onvif/ver10/recording.wsdl
-# http://www.onvif.org/onvif/ver10/search.wsdl
-# http://www.onvif.org/onvif/ver10/network/wsdl/remotediscovery.wsdl
-# http://www.onvif.org/onvif/ver10/replay.wsdl
-# http://www.onvif.org/onvif/ver20/analytics/wsdl/analytics.wsdl
-# http://www.onvif.org/onvif/ver10/analyticsdevice.wsdl
-# http://www.onvif.org/onvif/ver10/schema/onvif.xsd
-
-tds =
-tev =
-tls =
-tmd =
-timg =
-trt =
-tptz =
-trv =
-trc =
-tse =
-trp =
-tan =
-tad =
-tdn =
-tt =
-
-# OASIS recommended prefixes
-
-wsnt =
-wsntw =
-wsrfbf =
-wsrfr =
-wsrfrw =
-wstop =
-
-# Prefix bindings for WhiteMesa interoperability testing round 2:
-
-i = "http://soapinterop.org/"
-s = "http://soapinterop.org/xsd"
-
-# Prefix bindings for Amazon AWS S3 Web Services:
-
-aws = "urn:PI/DevCentral/SoapService"
-s3 = "http://s3.amazonaws.com/doc/2006-03-01/"
-
-_s3__CreateBucketResponse = $ s3__CreateBucketResult* CreateBucketResponse;
-_s3__CopyObjectResponse = $ s3__CopyObjectResult* CopyObjectResponse;
-
-# Prefix binding for Mappoint Web services:
-
-mpt = "http://s.mappoint.net/mappoint-30/"
-
-# Prefix binding for XLIFF 2.0
-
-xliff = "urn:oasis:names:tc:xliff:document:2.0"
-
-xliff__priorityValue = typedef int xliff__priorityValue 1:10;
diff --git a/src/rRTSPServer/Makefile.rRTSPServer b/src/rRTSPServer/Makefile.rRTSPServer
old mode 100755
new mode 100644
index d45bcf4..7fab00a
--- a/src/rRTSPServer/Makefile.rRTSPServer
+++ b/src/rRTSPServer/Makefile.rRTSPServer
@@ -1,5 +1,5 @@
##### Change the following for your environment:
-COMPILE_OPTS = $(INCLUDES) -I. -I./include -O2 -ffunction-sections -fdata-sections -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DNO_OPENSSL=1 -DRTP_PAYLOAD_MAX_SIZE=1352 -DNEWLOCALE_NOT_USED
+COMPILE_OPTS = $(INCLUDES) -I. -I./include -O1 -ffunction-sections -fdata-sections -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DNO_OPENSSL=1 -DRTP_PAYLOAD_MAX_SIZE=1352 -DNEWLOCALE_NOT_USED
C = c
C_COMPILER = $(CC)
C_FLAGS = $(COMPILE_OPTS) $(CPPFLAGS) $(CFLAGS)
@@ -8,7 +8,7 @@ CPLUSPLUS_COMPILER = $(CXX)
CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 $(CPPFLAGS) $(CXXFLAGS)
OBJ = o
LINK = $(CXX) -o
-LINK_OPTS = -L. $(LDFLAGS)
+LINK_OPTS = -Wl,--gc-sections -L. $(LDFLAGS)
CONSOLE_LINK_OPTS = $(LINK_OPTS)
LIBRARY_LINK = $(AR) cr
LIBRARY_LINK_OPTS =
@@ -73,7 +73,7 @@ livemedia:
rRTSPServer_OBJS = src/rRTSPServer.$(OBJ) \
src/ADTSAudioFifoServerMediaSubsession.$(OBJ) src/ADTSAudioFifoSource.$(OBJ) \
- src/DummySink.$(OBJ) src/ByteStreamFifoSource.$(OBJ) src/H264VideoFifoServerMediaSubsession.$(OBJ) \
+ src/ByteStreamFifoSource.$(OBJ) src/H264VideoFifoServerMediaSubsession.$(OBJ) \
rRTSPServer$(EXE): $(rRTSPServer_OBJS) $(LOCAL_LIBS)
$(LINK)$@ $(CONSOLE_LINK_OPTS) $(rRTSPServer_OBJS) $(LIBS) -lpthread
diff --git a/src/rRTSPServer/include/ADTSAudioFifoServerMediaSubsession.hh b/src/rRTSPServer/include/ADTSAudioFifoServerMediaSubsession.hh
old mode 100755
new mode 100644
diff --git a/src/rRTSPServer/include/ADTSAudioFifoSource.hh b/src/rRTSPServer/include/ADTSAudioFifoSource.hh
old mode 100755
new mode 100644
diff --git a/src/rRTSPServer/include/ByteStreamFifoSource.hh b/src/rRTSPServer/include/ByteStreamFifoSource.hh
old mode 100755
new mode 100644
diff --git a/src/rRTSPServer/include/H264VideoFifoServerMediaSubsession.hh b/src/rRTSPServer/include/H264VideoFifoServerMediaSubsession.hh
old mode 100755
new mode 100644
diff --git a/src/rRTSPServer/include/presentationTime.hh b/src/rRTSPServer/include/presentationTime.hh
old mode 100755
new mode 100644
diff --git a/src/rRTSPServer/init.rRTSPServer b/src/rRTSPServer/init.rRTSPServer
index 1567571..02bd2b2 100755
--- a/src/rRTSPServer/init.rRTSPServer
+++ b/src/rRTSPServer/init.rRTSPServer
@@ -30,7 +30,7 @@ fi
tar zxvf $ARCHIVE
patch -p0 < rRTSPServer.patch
-patch -p0 < rRTSPServer2.patch
+#patch -p0 < rRTSPServer2.patch
cd live || exit 1
diff --git a/src/rRTSPServer/rRTSPServer.patch b/src/rRTSPServer/rRTSPServer.patch
index 71ba3bb..0ec3ef1 100755
--- a/src/rRTSPServer/rRTSPServer.patch
+++ b/src/rRTSPServer/rRTSPServer.patch
@@ -2,7 +2,7 @@ diff -Naur live.ori/config.linux-cross live/config.linux-cross
--- live.ori/config.linux-cross 1970-01-01 01:00:00.000000000 +0100
+++ live/config.linux-cross 2021-02-18 10:39:28.103846011 +0100
@@ -0,0 +1,17 @@
-+COMPILE_OPTS = $(INCLUDES) -I. -O1 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DNO_OPENSSL=1 -DNEWLOCALE_NOT_USED
++COMPILE_OPTS = $(INCLUDES) -I. -O1 -ffunction-sections -fdata-sections -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DNO_OPENSSL=1 -DRTP_PAYLOAD_MAX_SIZE=1352 -DNEWLOCALE_NOT_USED
+C = c
+C_COMPILER = $(CC)
+C_FLAGS = $(COMPILE_OPTS) $(CPPFLAGS) $(CFLAGS)
@@ -11,7 +11,7 @@ diff -Naur live.ori/config.linux-cross live/config.linux-cross
+CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 $(CPPFLAGS) $(CXXFLAGS)
+OBJ = o
+LINK = $(CXX) -o
-+LINK_OPTS = -L. $(LDFLAGS)
++LINK_OPTS = -Wl,--gc-sections -L. $(LDFLAGS)
+CONSOLE_LINK_OPTS = $(LINK_OPTS)
+LIBRARY_LINK = $(AR) cr
+LIBRARY_LINK_OPTS =
diff --git a/src/rRTSPServer/rRTSPServer2.patch b/src/rRTSPServer/rRTSPServer2.patch
deleted file mode 100755
index beb531d..0000000
--- a/src/rRTSPServer/rRTSPServer2.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff -Naur include.ori/ADTSAudioFifoServerMediaSubsession.hh include/ADTSAudioFifoServerMediaSubsession.hh
---- include.ori/ADTSAudioFifoServerMediaSubsession.hh 2023-04-15 23:22:04.964120526 +0200
-+++ include/ADTSAudioFifoServerMediaSubsession.hh 2023-04-20 19:18:14.115207781 +0200
-@@ -54,6 +54,8 @@
- private:
- char* fAuxSDPLine;
- char fDoneFlag; // used when setting up "fAuxSDPLine"
-+ unsigned fSamplingFrequency;
-+ unsigned fNumChannels;
- char fConfigStr[5];
- RTPSink* fDummyRTPSink; // ditto
- StreamReplicator *fReplicator;
-diff -Naur src.ori/ADTSAudioFifoServerMediaSubsession.cpp src/ADTSAudioFifoServerMediaSubsession.cpp
---- src.ori/ADTSAudioFifoServerMediaSubsession.cpp 2023-04-15 23:22:04.964120526 +0200
-+++ src/ADTSAudioFifoServerMediaSubsession.cpp 2023-04-20 21:46:20.842280500 +0200
-@@ -128,6 +128,8 @@
- Medium::close(resultSource);
- return NULL;
- } else {
-+ fSamplingFrequency = originalSource->samplingFrequency();
-+ fNumChannels = originalSource->numChannels();
- sprintf(fConfigStr, originalSource->configStr());
- if (debug & 4) fprintf(stderr, "createStreamReplica completed successfully\n");
-
-@@ -139,10 +141,9 @@
- ::createNewRTPSink(Groupsock* rtpGroupsock,
- unsigned char rtpPayloadTypeIfDynamic,
- FramedSource* inputSource) {
-- ADTSAudioFifoSource* adtsSource = (ADTSAudioFifoSource*)inputSource;
- return MPEG4GenericRTPSink::createNew(envir(), rtpGroupsock,
- rtpPayloadTypeIfDynamic,
-- adtsSource->samplingFrequency(),
-+ fSamplingFrequency,
- "audio", "AAC-hbr", fConfigStr,
-- adtsSource->numChannels());
-+ fNumChannels);
- }
diff --git a/src/rRTSPServer/src/ADTSAudioFifoServerMediaSubsession.cpp b/src/rRTSPServer/src/ADTSAudioFifoServerMediaSubsession.cpp
index 19475ac..44e29c2 100755
--- a/src/rRTSPServer/src/ADTSAudioFifoServerMediaSubsession.cpp
+++ b/src/rRTSPServer/src/ADTSAudioFifoServerMediaSubsession.cpp
@@ -20,6 +20,7 @@ along with this library; if not, write to the Free Software Foundation, Inc.,
// Implementation
#include "ADTSAudioFifoServerMediaSubsession.hh"
+#include "ADTSAudioStreamDiscreteFramer.hh"
#include "ADTSAudioFifoSource.hh"
#include "MPEG4GenericRTPSink.hh"
#include "FramedFilter.hh"
diff --git a/src/rRTSPServer/src/ADTSAudioFifoSource.cpp b/src/rRTSPServer/src/ADTSAudioFifoSource.cpp
index 528d730..52e8262 100755
--- a/src/rRTSPServer/src/ADTSAudioFifoSource.cpp
+++ b/src/rRTSPServer/src/ADTSAudioFifoSource.cpp
@@ -56,19 +56,33 @@ ADTSAudioFifoSource::createNew(UsageEnvironment& env, char const* fileName) {
};
// Clean fifo content
+#ifdef READ_FROM_FILES_SYNCHRONOUSLY
+ if (debug & 4) fprintf(stderr, "Read synchronously\n");
while (fread(null, 1, sizeof(null), fid) > 0) {}
+#else
+ if (debug & 4) fprintf(stderr, "Read asynchronously\n");
+ while (read(fileno(fid), null, sizeof(null)) > 0) {}
+#endif
// Restore old blocking
if (fcntl(fileno(fid), F_SETFL, flags) != 0) {
fclose(fid);
break;
- };
+ }
unsigned char fixedHeader[7];
while (1) {
+#ifdef READ_FROM_FILES_SYNCHRONOUSLY
fread(fixedHeader, 1, 1, fid);
+#else
+ read(fileno(fid), fixedHeader, 1);
+#endif
if (fixedHeader[0] == 0xFF) {
+#ifdef READ_FROM_FILES_SYNCHRONOUSLY
fread(&fixedHeader[1], 1, 1, fid);
+#else
+ read(fileno(fid), &fixedHeader[1], 1);
+#endif
// Check the 'syncword':
if ((fixedHeader[1]&0xF0) == 0xF0) {
break;
@@ -76,7 +90,11 @@ ADTSAudioFifoSource::createNew(UsageEnvironment& env, char const* fileName) {
}
usleep(10000);
}
+#ifdef READ_FROM_FILES_SYNCHRONOUSLY
fread(&fixedHeader[2], 1, 5, fid);
+#else
+ read(fileno(fid), &fixedHeader[2], 5);
+#endif
u_int16_t frame_length = ((fixedHeader[3]&0x03)<<11) | (fixedHeader[4]<<3) | ((fixedHeader[5]&0xE0)>>5);
// Get and check the 'profile':
@@ -194,90 +212,94 @@ void ADTSAudioFifoSource::doReadFromFile() {
#else
if (read(fileno(fFid), headers, sizeof headers) < (signed) sizeof headers) {
#endif
- // The input source has ended:
- handleClosure();
- return;
- }
+ fFrameSize = 0;
+ fNumTruncatedBytes = 0;
+// // The input source has ended:
+// handleClosure();
+// return;
+ } else {
- // Extract important fields from the headers:
- Boolean protection_absent = headers[1]&0x01;
- u_int16_t frame_length
- = ((headers[3]&0x03)<<11) | (headers[4]<<3) | ((headers[5]&0xE0)>>5);
- u_int16_t syncword = (headers[0]<<4) | (headers[1]>>4);
- if (debug & 4) fprintf(stderr, "Read frame: syncword 0x%x, protection_absent %d, frame_length %d\n", syncword, protection_absent, frame_length);
- if (syncword != 0xFFF) {
- fprintf(stderr, "WARNING: Bad syncword! Try to recover sync.\n");
- // Resync
- while (1) {
+ // Extract important fields from the headers:
+ Boolean protection_absent = headers[1]&0x01;
+ u_int16_t frame_length
+ = ((headers[3]&0x03)<<11) | (headers[4]<<3) | ((headers[5]&0xE0)>>5);
+ u_int16_t syncword = (headers[0]<<4) | (headers[1]>>4);
+ if (debug & 4) fprintf(stderr, "Read frame: syncword 0x%x, protection_absent %d, frame_length %d\n", syncword, protection_absent, frame_length);
+ if (syncword != 0xFFF) {
+ fprintf(stderr, "WARNING: Bad syncword! Try to recover sync.\n");
+ // Resync
+ while (1) {
#ifdef READ_FROM_FILES_SYNCHRONOUSLY
- fread(headers, 1, 1, fFid);
+ fread(headers, 1, 1, fFid);
#else
- read(fileno(fFid), headers, 1);
+ read(fileno(fFid), headers, 1);
#endif
- if (headers[0] == 0xFF) {
+ if (headers[0] == 0xFF) {
#ifdef READ_FROM_FILES_SYNCHRONOUSLY
- fread(&headers[1], 1, 1, fFid);
+ fread(&headers[1], 1, 1, fFid);
#else
- read(fileno(fFid), &headers[1], 1);
+ read(fileno(fFid), &headers[1], 1);
#endif
- // Check the 'syncword':
- if ((headers[1]&0xF0) == 0xF0) {
+ // Check the 'syncword':
+ if ((headers[1]&0xF0) == 0xF0) {
#ifdef READ_FROM_FILES_SYNCHRONOUSLY
- fread(&headers[2], 1, sizeof(headers) - 2, fFid);
+ fread(&headers[2], 1, sizeof(headers) - 2, fFid);
#else
- read(fileno(fFid), &headers[2], sizeof(headers) - 2);
+ read(fileno(fFid), &headers[2], sizeof(headers) - 2);
#endif
- break;
+ break;
+ }
}
+ usleep(1000);
}
- usleep(10000);
}
- }
- unsigned numBytesToRead
- = frame_length > sizeof headers ? frame_length - sizeof headers : 0;
+ unsigned numBytesToRead
+ = frame_length > sizeof headers ? frame_length - sizeof headers : 0;
- // If there's a 'crc_check' field, skip it:
- if (!protection_absent) {
- unsigned char null[2];
+ // If there's a 'crc_check' field, skip it:
+ if (!protection_absent) {
+ unsigned char null[2];
#ifdef READ_FROM_FILES_SYNCHRONOUSLY
- fread(null, 1, 2, fFid);
+ fread(null, 1, 2, fFid);
#else
- read(fileno(fFid), null, 2);
+ read(fileno(fFid), null, 2);
#endif
- numBytesToRead = numBytesToRead > 2 ? numBytesToRead - 2 : 0;
- }
+ numBytesToRead = numBytesToRead > 2 ? numBytesToRead - 2 : 0;
+ }
- // Next, read the raw frame data into the buffer provided:
- if (numBytesToRead > fMaxSize) {
- fNumTruncatedBytes = numBytesToRead - fMaxSize;
- numBytesToRead = fMaxSize;
- }
+ // Next, read the raw frame data into the buffer provided:
+ if (numBytesToRead > fMaxSize) {
+ fNumTruncatedBytes = numBytesToRead - fMaxSize;
+ numBytesToRead = fMaxSize;
+ }
#ifdef READ_FROM_FILES_SYNCHRONOUSLY
- int numBytesRead = fread(fTo, 1, numBytesToRead, fFid);
+ int numBytesRead = fread(fTo, 1, numBytesToRead, fFid);
#else
- int numBytesRead = read(fileno(fFid), fTo, numBytesToRead);
+ int numBytesRead = read(fileno(fFid), fTo, numBytesToRead);
#endif
- if (numBytesRead < 0) numBytesRead = 0;
- fFrameSize = numBytesRead;
- fNumTruncatedBytes += numBytesToRead - numBytesRead;
-
- // Set the 'presentation time':
- if (fPresentationTime.tv_sec == 0 && fPresentationTime.tv_usec == 0) {
- // This is the first frame, so use the current time:
- gettimeofday(&fPresentationTime, NULL);
- } else {
+ if (numBytesRead < 0) numBytesRead = 0;
+ fFrameSize = numBytesRead;
+ fNumTruncatedBytes += numBytesToRead - numBytesRead;
+
+ // Set the 'presentation time':
+ if (fPresentationTime.tv_sec == 0 && fPresentationTime.tv_usec == 0) {
+ // This is the first frame, so use the current time:
+ gettimeofday(&fPresentationTime, NULL);
+ } else {
#ifndef PRES_TIME_CLOCK
- // Increment by the play time of the previous frame:
- unsigned uSeconds = fPresentationTime.tv_usec + fuSecsPerFrame;
- fPresentationTime.tv_sec += uSeconds/1000000;
- fPresentationTime.tv_usec = uSeconds%1000000;
+ // Increment by the play time of the previous frame:
+ unsigned uSeconds = fPresentationTime.tv_usec + fuSecsPerFrame;
+ fPresentationTime.tv_sec += uSeconds/1000000;
+ fPresentationTime.tv_usec = uSeconds%1000000;
#else
- // Use system clock to set presentation time
- gettimeofday(&fPresentationTime, NULL);
+ // Use system clock to set presentation time
+ gettimeofday(&fPresentationTime, NULL);
#endif
- }
+ }
+ if (debug & 4) fprintf(stderr, "AAC frame - fPresentationTime, sec = %ld, usec = %ld\n", fPresentationTime.tv_sec, fPresentationTime.tv_usec);
- fDurationInMicroseconds = fuSecsPerFrame;
+ fDurationInMicroseconds = fuSecsPerFrame;
+ }
// Switch to another task, and inform the reader that he has data:
#ifdef READ_FROM_FILES_SYNCHRONOUSLY
diff --git a/src/rRTSPServer/src/ByteStreamFifoSource.cpp b/src/rRTSPServer/src/ByteStreamFifoSource.cpp
index c30ed73..ee4e58d 100755
--- a/src/rRTSPServer/src/ByteStreamFifoSource.cpp
+++ b/src/rRTSPServer/src/ByteStreamFifoSource.cpp
@@ -27,6 +27,8 @@ along with this library; if not, write to the Free Software Foundation, Inc.,
////////// ByteStreamFifoSource //////////
+extern int debug;
+
ByteStreamFifoSource*
ByteStreamFifoSource::createNew(UsageEnvironment& env, char const* fileName,
unsigned preferredFrameSize,
@@ -170,7 +172,9 @@ void ByteStreamFifoSource::doReadFromFile() {
// We don't know a specific play time duration for this data,
// so just record the current time as being the 'presentation time':
gettimeofday(&fPresentationTime, NULL);
+ fDurationInMicroseconds = fPlayTimePerFrame;
}
+ if (debug & 4) fprintf(stderr, "h264 frame - fPresentationTime, sec = %ld, usec = %ld\n", fPresentationTime.tv_sec, fPresentationTime.tv_usec);
// Inform the reader that he has data:
#ifdef READ_FROM_FILES_SYNCHRONOUSLY
diff --git a/src/rRTSPServer/src/H264VideoFifoServerMediaSubsession.cpp b/src/rRTSPServer/src/H264VideoFifoServerMediaSubsession.cpp
index a25e05e..0ac2044 100755
--- a/src/rRTSPServer/src/H264VideoFifoServerMediaSubsession.cpp
+++ b/src/rRTSPServer/src/H264VideoFifoServerMediaSubsession.cpp
@@ -106,7 +106,7 @@ FramedSource* H264VideoFifoServerMediaSubsession::createNewStreamSource(unsigned
estBitrate = 500; // kbps, estimate
// Create the video source:
- ByteStreamFifoSource* fileSource = ByteStreamFifoSource::createNew(envir(), fFileName);
+ ByteStreamFifoSource* fileSource = ByteStreamFifoSource::createNew(envir(), fFileName, 0, 50000);
if (fileSource == NULL) return NULL;
fFileSize = fileSource->fileSize();
diff --git a/src/rRTSPServer/src/rRTSPServer.cpp b/src/rRTSPServer/src/rRTSPServer.cpp
index fa16d88..4c1f83c 100755
--- a/src/rRTSPServer/src/rRTSPServer.cpp
+++ b/src/rRTSPServer/src/rRTSPServer.cpp
@@ -64,10 +64,10 @@ StreamReplicator* startReplicatorStream(const char* inputAudioFileName) {
FramedSource* source = replicator->createStreamReplica();
// Then create a 'dummy sink' object to receive the replica stream:
- MediaSink* sink = DummySink::createNew(*env, "dummy");
+// MediaSink* sink = DummySink::createNew(*env, "dummy");
// Now, start playing, feeding the sink object from the source:
- sink->startPlaying(*source, NULL, NULL);
+// sink->startPlaying(*source, NULL, NULL);
return replicator;
}
@@ -362,7 +362,7 @@ int main(int argc, char** argv)
announceStream(rtspServer, sms_low, streamName, inputFileName, audio);
}
-/*
+
// An ADTS audio elementary stream:
if (audio != 0)
{
@@ -379,7 +379,7 @@ int main(int argc, char** argv)
announceStream(rtspServer, sms_audio, streamName, inputAudioFileName, audio);
}
-*/
+
// Also, attempt to create a HTTP server for RTSP-over-HTTP tunneling.
// Try first with the default HTTP port (80), and then with the alternative HTTP
// port numbers (8000 and 8080).
diff --git a/src/snapshot/.gitignore b/src/snapshot/.gitignore
index 9cd7c97..9ca2b40 100644
--- a/src/snapshot/.gitignore
+++ b/src/snapshot/.gitignore
@@ -1,8 +1,8 @@
# Ignore the install dir
_install/
snapshot/SDK
-snapshot/jpeg-9c
-snapshot/ffmpeg-4.0.4
+snapshot/jpeg-9e
+snapshot/ffmpeg-6.0
snapshot/add_water.o
snapshot/convert2jpg.o
snapshot/imggrabber
diff --git a/src/snapshot/snapshot/Makefile b/src/snapshot/snapshot/Makefile
index 2a54974..42d26dc 100644
--- a/src/snapshot/snapshot/Makefile
+++ b/src/snapshot/snapshot/Makefile
@@ -1,8 +1,8 @@
-OBJECTS = imggrabber.o convert2jpg.o add_water.o water_mark.o
+OBJECTS = imggrabber.o convert2jpg.o add_water.o water_mark.o cap_pic.o
FFMPEG = ffmpeg-6.0
FFMPEG_DIR = ./$(FFMPEG)
INC_FF = -I$(FFMPEG_DIR)
-LIB_FF = $(FFMPEG_DIR)/libavcodec/libavcodec.a $(FFMPEG_DIR)/libavutil/libavutil.a -lpthread -lm
+LIB_FF = $(FFMPEG_DIR)/libavcodec/libavcodec.a $(FFMPEG_DIR)/libavutil/libavutil.a -lpthread -lm -lrt
JPEGLIB = jpeg-9e
JPEGLIB_DIR = ./$(JPEGLIB)
JPEGSRC = jpegsrc.v9e
@@ -28,6 +28,9 @@ add_water.o: add_water.c $(HEADERS)
water_mark.o: water_mark.c $(HEADERS)
$(CC) -c $< $(INC_J) -fPIC -O2 -o $@
+cap_pic.o: cap_pic.c $(HEADERS)
+ $(CC) -c $< $(INC_J) -fPIC -O2 -o $@
+
imggrabber: $(OBJECTS)
$(CC) $(OBJECTS) $(LIB_J) $(LIB_FF) -fPIC -O2 -o $@
$(STRIP) $@
diff --git a/src/snapshot/snapshot/add_water.c b/src/snapshot/snapshot/add_water.c
index 92c943b..336ae9d 100644
--- a/src/snapshot/snapshot/add_water.c
+++ b/src/snapshot/snapshot/add_water.c
@@ -98,7 +98,6 @@ int AddWM (WaterMarkInfo *WM_info, unsigned int bg_width, unsigned int bg_height
time_info = localtime(&rawtime);
}else{
time_info = time_data;
- time_info->tm_year = time_info->tm_year - 1900;
}
WM_Param.id_list[0] = (time_info->tm_year + 1900) / 1000;
diff --git a/src/snapshot/snapshot/cap_pic.c b/src/snapshot/snapshot/cap_pic.c
new file mode 100644
index 0000000..7b19baf
--- /dev/null
+++ b/src/snapshot/snapshot/cap_pic.c
@@ -0,0 +1,126 @@
+#include
+#include
+#include
+#include
+#include
+
+#include "cap_pic.h"
+
+mqd_t ipc_mq;
+
+void dump_string(char *source_file, const char *func, int line, char *text, ...)
+{
+ time_t now;
+ struct tm *s_now;
+ struct timeval tv;
+
+ if (text == '\0') {
+ return;
+ }
+
+ time(&now);
+ s_now = localtime(&now);
+ if (s_now != 0) {
+ gettimeofday((struct timeval *) &tv, NULL);
+ printf("\n%s(%s-%d)[%02d:%02d:%02d.%03d]:", source_file, func, line, s_now->tm_hour,
+ s_now->tm_min, s_now->tm_sec, tv.tv_usec >> 10);
+ va_list args;
+ va_start (args, text);
+ vfprintf(stdout, text, args);
+ va_end (args);
+ putchar(10);
+ }
+ return;
+}
+
+int mqueue_send(mqd_t mqfd,char *send_buf, size_t send_len)
+{
+ int iRet;
+
+ if (send_len > 512 || mqfd == -1) {
+ return -1;
+ }
+ iRet = mq_send(mqfd, send_buf, send_len, 1);
+
+ return iRet;
+}
+
+int cloud_send_msg(mqd_t mqfd, MSG_TYPE msg_type, char *payload, int payload_len)
+{
+ cloud_send_msg_ex(mqfd, msg_type, 1, payload, payload_len);
+}
+
+int cloud_send_msg_ex(mqd_t mqfd, MSG_TYPE msg_type, short sub, char *payload, int payload_len)
+{
+ mqueue_msg_header_t MsgHead;
+ char send_buf[1024] = {0};
+ int send_len = 0;
+ int fsMsgRet = 0;
+
+ memset(&MsgHead, 0, sizeof(MsgHead));
+ MsgHead.srcMid = MID_CLOUD;
+ MsgHead.mainOp = msg_type;
+ MsgHead.subOp = sub;
+ MsgHead.msgLength = payload_len;
+
+ switch(msg_type)
+ {
+ case RCD_START_SHORT_VIDEO:
+ case RCD_START_SHORT_VIDEO_10S:
+ case RCD_START_VOICECMD_VIDEO:
+ MsgHead.dstMid = MID_RCD;
+ break;
+ case RMM_START_CAPTURE:
+ case RMM_SPEAK_BAN_DEVICE:
+ case RMM_START_PANORAMA_CAPTURE:
+ case RMM_ABORT_PANORAMA_CAPTURE:
+ MsgHead.dstMid = MID_RMM;
+ break;
+ case CLOUD_DEBUG_ALARM:
+ MsgHead.dstMid = MID_CLOUD;
+ break;
+ default:
+ MsgHead.dstMid = MID_DISPATCH;
+ break;
+ }
+
+ memcpy(send_buf, &MsgHead, sizeof(MsgHead));
+ if(NULL!=payload && payload_len>0)
+ {
+ memcpy(send_buf + sizeof(MsgHead), payload, payload_len);
+ }
+ send_len = sizeof(MsgHead) + payload_len;
+
+ fsMsgRet = mqueue_send(mqfd, send_buf, send_len);
+
+ return fsMsgRet;
+}
+
+int cloud_cap_pic(char *pic_name)
+{
+ if(cloud_send_msg(ipc_mq, RMM_START_CAPTURE, pic_name, strlen(pic_name)) < 0)
+ {
+ dump_string(_F_, _FU_, _L_, "cloud_cap_pic send_msg fail!\n");
+ return -1;
+ }
+ else
+ {
+ dump_string(_F_, _FU_, _L_, "cloud_cap_pic send_msg ok!\n");
+ return 0;
+ }
+}
+
+int main_cloud_cap_pic(char *nameBuff)
+{
+ ipc_mq = mq_open("/ipc_dispatch", O_RDWR);
+ if (ipc_mq == -1) {
+ dump_string(_F_, _FU_, _L_, "open queue fail!\n");
+ return -1;
+ }
+
+ cloud_cap_pic(nameBuff);
+
+ mq_close(ipc_mq);
+
+ return 0;
+}
diff --git a/src/snapshot/snapshot/cap_pic.h b/src/snapshot/snapshot/cap_pic.h
new file mode 100644
index 0000000..addfa56
--- /dev/null
+++ b/src/snapshot/snapshot/cap_pic.h
@@ -0,0 +1,146 @@
+#ifndef CMD_SRV_H
+#define CMD_SRV_H
+
+#include
+#include
+
+#define _F_ __FILE__
+#define _FU_ __FUNCTION__
+#define _L_ __LINE__
+
+#define IPC_QUEUE_NAME "/ipc_dispatch"
+
+#define MID_P2P 1
+#define MID_RMM 2
+#define MID_CLOUD 4
+#define MID_DISPATCH 4
+#define MID_RCD 0x10
+
+typedef enum {
+ DISPATCH_SET_TIME = 0x71,
+ DISPATCH_SET_BIND_FAIL = 0x73,
+ DISPATCH_SET_POWER_ON = 0x74,
+ DISPATCH_SET_POWER_OFF = 0x75,
+ DISPATCH_SET_LIGHT_ON = 0x76,
+ DISPATCH_SET_LIGHT_OFF = 0x77,
+ DISPATCH_SET_MOTION_RCD = 0x78,
+ DISPATCH_SET_ALWAYS_RCD = 0x79,
+ DISPATCH_SET_MIRROR_ON = 0x7a,
+ DISPATCH_SET_MIRROR_OFF = 0x7b,
+ DISPATCH_MOTION_DETECT_START = 0x7c,
+ DISPATCH_MOTION_DETECT_STOP = 0x7d,
+ DISPATCH_SET_TNP_INIT_STATUS = 0x7f,
+ DISPATCH_SET_TNP_WORK_MODE = 0x80,
+ DISPATCH_SET_SD_FORMAT = 0x85,
+ DISPATCH_SET_DEBUG_MODE = 0x86,
+ DISPATCH_SET_VIDEO_BACKUP_STATE = 0x87,
+ DISPATCH_SET_BAN_DEVICE = 0x88,
+ DISPATCH_SYNC_INFO_FROM_SERVER = 0x89,
+ DISPATCH_FINISH_SYNC_INFO_FROM_SERVER = 0x8a,
+ DISPATCH_SET_CLOUD_STORAGE_ON = 0x8b,
+ DISPATCH_SET_CLOUD_STORAGE_OFF = 0x8c,
+ DISPATCH_SET_REGION = 0x8d,
+ DISPATCH_SET_TZ_OFFSET = 0x8e,
+ DISPATCH_SET_PWD_USED_CNT = 0x8f,
+ DISPATCH_SET_PWD_SYNC_SERVER = 0x90,
+ DISPATCH_SET_OTA_STATE = 0x91,
+ DISPATCH_SET_PANORAMA_CAPTURE_STATE = 0x92,
+ DISPATCH_SET_PANORAMA_CAPTURE_COUNT = 0x93,
+ DISPATCH_SET_CLOUD_STORAGE_MODE_MOTION_DETECT = 0x94,
+ DISPATCH_SET_CLOUD_STORAGE_MODE_ALL_DAY = 0x95,
+ DISPATCH_SAVE_API_SERVER = 0x96,
+ DISPATCH_CLEAR_API_SERVER = 0x97,
+ DISPATCH_SET_BIND_TIMEOUT = 0x98,
+ DISPATCH_SPEAK_WRONG_DEVICE = 0x99,
+ DISPATCH_SET_LAPSE_VIDEO = 0x9a,
+ DISPATCH_SET_LAPSE_VIDEO_MODIFY = 0x9b,
+ DISPATCH_P2P_CONNECTTED = 0xe1,
+ DISPATCH_P2P_DISCONNECTTED = 0xe2,
+ DISPATCH_P2P_VIEWING = 0xe3,
+ DISPATCH_P2P_STOP_VIEWING = 0xe4,
+ DISPATCH_P2P_CLR_VIEWING = 0xe5,
+ DISPATCH_MOTION_TRACKING_DETECT_START = 0xe6,
+ DISPATCH_BABYCRY_OCCUR = 0xea,
+ DISPATCH_BABYCRY_CLEAR = 0xeb,
+ DISPATCH_SET_SCHEDULE_POWER = 0xec,
+ DISPATCH_HUMAN_DETECT_START = 0xed,
+ DISPATCH_ABNORMAL_SOUND_OCCUR = 0xee,
+ DISPATCH_ABNORMAL_SOUND_CLEAR = 0xef,
+ DISPATCH_CLOUD_PIC_INDEX_OCCUR = 0xf0,
+ DISPATCH_CLOUD_PIC_INDEX_CLEAR = 0xf1,
+ DISPATCH_CLOUD_PIC_SET_INTERVAL = 0xf2,
+ DISPATCH_SET_CLOUD_IMAGE_ON = 0xf3,
+ DISPATCH_SET_CLOUD_IMAGE_OFF = 0xf4,
+ DISPATCH_START_RECORDE = 0Xf5,
+ DISPATCH_STOP_RECORDE = 0Xf6,
+ DISPATCH_FACE_DETECT_START = 0xf7,
+ RMM_SPEAK_SUCCESS = 0x1000,
+ RMM_SPEAK_RESET = 0x1001,
+ RMM_SPEAK_WAIT = 0x1002,
+ RMM_SPEAK_PWD_WRONG = 0x1003,
+ RMM_SPEAK_CONNECTTING = 0x1004,
+ RMM_SPEAK_SCAN_OK = 0x1005,
+ RMM_SPEAK_WIFI_CONNECTTED = 0x1006,
+ RMM_START_CAPTURE = 0x1007,
+ RMM_START_WELCOME = 0x1008,
+ RMM_SPEAK_BINDFAIL = 0x1009,
+ RMM_SPEAK_DOWNLOADING = 0x100a,
+ RMM_SPEAK_UPDATING = 0x100b,
+ RMM_SPEAK_DOWNLOAD_FAIL = 0x100c,
+ RMM_SPEAK_BAN_DEVICE = 0x100d,
+ RMM_APP_MODE_EARPHONE = 0x1021,
+ RMM_APP_MODE_SPKER = 0x1022,
+ RMM_SET_MOTION_DETECT = 0x1023,
+ RMM_SET_DAY_NIGHT_MODE = 0x1024,
+ RMM_SET_MOTION_SENSITIVITY = 0x1027,
+ RMM_SET_LDC = 0x1028,
+ RMM_SET_BABY_CRY = 0x1029,
+ RMM_SET_MIC_VOLUME = 0x102a,
+ RMM_START_PANORAMA_CAPTURE = 0x102b,
+ RMM_ABORT_PANORAMA_CAPTURE = 0x102c,
+ RMM_SPEAK_WRONG_DEVICE = 0x1031,
+ RMM_SET_ENCODE_MODE = 0x1032,
+ RMM_SET_HIGH_RESOLUTION = 0x1033,
+ RNN_VC_START_RECORD = 0x1034,
+ RMM_VC_STOP_RECORD = 0x1035,
+ RMM_SET_LAPSE_FRAMERATE = 0x1036,
+ RMM_SET_LAPSE_FORCE_IDR = 0x1037,
+ RMM_APP_AUDIO_MODE_SIMPLEX = 0x1038,
+ RMM_APP_AUDIO_MODE_DUPLEX = 0x1039,
+ RMM_SET_ABNORMAL_SOUND = 0x103a,
+ RMM_SET_ABNORMAL_SOUND_SENSITIVITY = 0x103b,
+ RMM_SET_HUMAN_MOTION = 0x103c,
+ RMM_SET_FACE_MOTION = 0x103d,
+ RCD_START_SHORT_VIDEO = 0x2000,
+ RCD_START_SHORT_VIDEO_10S = 0x2001,
+ RCD_START_VOICECMD_VIDEO = 0x2002,
+ RCD_START_SHORT_FACE_VIDEO = 0x2003,
+ RCD_START_SHORT_HUMAN_VIDEO = 0x2004,
+ DISPATCH_SET_VIEWPOINT_TRACE = 0x3002,
+ DISPATCH_SET_VOICE_CTRL = 0x3003,
+ DISPATCH_P2P_PTZ_PRESET_ADD = 0x4000,
+ DISPATCH_P2P_PTZ_PRESET_DEL = 0x4001,
+ DISPATCH_P2P_PTZ_SET_CRUISE_STAY_TIME = 0x4003,
+ DISPATCH_P2P_PTZ_CRUISE_START = 0x4004,
+ DISPATCH_P2P_PTZ_CRUISE_STOP = 0x4005,
+ DISPATCH_P2P_PTZ_SET_CURISE_PERIOD = 0x400a,
+ DISPATCH_P2P_PTZ_SET_MOTION_TRACK = 0x400b,
+ BABYCRY_START_MSG = 0x6002,
+ ABNORMAL_SOUND_START_MSG = 0x6004,
+ CLOUD_DEBUG_ALARM = 0x6006
+} MSG_TYPE;
+
+typedef struct
+{
+ int dstMid;
+ int srcMid;
+ short mainOp;
+ short subOp;
+ int msgLength;
+} mqueue_msg_header_t;
+
+void dump_string(char *source_file, const char *func, int line, char *text, ...);
+int cloud_send_msg(mqd_t mqfd, MSG_TYPE msg_type, char *payload, int payload_len);
+int cloud_send_msg_ex(mqd_t mqfd, MSG_TYPE msg_type, short sub, char *payload, int payload_len);
+
+#endif
diff --git a/src/snapshot/snapshot/imggrabber.c b/src/snapshot/snapshot/imggrabber.c
index 67f3b95..58f16eb 100644
--- a/src/snapshot/snapshot/imggrabber.c
+++ b/src/snapshot/snapshot/imggrabber.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020 roleo.
+ * Copyright (c) 2023 roleo.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -165,6 +166,8 @@
#define BUFFER_FILE "/tmp/view"
+#define USE_NATIVE_API 1
+
typedef struct {
int sps_addr;
int sps_len;
@@ -276,7 +279,7 @@ int frame_decode(unsigned char *outbuffer, unsigned char *p, int length)
}
-int add_watermark(char *buffer, int width, int height)
+int add_watermark(char *buffer, int width, int height, struct tm *watermark_tm)
{
int w_res, h_res;
char path_res[1024];
@@ -300,13 +303,13 @@ int add_watermark(char *buffer, int width, int height)
} else {
if (width == 640) {
AddWM(&WM_info, width, height, buffer,
- buffer + width*height, width-230, height-20, NULL);
+ buffer + width*height, width-230, height-20, watermark_tm);
} else if (width == 1280) {
AddWM(&WM_info, w_res, h_res, buffer,
- buffer + width*height, width-345, height-30, NULL);
+ buffer + width*height, width-345, height-30, watermark_tm);
} else {
AddWM(&WM_info, w_res, h_res, buffer,
- buffer + width*height, width-460, height-40, NULL);
+ buffer + width*height, width-460, height-40, watermark_tm);
}
WMRelease(&WM_info);
}
@@ -314,6 +317,49 @@ int add_watermark(char *buffer, int width, int height)
return 0;
}
+pid_t proc_find(const char* process_name, pid_t process_pid)
+{
+ DIR* dir;
+ struct dirent* ent;
+ char* endptr;
+ char buf[512];
+
+ if (!(dir = opendir("/proc"))) {
+ perror("can't open /proc");
+ return -1;
+ }
+
+ while((ent = readdir(dir)) != NULL) {
+ /* if endptr is not a null character, the directory is not
+ * entirely numeric, so ignore it */
+ long lpid = strtol(ent->d_name, &endptr, 10);
+ if (*endptr != '\0') {
+ continue;
+ }
+
+ /* try to open the cmdline file */
+ snprintf(buf, sizeof(buf), "/proc/%ld/cmdline", lpid);
+ FILE* fp = fopen(buf, "r");
+
+ if (fp) {
+ if (fgets(buf, sizeof(buf), fp) != NULL) {
+ /* check the first token in the file, the program name */
+ char* first = strtok(buf, " ");
+ if ((strcmp(first, process_name) == 0) && ((pid_t) lpid != process_pid)) {
+ fclose(fp);
+ closedir(dir);
+ return (pid_t) lpid;
+ }
+ }
+ fclose(fp);
+ }
+
+ }
+
+ closedir(dir);
+ return -1;
+}
+
void print_usage(char *prog_name)
{
fprintf(stderr, "Usage: %s [options]\n", prog_name);
@@ -331,6 +377,7 @@ void print_usage(char *prog_name)
fprintf(stderr, "\t --frame_length_offset VAL Set the offset of the frame lenght in the record\n");
fprintf(stderr, "\t --frame_type_offset VAL Set the offset of the frame type in the record\n");
fprintf(stderr, "\t-w, --watermark Add watermark to image\n");
+ fprintf(stderr, "\t-t, --watermark_time Set the time of the watermark\n");
fprintf(stderr, "\t-d, --debug Enable debug\n");
fprintf(stderr, "\t-h, --help Show this help\n");
}
@@ -368,6 +415,8 @@ int main(int argc, char **argv) {
unsigned char *addr;
int resolution = RESOLUTION_HIGH;
int watermark = 0;
+ int watermark_time = 0;
+ struct tm watermark_tm;
unsigned char *bufferh264, *bufferyuv;
int bufferh264_size;
@@ -411,6 +460,7 @@ int main(int argc, char **argv) {
{"frame_length_offset", required_argument, 0, '7'},
{"frame_type_offset", required_argument, 0, '8'},
{"watermark", no_argument, 0, 'w'},
+ {"watermark_time", required_argument, 0, 't'},
{"debug", no_argument, 0, 'd'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
@@ -418,7 +468,7 @@ int main(int argc, char **argv) {
/* getopt_long stores the option index here. */
int option_index = 0;
- c = getopt_long (argc, argv, "r:9:a:m:0:1:2:3:4:5:6:7:8:wdh",
+ c = getopt_long (argc, argv, "r:9:a:m:0:1:2:3:4:5:6:7:8:wt:dh",
long_options, &option_index);
/* Detect the end of the options. */
@@ -538,6 +588,25 @@ int main(int argc, char **argv) {
watermark = 1;
break;
+ case 't':
+ {
+ int d0, d1, d2, d3, d4, d5, d6;
+ d0 = sscanf(optarg, "%d-%d-%d %d:%d:%d", &d1, &d2, &d3, &d4, &d5 ,&d6);
+ if (d0 == 6) {
+ watermark_tm.tm_year = d1 - 1900;
+ watermark_tm.tm_mon = d2 - 1;
+ watermark_tm.tm_mday = d3;
+ watermark_tm.tm_hour = d4;
+ watermark_tm.tm_min = d5;
+ watermark_tm.tm_sec = d6;
+ watermark_time = 1;
+ } else {
+ print_usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ }
+
case '0':
case '1':
case '2':
@@ -614,6 +683,55 @@ int main(int argc, char **argv) {
if (debug) fprintf(stderr, "Starting program\n");
+ // Check if snapshot is disabled
+ if (access("/tmp/snapshot.disabled", F_OK ) == 0 ) {
+ fprintf(stderr, "Snapshot is disabled\n");
+ return 0;
+ }
+
+ // Check if snapshot is low res
+ if (access("/tmp/snapshot.low", F_OK ) == 0 ) {
+ fprintf(stderr, "Snapshot is low res and watermark is disabled\n");
+ resolution = RESOLUTION_LOW;
+ watermark = 0;
+ }
+
+ // Check if the process is already running
+ pid_t my_pid = getpid();
+ if (proc_find(basename(argv[0]), my_pid) != -1) {
+ fprintf(stderr, "Process is already running\n");
+ return 0;
+ }
+
+// This method doesn't have performace issue
+// But:
+// - is not available for high resolution
+// - it's not possible to add watermarks
+#ifdef USE_NATIVE_API
+ if ((resolution == RESOLUTION_LOW) && (watermark == 0)) {
+ int old_stdout = dup(1);
+ int nj;
+ char sj[1024];
+ FILE *aj;
+
+ fprintf(stderr, "Using native api\n");
+
+ freopen ("/dev/null", "w", stdout);
+ main_cloud_cap_pic("/tmp/sd/snapshot.tmp");
+ usleep(500000);
+ fclose(stdout);
+ stdout = fdopen(old_stdout, "w");
+
+ aj = fopen("/tmp/sd/snapshot.tmp", "r");
+ while ((nj = fread(sj, 1, sizeof(sj), aj))) {
+ fwrite(sj, 1, nj, stdout);
+ }
+ fclose(aj);
+ remove("/tmp/sd/snapshot.tmp");
+ return 0;
+ }
+#endif
+
if (resolution == RESOLUTION_LOW) {
table_offset = table_low_offset;
stream_offset = stream_low_offset;
@@ -773,9 +891,16 @@ int main(int argc, char **argv) {
if (watermark) {
if (debug) fprintf(stderr, "Adding watermark\n");
- if (add_watermark(bufferyuv, width, height) < 0) {
- fprintf(stderr, "Error adding watermark\n");
- return -8;
+ if (watermark_time == 1) {
+ if (add_watermark(bufferyuv, width, height, &watermark_tm) < 0) {
+ fprintf(stderr, "Error adding watermark\n");
+ return -8;
+ }
+ } else {
+ if (add_watermark(bufferyuv, width, height, NULL) < 0) {
+ fprintf(stderr, "Error adding watermark\n");
+ return -8;
+ }
}
}
diff --git a/src/static/static/home/yi-hack-v5/etc/camera.conf b/src/static/static/home/yi-hack-v5/etc/camera.conf
index 8919915..cff8fd3 100644
--- a/src/static/static/home/yi-hack-v5/etc/camera.conf
+++ b/src/static/static/home/yi-hack-v5/etc/camera.conf
@@ -1,9 +1,15 @@
SWITCH_ON=yes
SAVE_VIDEO_ON_MOTION=yes
SENSITIVITY=low
-AI_HUMAN_DETECTION=no
SOUND_DETECTION=no
SOUND_SENSITIVITY=80
+BABY_CRYING_DETECT=no
LED=yes
ROTATE=no
IR=yes
+MOTION_DETECTION=yes
+AI_VEHICLE_DETECTION=no
+AI_ANIMAL_DETECTION=no
+FACE_DETECTION=no
+MOTION_TRACKING=no
+CRUISE=no
diff --git a/src/static/static/home/yi-hack-v5/etc/mqttv4.conf b/src/static/static/home/yi-hack-v5/etc/mqttv4.conf
index e601173..4dcbf24 100644
--- a/src/static/static/home/yi-hack-v5/etc/mqttv4.conf
+++ b/src/static/static/home/yi-hack-v5/etc/mqttv4.conf
@@ -24,9 +24,8 @@ MQTT_PREFIX=yicam
TOPIC_BIRTH_WILL=status
TOPIC_MOTION=motion_detection
TOPIC_MOTION_IMAGE=motion_detection_image
+MOTION_IMAGE_DELAY=0.5
TOPIC_MOTION_FILES=motion_files
-TOPIC_AI_HUMAN_DETECTION=ai_human_detection
-TOPIC_BABY_CRYING=baby_crying
TOPIC_SOUND_DETECTION=sound_detection
# -----------------------------------------------------------------------------
@@ -37,9 +36,8 @@ BIRTH_MSG=online
WILL_MSG=offline
MOTION_START_MSG=motion_start
MOTION_STOP_MSG=motion_stop
-AI_HUMAN_DETECTION_MSG=human
BABY_CRYING_MSG=crying
-SOUND_DETECTION_MSG=sound
+SOUND_DETECTION_MSG=sound_detected
# -----------------------------------------------------------------------------
# Other settings
@@ -51,6 +49,4 @@ MQTT_RETAIN_BIRTH_WILL=1
MQTT_RETAIN_MOTION=0
MQTT_RETAIN_MOTION_IMAGE=0
MQTT_RETAIN_MOTION_FILES=0
-MQTT_RETAIN_AI_HUMAN_DETECTION=0
-MQTT_RETAIN_BABY_CRYING=0
MQTT_RETAIN_SOUND_DETECTION=0
diff --git a/src/static/static/home/yi-hack-v5/etc/ptz_presets.conf b/src/static/static/home/yi-hack-v5/etc/ptz_presets.conf
new file mode 100644
index 0000000..1becf62
--- /dev/null
+++ b/src/static/static/home/yi-hack-v5/etc/ptz_presets.conf
@@ -0,0 +1,8 @@
+0=
+1=
+2=
+3=
+4=
+5=
+6=
+7=
diff --git a/src/static/static/home/yi-hack-v5/etc/system.conf b/src/static/static/home/yi-hack-v5/etc/system.conf
index aa88ff6..00b2d7d 100644
--- a/src/static/static/home/yi-hack-v5/etc/system.conf
+++ b/src/static/static/home/yi-hack-v5/etc/system.conf
@@ -13,14 +13,13 @@ ONVIF=no
ONVIF_WSDD=no
ONVIF_PROFILE=high
ONVIF_NETIF=wlan0
-ONVIF_WM_SNAPSHOT=no
+TIME_OSD=no
NTPD=no
NTP_SERVER=pool.ntp.org
PROXYCHAINSNG=no
SWAP_FILE=no
RTSP_PORT=554
-ONVIF_PORT=80
-HTTPD_PORT=8080
+HTTPD_PORT=80
USERNAME=
PASSWORD=
TIMEZONE=
@@ -31,7 +30,18 @@ FTP_DIR=
FTP_DIR_TREE=no
FTP_USERNAME=
FTP_PASSWORD=
-FTP_FILE_DELETE_AFTER_UPLOAD=yes
+FTP_FILE_DELETE_AFTER_UPLOAD=no
CHECK_UPDATES=no
SSH_PASSWORD=
CRONTAB=
+RTSP_ALT=no
+SPEAKER_AUDIO=yes
+SNAPSHOT=yes
+SNAPSHOT_VIDEO=no
+SNAPSHOT_LOW=no
+TIMELAPSE=no
+TIMELAPSE_FTP=no
+TIMELAPSE_DT=60
+TIMELAPSE_VDT=
+TIME_OSD=no
+DEBUG_LOG=no
diff --git a/src/static/static/home/yi-hack-v5/script/check_conf.sh b/src/static/static/home/yi-hack-v5/script/check_conf.sh
index 834e56a..391f898 100755
--- a/src/static/static/home/yi-hack-v5/script/check_conf.sh
+++ b/src/static/static/home/yi-hack-v5/script/check_conf.sh
@@ -14,30 +14,21 @@ DISABLE_CLOUD=no
REC_WITHOUT_CLOUD=no
MQTT=no
RTSP=no
-RTSP_ALT=no
RTSP_STREAM=high
RTSP_AUDIO=no
-SPEAKER_AUDIO=yes
-SNAPSHOT=yes
-SNAPSHOT_VIDEO=no
-SNAPSHOT_LOW=no
-TIMELAPSE=no
-TIMELAPSE_FTP=no
-TIMELAPSE_DT=60
-TIMELAPSE_VDT=
ONVIF=no
ONVIF_WSDD=yes
ONVIF_PROFILE=high
ONVIF_NETIF=wlan0
-ONVIF_WM_SNAPSHOT=yes
TIME_OSD=no
+SNAPSHOT=yes
+SNAPSHOT_LOW=no
NTPD=yes
NTP_SERVER=pool.ntp.org
PROXYCHAINSNG=no
SWAP_FILE=yes
RTSP_PORT=554
-ONVIF_PORT=80
-HTTPD_PORT=8080
+HTTPD_PORT=80
USERNAME=
PASSWORD=
TIMEZONE=
@@ -56,19 +47,13 @@ DEBUG_LOG=no"
PARMS2="
SWITCH_ON=yes
SAVE_VIDEO_ON_MOTION=yes
-MOTION_DETECTION=yes
SENSITIVITY=low
-AI_HUMAN_DETECTION=no
-AI_VEHICLE_DETECTION=no
-AI_ANIMAL_DETECTION=no
-FACE_DETECTION=no
-MOTION_TRACKING=no
SOUND_DETECTION=no
SOUND_SENSITIVITY=80
+BABY_CRYING_DETECT=no
LED=yes
ROTATE=no
-IR=yes
-CRUISE=no"
+IR=yes"
PARMS3="
MQTT_IP=0.0.0.0
@@ -82,15 +67,11 @@ TOPIC_MOTION=motion_detection
TOPIC_MOTION_IMAGE=motion_detection_image
MOTION_IMAGE_DELAY=0.5
TOPIC_MOTION_FILES=motion_files
-TOPIC_AI_HUMAN_DETECTION=ai_human_detection
TOPIC_SOUND_DETECTION=sound_detection
BIRTH_MSG=online
WILL_MSG=offline
MOTION_START_MSG=motion_start
MOTION_STOP_MSG=motion_stop
-AI_HUMAN_DETECTION_MSG=human
-AI_VEHICLE_DETECTION_MSG=vehicle
-AI_ANIMAL_DETECTION_MSG=animal
BABY_CRYING_MSG=crying
SOUND_DETECTION_MSG=sound_detected
MQTT_KEEPALIVE=120
@@ -99,7 +80,6 @@ MQTT_RETAIN_BIRTH_WILL=1
MQTT_RETAIN_MOTION=0
MQTT_RETAIN_MOTION_IMAGE=0
MQTT_RETAIN_MOTION_FILES=0
-MQTT_RETAIN_AI_HUMAN_DETECTION=0
MQTT_RETAIN_SOUND_DETECTION=0"
if [ ! -f $SYSTEM_CONF_FILE ]; then
diff --git a/src/static/static/home/yi-hack-v5/script/cloudAPI b/src/static/static/home/yi-hack-v5/script/cloudAPI
index 7461162..39148aa 100755
--- a/src/static/static/home/yi-hack-v5/script/cloudAPI
+++ b/src/static/static/home/yi-hack-v5/script/cloudAPI
@@ -1,5 +1,7 @@
#!/bin/sh
+# 0.4.1d
+
ulimit -s 1024
export LD_LIBRARY_PATH=/home/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/tmp/sd/yi-hack-v5/lib:$LD_LIBRARY_PATH
@@ -28,8 +30,11 @@ if [[ $(get_config DISABLE_CLOUD) == "yes" ]] ; then
cd /home/app
./cloudAPI_fake "$@"
else
- if [[ $(get_config PROXYCHAINSNG) == "yes" ]] ; then
- $YI_HACK_V5_PREFIX/bin/proxychains4 ./home/app/cloudAPI_real "$@"
+ if [ "$4" == "https://api.xiaoyi.com/v4/ipc/check_did" ]; then
+ echo '{"allow":true,"code":"20000"}'
+ elif [[ $(get_config PROXYCHAINSNG) == "yes" ]] ; then
+ cd /home/app
+ $YI_HACK_V5_PREFIX/bin/proxychains4 ./cloudAPI_real "$@"
else
cd /home/app
./cloudAPI_real "$@"
diff --git a/src/static/static/home/yi-hack-v5/script/cloudAPI_fake b/src/static/static/home/yi-hack-v5/script/cloudAPI_fake
index 748167d..378a4cf 100755
--- a/src/static/static/home/yi-hack-v5/script/cloudAPI_fake
+++ b/src/static/static/home/yi-hack-v5/script/cloudAPI_fake
@@ -73,7 +73,7 @@ done
if [ "$c" = "138" ]; then
#CMD_do_login_v4
- echo '{"code":"20000","appParam":"","css_flag":0,"css_mode":0,"codingProtocol":"265","abilityTable":""}'
+ echo '{"code":"20000","appParam":{},"css_flag":0,"css_mode":0,"codingProtocol":"265","abilityTable":""}'
#{"code":"20000","appParam":{"schedule_power":{"schedule_power_on":{"enable":0,"repeater":"","time":"2212220800"},"schedule_power_off":{"enable":0,"repeater":"","time":"2212222200"}}},"css_flag":0,"css_mode":0,"codingProtocol":"265","abilityTable":"","restartTpye":1}
elif [ "$c" = "136" ]; then
#CMD_do_syntime
@@ -93,10 +93,10 @@ elif [ "$c" = "142" ]; then
#CMD_do_get_dev_info
TIMEZONE=$(get_config TIMEZONE)
TZP=$(TZ="$TIMEZONE" date +%z)
- TZP_SET=$(echo ${TZP:1:2} ${TZP:3:2} | awk '{ print ($1*3600+$2*60) }')
+ TZP_SET=$(echo ${TZP:0:1} ${TZP:1:2} ${TZP:3:2} | awk '{ print ($1$2*3600+$3*60) }')
TZP_GMT=$(echo GMT${TZP:0:1}${TZP:1:2}:${TZP:3:2})
- echo '{"code":"20000","data":{"timezone":"'$TZP_GMT'","language":"en-US","tz_offset":'$TZP_SET'000,"css_flag":0,"css_mode":0,"appParam":"","doorbellCoolingDuration":"0"}}'
- #echo '{"code":"20000","data":{"timezone":"'$TZP_GMT'","language":"en-US","tz_offset":'$TZP_SET'000,"css_flag":0,"css_mode":0,"appParam":"","doorbellCoolingDuration":"0","allowFeature":{"Vehicle":0,"Animal":0,"Person":1}}}'
+ #echo '{"code":"20000","data":{"timezone":"'$TZP_GMT'","language":"en-US","tz_offset":'$TZP_SET'000,"css_flag":0,"css_mode":0,"appParam":{},"doorbellCoolingDuration":"0"}}'
+ echo '{"code":"20000","data":{"timezone":"'$TZP_GMT'","language":"en-US","tz_offset":'$TZP_SET'000,"css_flag":0,"css_mode":0,"appParam":{},"doorbellCoolingDuration":"0","allowFeature":{"Vehicle":0,"Animal":0,"Person":1}}}'
#{"code":"20000","data":{"timezone":"GMT+01:00","language":"en-US","tz_offset":3600000,"css_flag":0,"css_mode":0,"appParam":{"schedule_power":{"schedule_power_on":{"enable":0,"repeater":"","time":"2212220800"},"schedule_power_off":{"enable":0,"repeater":"","time":"2212222200"}}},"doorbellCoolingDuration":"0","model":"38","allowFeature":{"Vehicle":0,"Animal":0,"Person":1}}}
elif [ "$c" = "304" ]; then
#CMD_do_update_event_v4
diff --git a/src/static/static/home/yi-hack-v5/script/configure_wifi.sh b/src/static/static/home/yi-hack-v5/script/configure_wifi.sh
index 29bb7e5..b6d3f68 100755
--- a/src/static/static/home/yi-hack-v5/script/configure_wifi.sh
+++ b/src/static/static/home/yi-hack-v5/script/configure_wifi.sh
@@ -1,10 +1,20 @@
#!/bin/sh
+# 0.4.1a
+
function print_help {
echo "configure_wifi.sh"
echo "will be used on next boot"
}
+if [ -f "/tmp/sd/recover/mtdblock2_recover.bin" ]; then
+ DATE=$(date '+%Y%m%d%H%M%S')
+ dd if=/dev/mtdblock2 of=/tmp/sd/recover/mtdblock2_prerecover_$DATE.bin 2>/dev/null
+ dd if=/tmp/sd/recover/mtdblock2_recover.bin of=/dev/mtdblock2 2>/dev/null
+ mv /tmp/sd/recover/mtdblock2_recover.bin /tmp/sd/recover/mtdblock2_recover_done.bin
+ reboot
+fi
+
CFG_FILE=/tmp/configure_wifi.cfg
if [ ! -f "$CFG_FILE" ]; then
echo "configure_wifi.cfg not found"
diff --git a/src/static/static/home/yi-hack-v5/script/launch.sh b/src/static/static/home/yi-hack-v5/script/launch.sh
index c267b0f..b0def59 100755
--- a/src/static/static/home/yi-hack-v5/script/launch.sh
+++ b/src/static/static/home/yi-hack-v5/script/launch.sh
@@ -1,3 +1,6 @@
+#!/bin/sh
+#
+# 0.4.1b
#
# This file is part of yi-hack-v5 (https://github.com/alienatedsec/yi-hack-v5).
# Copyright (c) 2021-2023 alienatedsec - v5 specific
@@ -14,55 +17,73 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
-# Launch - version 0.3.8
-#
-#!/bin/sh
+
kill_all() {
- # Kills all running instances of app1 and app2
- killall wd_rtsp.sh
- killall rRTSPServer
- killall h264grabber
+ # Kills all running instances
+ echo Round 1 - Killing using SIGTERM
+ killall -s SIGTERM wd_rtsp.sh
+ killall -s SIGTERM rRTSPServer
+ killall -s SIGTERM h264grabber
+ echo Round 1 - Finished
+ sleep 2
+ echo Round 2 - Killing using SIGKILL
+ killall -s SIGKILL wd_rtsp.sh
+ killall -s SIGKILL rRTSPServer
+ killall -s SIGKILL h264grabber
+ echo Round 2 - Finished
}
launch_apps() {
- # Launches app1 and app2 with different commands
+ # Launches apps with different commands
if [ "$execute_audio" = true ]; then
+ echo Launching - h264grabber -r audio -m "$model" -f &
h264grabber -r audio -m "$model" -f &
fi
if [ "$settings" = "high" ]; then
debug_flag=""
if [ "$debug_mode" = true ]; then
- debug_flag="-d 7"
+ debug_flag="-d "$debug_level""
fi
+ echo Launching - h264grabber -r high -m "$model" -f &
h264grabber -r high -m "$model" -f &
+ sleep 1
+ echo Launching - rRTSPServer -r high -a "$enable_audio" -p 554 -u -w $debug_flag &
rRTSPServer -r high -a "$enable_audio" -p 554 -u -w $debug_flag &
fi
if [ "$settings" = "low" ]; then
debug_flag=""
if [ "$debug_mode" = true ]; then
- debug_flag="-d 7"
+ debug_flag="-d "$debug_level""
fi
+ echo Launching - h264grabber -r low -m "$model" -f &
h264grabber -r low -m "$model" -f &
+ sleep 1
+ echo Launching - rRTSPServer -r low -a "$enable_audio" -p 554 -u -w $debug_flag &
rRTSPServer -r low -a "$enable_audio" -p 554 -u -w $debug_flag &
fi
if [ "$settings" = "both" ]; then
debug_flag=""
if [ "$debug_mode" = true ]; then
- debug_flag="-d 7"
+ debug_flag="-d "$debug_level""
fi
+ echo Launching - h264grabber -r low -m "$model" -f &
h264grabber -r low -m "$model" -f &
+ sleep 1
+ echo Launching - h264grabber -r high -m "$model" -f &
h264grabber -r high -m "$model" -f &
+ sleep 1
+ echo Launching - rRTSPServer -r both -a "$enable_audio" -p 554 -u -w $debug_flag &
rRTSPServer -r both -a "$enable_audio" -p 554 -u -w $debug_flag &
fi
}
-# Read model name from file
+# Read model and versions from files
model=$(cat /home/app/.camver)
version_cam=$(cat /home/yi-hack-v5/version)
version_sd=$(cat /tmp/sd/yi-hack-v5/version)
@@ -90,6 +111,11 @@ elif [ "$operation" = "l" ] || [ "$operation" = "L" ]; then
if [ "$debug_choice" = "y" ] || [ "$debug_choice" = "Y" ]; then
debug_mode=true
+ read -p "Provide debug level (0-15): " debug_level
+ while ! [ "$debug_level" -ge 0 -a "$debug_level" -le 15 ] 2>/dev/null; do
+ echo "Invalid input. Please enter a debug level between 0 and 15."
+ read -p "Provide debug level (0-15): " debug_level
+ done
else
debug_mode=false
fi
diff --git a/src/static/static/home/yi-hack-v5/script/mqtt_advertise/mqtt_adv_homeassistant.sh b/src/static/static/home/yi-hack-v5/script/mqtt_advertise/mqtt_adv_homeassistant.sh
index 3cea080..a2107d5 100755
--- a/src/static/static/home/yi-hack-v5/script/mqtt_advertise/mqtt_adv_homeassistant.sh
+++ b/src/static/static/home/yi-hack-v5/script/mqtt_advertise/mqtt_adv_homeassistant.sh
@@ -97,61 +97,61 @@ if [ "$MQTT_ADV_INFO_GLOBAL_ENABLE" == "yes" ]; then
QOS=""
fi
#Hostname
- UNIQUE_NAME=$NAME" Hostname"
+ UNIQUE_NAME="Hostname"
UNIQUE_ID=$IDENTIFIERS"-hostname"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/hostname/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:network","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.hostname }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#IP
- UNIQUE_NAME=$NAME" Local IP"
+ UNIQUE_NAME="Local IP"
UNIQUE_ID=$IDENTIFIERS"-local_ip"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/local_ip/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:ip","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.local_ip }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Netmask
- UNIQUE_NAME=$NAME" Netmask"
+ UNIQUE_NAME="Netmask"
UNIQUE_ID=$IDENTIFIERS"-netmask"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/netmask/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:ip","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.netmask }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Gateway
- UNIQUE_NAME=$NAME" Gateway"
+ UNIQUE_NAME="Gateway"
UNIQUE_ID=$IDENTIFIERS"-gateway"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/gateway/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:ip","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.gateway }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#WLan ESSID
- UNIQUE_NAME=$NAME" WiFi ESSID"
+ UNIQUE_NAME="WiFi ESSID"
UNIQUE_ID=$IDENTIFIERS"-wlan_essid"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/wlan_essid/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:wifi","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.wlan_essid }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Mac Address
- UNIQUE_NAME=$NAME" Mac Address"
+ UNIQUE_NAME="Mac Address"
UNIQUE_ID=$IDENTIFIERS"-mac_addr"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/mac_addr/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:network","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.mac_addr }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Home Version
- UNIQUE_NAME=$NAME" Home Version"
+ UNIQUE_NAME="Home Version"
UNIQUE_ID=$IDENTIFIERS"-home_version"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/home_version/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:memory","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.home_version }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Firmware Version
- UNIQUE_NAME=$NAME" Firmware Version"
+ UNIQUE_NAME="Firmware Version"
UNIQUE_ID=$IDENTIFIERS"-fw_version"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/fw_version/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:network","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.fw_version }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Model Suffix
- UNIQUE_NAME=$NAME" Model Suffix"
+ UNIQUE_NAME="Model Suffix"
UNIQUE_ID=$IDENTIFIERS"-model_suffix"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/model_suffix/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:network","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.model_suffix }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Serial Number
- UNIQUE_NAME=$NAME" Serial Number"
+ UNIQUE_NAME="Serial Number"
UNIQUE_ID=$IDENTIFIERS"-serial_number"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/serial_number/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:webcam","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_INFO_GLOBAL_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.serial_number }}", "platform": "mqtt"}'
@@ -175,37 +175,37 @@ if [ "$MQTT_ADV_TELEMETRY_ENABLE" == "yes" ]; then
QOS=""
fi
#Total Memory
- UNIQUE_NAME=$NAME" Total Memory"
+ UNIQUE_NAME="Total Memory"
UNIQUE_ID=$IDENTIFIERS"-total_memory"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/total_memory/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:memory","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_TELEMETRY_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.total_memory }}","unit_of_measurement":"KB", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Free Memory
- UNIQUE_NAME=$NAME" Free Memory"
+ UNIQUE_NAME="Free Memory"
UNIQUE_ID=$IDENTIFIERS"-free_memory"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/free_memory/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:memory","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_TELEMETRY_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.free_memory }}","unit_of_measurement":"KB", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#FreeSD
- UNIQUE_NAME=$NAME" Free SD"
+ UNIQUE_NAME="Free SD"
UNIQUE_ID=$IDENTIFIERS"-free_sd"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/free_sd/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:micro-sd","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_TELEMETRY_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.free_sd|regex_replace(find=\"%\", replace=\"\", ignorecase=False) }}","unit_of_measurement":"%", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Load AVG
- UNIQUE_NAME=$NAME" Load AVG"
+ UNIQUE_NAME="Load AVG"
UNIQUE_ID=$IDENTIFIERS"-load_avg"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/load_avg/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:network","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_TELEMETRY_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.load_avg }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#Uptime
- UNIQUE_NAME=$NAME" Uptime"
+ UNIQUE_NAME="Uptime"
UNIQUE_ID=$IDENTIFIERS"-uptime"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/uptime/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "device_class":"timestamp","icon":"mdi:timer-outline","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_TELEMETRY_TOPIC'","name":"'$UNIQUE_NAME'","'unique_id'":"'$UNIQUE_ID'","value_template":"{{ (as_timestamp(now())-(value_json.uptime|int))|timestamp_local }}", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
#WLanStrenght
- UNIQUE_NAME=$NAME" Wlan Strengh"
+ UNIQUE_NAME="Wlan Strengh"
UNIQUE_ID=$IDENTIFIERS"-wlan_strength"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/sensor/$IDENTIFIERS/wlan_strength/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "device_class":"signal_strength","icon":"mdi:wifi","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_TELEMETRY_TOPIC'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ ((value_json.wlan_strength|int) * 100 / 70 )|int }}","unit_of_measurement":"%", "platform": "mqtt"}'
@@ -218,7 +218,7 @@ else
fi
# Motion Detection
-UNIQUE_NAME=$NAME" Movement"
+UNIQUE_NAME="Movement"
UNIQUE_ID=$IDENTIFIERS"-motion_detection"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/binary_sensor/$IDENTIFIERS/motion_detection/config
MQTT_RETAIN_MOTION=$(get_config MQTT_RETAIN_MOTION)
@@ -231,7 +231,7 @@ MQTT_RETAIN_MOTION=$(get_config MQTT_RETAIN_MOTION)
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"}, "qos": "'$MQTT_QOS'", '$RETAIN' "device_class":"motion","state_topic":"'$MQTT_PREFIX'/'$TOPIC_MOTION'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","payload_on":"'$MOTION_START_MSG'","payload_off":"'$MOTION_STOP_MSG'", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
# Human Detection
-UNIQUE_NAME=$NAME" Human Detection"
+UNIQUE_NAME="Human Detection"
UNIQUE_ID=$IDENTIFIERS"-ai_human_detection"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/binary_sensor/$IDENTIFIERS/ai_human_detection/config
MQTT_RETAIN_AI_HUMAN_DETECTION=$(get_config MQTT_RETAIN_AI_HUMAN_DETECTION)
@@ -244,7 +244,7 @@ MQTT_RETAIN_AI_HUMAN_DETECTION=$(get_config MQTT_RETAIN_AI_HUMAN_DETECTION)
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"}, "qos": "'$MQTT_QOS'", '$RETAIN' "device_class":"motion","state_topic":"'$MQTT_PREFIX'/'$TOPIC_AI_HUMAN_DETECTION'","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","payload_on":"'$AI_HUMAN_DETECTION_MSG'","off_delay":60, "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
# Sound Detection
-UNIQUE_NAME=$NAME" Sound Detection"
+UNIQUE_NAME="Sound Detection"
UNIQUE_ID=$IDENTIFIERS"-sound_detection"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/binary_sensor/$IDENTIFIERS/sound_detection/config
MQTT_RETAIN_SOUND_DETECTION=$(get_config MQTT_RETAIN_SOUND_DETECTION)
@@ -260,7 +260,7 @@ $YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $T
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/binary_sensor/$IDENTIFIERS/baby_crying/config
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME -h $HOST -t $TOPIC -m ""
# Motion Detection Image
-UNIQUE_NAME=$NAME" Motion Detection Image"
+UNIQUE_NAME="Motion Detection Image"
UNIQUE_ID=$IDENTIFIERS"-motion_detection_image"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/camera/$IDENTIFIERS/motion_detection_image/config
MQTT_RETAIN_MOTION_IMAGE=$(get_config MQTT_RETAIN_MOTION_IMAGE)
@@ -284,13 +284,13 @@ if [ "$MQTT_ADV_CAMERA_SETTING_ENABLE" == "yes" ]; then
QOS=""
fi
# Switch On
- UNIQUE_NAME=$NAME" Switch Status"
+ UNIQUE_NAME="Switch Status"
UNIQUE_ID=$IDENTIFIERS"-SWITCH_ON"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/switch/$IDENTIFIERS/SWITCH_ON/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:video","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'","command_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'/SWITCH_ON/set","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.SWITCH_ON }}","payload_on":"yes","payload_off":"no", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
# Sound Detection
- UNIQUE_NAME=$NAME" Sound Detection"
+ UNIQUE_NAME="Sound Detection"
UNIQUE_ID=$IDENTIFIERS"-SOUND_DETECTION"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/switch/$IDENTIFIERS/SOUND_DETECTION/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"}, '$QOS' '$RETAIN' "icon":"mdi:music-note","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'","command_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'/SOUND_DETECTION/set","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.SOUND_DETECTION }}","payload_on":"yes","payload_off":"no", "platform": "mqtt"}'
@@ -299,19 +299,19 @@ if [ "$MQTT_ADV_CAMERA_SETTING_ENABLE" == "yes" ]; then
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/switch/$IDENTIFIERS/BABY_CRYING_DETECT/config
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME -h $HOST -t $TOPIC -n
# Led
- UNIQUE_NAME=$NAME" Status Led"
+ UNIQUE_NAME="Status Led"
UNIQUE_ID=$IDENTIFIERS"-LED"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/switch/$IDENTIFIERS/LED/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:led-on","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'","command_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'/LED/set","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.LED }}","payload_on":"yes","payload_off":"no", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
# IR
- UNIQUE_NAME=$NAME" IR Led"
+ UNIQUE_NAME="IR Led"
UNIQUE_ID=$IDENTIFIERS"-IR"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/switch/$IDENTIFIERS/IR/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:remote","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'","command_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'/IR/set","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.IR }}","payload_on":"yes","payload_off":"no", "platform": "mqtt"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
# Rotate
- UNIQUE_NAME=$NAME" Rotate"
+ UNIQUE_NAME=" Rotate"
UNIQUE_ID=$IDENTIFIERS"-ROTATE"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/switch/$IDENTIFIERS/ROTATE/config
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:monitor","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'","command_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'/ROTATE/set","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.ROTATE }}","payload_on":"yes","payload_off":"no", "platform": "mqtt"}'
diff --git a/src/static/static/home/yi-hack-v5/script/ptz_presets.sh b/src/static/static/home/yi-hack-v5/script/ptz_presets.sh
new file mode 100755
index 0000000..ab900eb
--- /dev/null
+++ b/src/static/static/home/yi-hack-v5/script/ptz_presets.sh
@@ -0,0 +1,146 @@
+#!/bin/sh
+
+YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
+PTZ_CONF_FILE=$YI_HACK_PREFIX/etc/ptz_presets.conf
+
+add_del_preset() {
+ FIRST_AVAIL=8
+ PRESET_0=""
+ PRESET_1=""
+ PRESET_2=""
+ PRESET_3=""
+ PRESET_4=""
+ PRESET_5=""
+ PRESET_6=""
+ PRESET_7=""
+
+ OLD_IFS="$IFS"
+ IFS="=,"
+ while read -r PNUM PNAME PX PY; do
+ if [ -z $PNUM ]; then
+ continue;
+ fi
+ if [ "${PNUM::1}" == "#" ]; then
+ continue;
+ fi
+ if [ -z $PNAME ] && [ $FIRST_AVAIL -gt $PNUM ]; then
+ FIRST_AVAIL=$PNUM
+ fi
+ if [ "$1" == "add" ] && [ "$PNAME" == "$2" ]; then
+ return 1
+ fi
+
+ for I in 0 1 2 3 4 5 6 7; do
+ if [ "$PNUM" == "$I" ]; then
+ eval PRESET_$I=$PNAME,$PX,$PY
+ fi
+ done
+ done < $PTZ_CONF_FILE
+
+ IFS="$OLD_IFS"
+
+ if [ "$1" == "add" ]; then
+ if [ $FIRST_AVAIL -le 7 ]; then
+ eval PRESET_$FIRST_AVAIL=$2,$3,$4
+ else
+ return 2
+ fi
+ fi
+
+ if [ "$1" == "del" ]; then
+ for I in 0 1 2 3 4 5 6 7; do
+ if [ "$2" == "$I" ] || [ "$2" == "all" ]; then
+ eval PRESET_$I=""
+ fi
+ done
+ fi
+
+ if [ "$1" == "add" ] || [ "$1" == "del" ]; then
+ echo 0=$PRESET_0 > $PTZ_CONF_FILE
+ echo 1=$PRESET_1 >> $PTZ_CONF_FILE
+ echo 2=$PRESET_2 >> $PTZ_CONF_FILE
+ echo 3=$PRESET_3 >> $PTZ_CONF_FILE
+ echo 4=$PRESET_4 >> $PTZ_CONF_FILE
+ echo 5=$PRESET_5 >> $PTZ_CONF_FILE
+ echo 6=$PRESET_6 >> $PTZ_CONF_FILE
+ echo 7=$PRESET_7 >> $PTZ_CONF_FILE
+ fi
+}
+
+ACTION="none"
+NUM=-1
+NAME=""
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ -a|--action)
+ ACTION="$2"
+ shift # past argument
+ shift # past value
+ ;;
+ -n|--number)
+ NUM="$2"
+ shift # past argument
+ shift # past value
+ ;;
+ -m|--name)
+ NAME="$2"
+ shift # past argument
+ shift # past value
+ ;;
+ -*|--*)
+ echo "Unknown option $1"
+ exit 1
+ ;;
+ *)
+ shift # past argument
+ ;;
+ esac
+done
+
+if [ $ACTION == "get_presets" ] ; then
+ cat $PTZ_CONF_FILE
+elif [ $ACTION == "go_preset" ] ; then
+ if [ $NUM -lt 0 ] || [ $NUM -gt 7 ] ; then
+ echo "Preset number out of range"
+ exit
+ fi
+ ipc_cmd -p $NUM
+elif [ $ACTION == "add_preset" ]; then
+ # add preset
+ POS=$(ipc_cmd -g)
+ if [ -z $POS ]; then
+ echo "Error getting PTZ position"
+ exit
+ fi
+ POSX=$(echo $POS | cut -d ',' -f 1)
+ POSY=$(echo $POS | cut -d ',' -f 2)
+ if [ -z $POSX ] || [ -z $POSY ]; then
+ echo "Error getting PTZ position"
+ exit
+ fi
+
+ add_del_preset add $NAME $POSX $POSY
+ RES=$?
+ if [ $RES -eq 1 ]; then
+ echo "Preset already exists"
+ exit
+ fi
+ if [ $RES -eq 2 ]; then
+ echo "No free preset available"
+ exit
+ fi
+ ipc_cmd -P $NAME
+elif [ $ACTION == "del_preset" ]; then
+ # del preset
+ add_del_preset del $NUM
+ ipc_cmd -R $NUM
+elif [ $ACTION == "set_home_position" ]; then
+ # set home position
+ add_del_preset del 0
+ add_del_preset add "Home"
+ ipc_cmd -H
+else
+ echo "Invalid action received"
+ exit
+fi
diff --git a/src/static/static/home/yi-hack-v5/script/system.sh b/src/static/static/home/yi-hack-v5/script/system.sh
index 84ad7ab..e85d28e 100755
--- a/src/static/static/home/yi-hack-v5/script/system.sh
+++ b/src/static/static/home/yi-hack-v5/script/system.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# 0.4.0c
+# 0.4.1g
CONF_FILE="etc/system.conf"
@@ -28,6 +28,25 @@ export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/home/base/tools:/home/yi-hack-v5/bin:
# ln -sf /dev/null /var/run/utmp
#fi
+# Upgrade wpa_supplicant modules - after 0.4.1 baseline
+if [ -f $YI_HACK_PREFIX/wpa/wpa_supplicant_upgrade ]; then
+ ifconfig wlan0 up
+ echo "---backing up wpa---"
+ cp /home/base/tools/wpa_supplicant $YI_HACK_PREFIX/wpa/wpa_supplicant_backup
+ cp /home/base/tools/wpa_cli $YI_HACK_PREFIX/wpa/wpa_cli_backup
+ cp /home/base/tools/wpa_passphrase $YI_HACK_PREFIX/wpa/wpa_passphrase_backup
+ killall watch_process
+ killall wpa*
+ mv /tmp/sd/yi-hack-v5/wpa/*.so* /home/lib/
+ mv /tmp/sd/yi-hack-v5/wpa/wpa_supplicant /home/base/tools/
+ mv /tmp/sd/yi-hack-v5/wpa/wpa_cli /home/base/tools/
+ mv /tmp/sd/yi-hack-v5/wpa/wpa_passphrase /home/base/tools/
+ reboot
+ echo "---wpa upgrade done---"
+else
+ echo "---no wpa upgrade---"
+fi
+
#reversing symlinks
if [ -L "/var/run/utmp" ]; then
rm /var/run/utmp
@@ -43,6 +62,7 @@ if [ ! -L "/home/yi-hack-v5/.ash_history" ]; then
fi
ulimit -s 1024
+mkdir /dev/shm
# Remove core files, if any
rm -f $YI_HACK_PREFIX/bin/core
@@ -72,6 +92,11 @@ if [[ "$(grep -m 3 -n '' /home/app/cloudAPI_fake | tail -n 1 | cut -d ':' -f 2 |
cp -f $YI_HACK_PREFIX/script/cloudAPI_fake /home/app/
fi
+# Update cloudAPI if necessary
+if [[ "$(grep -m 3 -n '' /home/app/cloudAPI | tail -n 1 | cut -d ':' -f 2 | cut -c 3-)" != "$(grep -m 3 -n '' $YI_HACK_PREFIX/script/cloudAPI | tail -n 1 | cut -d ':' -f 2 | cut -c 3-)" ]]; then
+ cp -f $YI_HACK_PREFIX/script/cloudAPI /home/app/
+fi
+
# Manual Wi-Fi config
if [ -f /tmp/sd/recover/configure_wifi.cfg ]; then
mv /tmp/sd/recover/configure_wifi.cfg /tmp/configure_wifi.cfg
@@ -79,6 +104,10 @@ if [ -f /tmp/sd/recover/configure_wifi.cfg ]; then
sh $YI_HACK_PREFIX/script/configure_wifi.sh
fi
+if [ -f "/tmp/sd/recover/mtdblock2_recover.bin" ]; then
+ sync
+ sh $YI_HACK_PREFIX/script/configure_wifi.sh
+fi
$YI_HACK_PREFIX/script/check_conf.sh
hostname -F $YI_HACK_PREFIX/etc/hostname
@@ -109,8 +138,11 @@ fi
if [[ x$(get_config USERNAME) != "x" ]] ; then
USERNAME=$(get_config USERNAME)
PASSWORD=$(get_config PASSWORD)
- ONVIF_USERPWD="--user $USERNAME --password $PASSWORD"
- echo "/:$USERNAME:$PASSWORD" > /tmp/httpd.conf
+ RTSP_USERPWD=$USERNAME:$PASSWORD@
+ ONVIF_USERPWD="user=$USERNAME\npassword=$PASSWORD"
+ echo "/onvif::" > /tmp/httpd.conf
+ echo "/:$USERNAME:$PASSWORD" >> /tmp/httpd.conf
+ chmod 0600 /tmp/httpd.conf
fi
if [[ x$(get_config SSH_PASSWORD) != "x" ]] ; then
@@ -130,12 +162,8 @@ case $(get_config RTSP_PORT) in
''|*[!0-9]*) RTSP_PORT=554 ;;
*) RTSP_PORT=$(get_config RTSP_PORT) ;;
esac
-case $(get_config ONVIF_PORT) in
- ''|*[!0-9]*) ONVIF_PORT=80 ;;
- *) ONVIF_PORT=$(get_config ONVIF_PORT) ;;
-esac
case $(get_config HTTPD_PORT) in
- ''|*[!0-9]*) HTTPD_PORT=8080 ;;
+ ''|*[!0-9]*) HTTPD_PORT=80 ;;
*) HTTPD_PORT=$(get_config HTTPD_PORT) ;;
esac
@@ -148,7 +176,7 @@ fi
# Version Firmware Check
if [ -f "/home/yi-hack-v5/version" ]; then
version=$(cat /home/yi-hack-v5/version)
- if [[ "$version" != "0.3.8" ]]; then
+ if [[ "$version" != "0.4.1" ]]; then
echo "Your baseline $version (rootfs and home partitions) is incorrect. Ignore if you are using a pre-release version. Please refer to https://github.com/alienatedsec/yi-hack-v5/discussions/267"
echo "Your baseline $version (rootfs and home partitions) is incorrect, Ignore if you are using a pre-release version. Please refer to https://github.com/alienatedsec/yi-hack-v5/discussions/267" > "/tmp/sd/hackerror.txt"
fi
@@ -167,7 +195,10 @@ if [[ $(get_config DISABLE_CLOUD) == "no" ]] ; then
cd /home/app
killall dispatch
LD_PRELOAD=/home/yi-hack-v5/lib/ipc_multiplex.so ./dispatch &
- sleep 2
+ sleep 3
+ if [[ $(get_config TIME_OSD) == "yes" ]] ; then
+ echo -ne '\x01\x00\x00\x00' | dd of=/tmp/mmap.info bs=1 seek=0 count=4 conv=notrunc
+ fi
LD_LIBRARY_PATH="/home/yi-hack-v5/lib:/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib" ./rmm &
sleep 8
./mp4record &
@@ -184,7 +215,10 @@ if [[ $(get_config DISABLE_CLOUD) == "yes" ]] ; then
cd /home/app
killall dispatch
LD_PRELOAD=/home/yi-hack-v5/lib/ipc_multiplex.so ./dispatch &
- sleep 2
+ sleep 3
+ if [[ $(get_config TIME_OSD) == "yes" ]] ; then
+ echo -ne '\x01\x00\x00\x00' | dd of=/tmp/mmap.info bs=1 seek=0 count=4 conv=notrunc
+ fi
LD_LIBRARY_PATH="/home/yi-hack-v5/lib:/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib" ./rmm &
sleep 8
if [[ $(get_config REC_WITHOUT_CLOUD) == "yes" ]] ; then
@@ -225,9 +259,8 @@ mkdir -p $YI_HACK_PREFIX/etc/dropbear
dropbear -R -B
fi
-ipc_multiplexer &
+sleep 30 && mqttv4 &
-mqttv4 &
if [[ $(get_config MQTT) == "yes" ]] ; then
mqtt-config &
$YI_HACK_PREFIX/script/conf2mqtt.sh &
@@ -241,12 +274,12 @@ if [[ $HTTPD_PORT != "80" ]] ; then
D_HTTPD_PORT=:$HTTPD_PORT
fi
-if [[ $ONVIF_PORT != "80" ]] ; then
- D_ONVIF_PORT=:$ONVIF_PORT
+if [[ $(get_config SNAPSHOT) == "no" ]] ; then
+ touch /tmp/snapshot.disabled
fi
-if [[ $(get_config ONVIF_WM_SNAPSHOT) == "yes" ]] ; then
- WATERMARK="&watermark=yes"
+if [[ $(get_config SNAPSHOT_LOW) == "yes" ]] ; then
+ touch /tmp/snapshot.low
fi
RRTSP_MODEL=$MODEL_SUFFIX
@@ -273,20 +306,20 @@ if [[ $(get_config RTSP) == "yes" ]] ; then
fi
if [[ $(get_config RTSP_STREAM) == "low" ]]; then
h264grabber -r low -m $MODEL_SUFFIX -f &
- ONVIF_PROFILE_1="--name Profile_1 --width 640 --height 360 --url rtsp://%s$D_RTSP_PORT/ch0_1.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK --type H264"
+ ONVIF_PROFILE_1="name=Profile_1\nwidth=640\nheight=360\nurl=rtsp://$RTSP_USERPWD%s$D_RTSP_PORT/ch0_1.h264\nsnapurl=http://$RTSP_USERPWD%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK\ntype=H264"
fi
if [[ $(get_config RTSP_STREAM) == "high" ]]; then
h264grabber -r high -m $MODEL_SUFFIX -f &
- ONVIF_PROFILE_0="--name Profile_0 --width $HIGHWIDTH --height $HIGHHEIGHT --url rtsp://%s$D_RTSP_PORT/ch0_0.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=high$WATERMARK --type H264"
+ ONVIF_PROFILE_0="name=Profile_0\nwidth=$HIGHWIDTH\nheight=$HIGHHEIGHT\nurl=rtsp://$RTSP_USERPWD%s$D_RTSP_PORT/ch0_0.h264\nsnapurl=http://$RTSP_USERPWD%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=high$WATERMARK\ntype=H264"
fi
if [[ $(get_config RTSP_STREAM) == "both" ]]; then
h264grabber -r low -m $MODEL_SUFFIX -f &
h264grabber -r high -m $MODEL_SUFFIX -f &
if [[ $(get_config ONVIF_PROFILE) == "low" ]] || [[ $(get_config ONVIF_PROFILE) == "both" ]] ; then
- ONVIF_PROFILE_1="--name Profile_1 --width 640 --height 360 --url rtsp://%s$D_RTSP_PORT/ch0_1.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK --type H264"
+ ONVIF_PROFILE_1="name=Profile_1\nwidth=640\nheight=360\nurl=rtsp://$RTSP_USERPWD%s$D_RTSP_PORT/ch0_1.h264\nsnapurl=http://$RTSP_USERPWD%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK\ntype=H264"
fi
if [[ $(get_config ONVIF_PROFILE) == "high" ]] || [[ $(get_config ONVIF_PROFILE) == "both" ]] ; then
- ONVIF_PROFILE_0="--name Profile_0 --width $HIGHWIDTH --height $HIGHHEIGHT --url rtsp://%s$D_RTSP_PORT/ch0_0.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=high$WATERMARK --type H264"
+ ONVIF_PROFILE_0="name=Profile_0\nwidth=$HIGHWIDTH\nheight=$HIGHHEIGHT\nurl=rtsp://$RTSP_USERPWD%s$D_RTSP_PORT/ch0_0.h264\nsnapurl=http://$RTSP_USERPWD%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=high$WATERMARK\ntype=H264"
fi
rRTSPServer -r $RRTSP_RES -a $RRTSP_AUDIO -p $RRTSP_PORT -u $RRTSP_USER -w $RRTSP_PWD &
fi
@@ -310,13 +343,92 @@ if [[ $(get_config ONVIF) == "yes" ]] ; then
ONVIF_NETIF="eth0"
fi
+ ONVIF_SRVD_CONF="/tmp/onvif_simple_server.conf"
+
+ echo "model=Yi Hack" > $ONVIF_SRVD_CONF
+ echo "manufacturer=Yi" >> $ONVIF_SRVD_CONF
+ echo "firmware_ver=$YI_HACK_VER" >> $ONVIF_SRVD_CONF
+ echo "hardware_id=$HW_ID" >> $ONVIF_SRVD_CONF
+ echo "serial_num=$SERIAL_NUMBER" >> $ONVIF_SRVD_CONF
+ echo "ifs=$ONVIF_NETIF" >> $ONVIF_SRVD_CONF
+ echo "port=$HTTPD_PORT" >> $ONVIF_SRVD_CONF
+ echo "scope=onvif://www.onvif.org/Profile/Streaming" >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
+ if [ ! -z $ONVIF_USERPWD ]; then
+ echo -e $ONVIF_USERPWD >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
+ fi
+ if [ ! -z $ONVIF_PROFILE_0 ]; then
+ echo "#Profile 0" >> $ONVIF_SRVD_CONF
+ echo -e $ONVIF_PROFILE_0 >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
+ fi
+ if [ ! -z $ONVIF_PROFILE_1 ]; then
+ echo "#Profile 1" >> $ONVIF_SRVD_CONF
+ echo -e $ONVIF_PROFILE_1 >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
+ fi
+
if [[ $MODEL_SUFFIX == "yi_dome" ]] || [[ $MODEL_SUFFIX == "yi_dome_1080p" ]] || [[ $MODEL_SUFFIX == "yi_cloud_dome_1080p" ]] ; then
- onvif_srvd --pid_file /var/run/onvif_srvd.pid --model "$MODEL_SUFFIX" --manufacturer "Yi" --firmware_ver "$YI_HACK_VER" --hardware_id $HW_ID --serial_num $SERIAL_NUMBER --ifs $ONVIF_NETIF --port $ONVIF_PORT --scope onvif://www.onvif.org/Profile/S $ONVIF_PROFILE_0 $ONVIF_PROFILE_1 $ONVIF_USERPWD --ptz --move_left "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m left" --move_right "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m right" --move_up "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m up" --move_down "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m down" --move_stop "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m stop" --move_preset "/tmp/sd/yi-hack-v5/bin/ipc_cmd -p %t"
- else
- onvif_srvd --pid_file /var/run/onvif_srvd.pid --model "$MODEL_SUFFIX" --manufacturer "Yi" --firmware_ver "$YI_HACK_VER" --hardware_id $HW_ID --serial_num $SERIAL_NUMBER --ifs $ONVIF_NETIF --port $ONVIF_PORT --scope onvif://www.onvif.org/Profile/S $ONVIF_PROFILE_0 $ONVIF_PROFILE_1 $ONVIF_USERPWD
+ echo "#PTZ" >> $ONVIF_SRVD_CONF
+ echo "ptz=1" >> $ONVIF_SRVD_CONF
+ echo "get_position=/tmp/sd/yi-hack-v5/bin/ipc_cmd -g" >> $ONVIF_SRVD_CONF
+ echo "is_running=/tmp/sd/yi-hack-v5/bin/ipc_cmd -u" >> $ONVIF_SRVD_CONF
+ echo "move_left=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m left" >> $ONVIF_SRVD_CONF
+ echo "move_right=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m right" >> $ONVIF_SRVD_CONF
+ echo "move_up=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m up" >> $ONVIF_SRVD_CONF
+ echo "move_down=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m down" >> $ONVIF_SRVD_CONF
+ echo "move_stop=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m stop" >> $ONVIF_SRVD_CONF
+ echo "move_preset=/tmp/sd/yi-hack-v5/bin/ipc_cmd -p %d" >> $ONVIF_SRVD_CONF
+ echo "set_preset=/tmp/sd/yi-hack-v5/script/ptz_presets.sh -a add_preset -m %s" >> $ONVIF_SRVD_CONF
+ echo "set_home_position=/tmp/sd/yi-hack-v5/script/ptz_presets.sh -a set_home_position" >> $ONVIF_SRVD_CONF
+ echo "remove_preset=/tmp/sd/yi-hack-v5/script/ptz_presets.sh -a del_preset -n %d" >> $ONVIF_SRVD_CONF
+ echo "jump_to_abs=/tmp/sd/yi-hack-v5/bin/ipc_cmd -j %f,%f" >> $ONVIF_SRVD_CONF
+ echo "jump_to_rel=/tmp/sd/yi-hack-v5/bin/ipc_cmd -J %f,%f" >> $ONVIF_SRVD_CONF
+ echo "get_presets=/tmp/sd/yi-hack-v5/script/ptz_presets.sh -a get_presets" >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
fi
+
+ echo "#EVENT" >> $ONVIF_SRVD_CONF
+ echo "events=3" >> $ONVIF_SRVD_CONF
+ echo "#Event 0" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:VideoSource/MotionAlarm" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/motion_alarm" >> $ONVIF_SRVD_CONF
+ echo "#Event 1" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:RuleEngine/MyRuleDetector/PeopleDetect" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/human_detection" >> $ONVIF_SRVD_CONF
+ echo "#Event 2" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:RuleEngine/MyRuleDetector/VehicleDetect" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/vehicle_detection" >> $ONVIF_SRVD_CONF
+ echo "#Event 3" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:RuleEngine/MyRuleDetector/DogCatDetect" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/animal_detection" >> $ONVIF_SRVD_CONF
+ echo "#Event 4" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:RuleEngine/MyRuleDetector/BabyCryingDetect" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/baby_crying" >> $ONVIF_SRVD_CONF
+ echo "#Event 5" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:AudioAnalytics/Audio/DetectedSound" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/sound_detection" >> $ONVIF_SRVD_CONF
+
+ chmod 0600 $ONVIF_SRVD_CONF
+ onvif_simple_server --conf_file $ONVIF_SRVD_CONF
+ ipc2file
+ onvif_notify_server --conf_file $ONVIF_SRVD_CONF
+
if [[ $(get_config ONVIF_WSDD) == "yes" ]] ; then
- wsdd --pid_file /var/run/wsdd.pid --if_name $ONVIF_NETIF --type tdn:NetworkVideoTransmitter --xaddr http://%s$D_ONVIF_PORT --scope "onvif://www.onvif.org/name/Unknown onvif://www.onvif.org/Profile/Streaming"
+ wsd_simple_server --pid_file /var/run/wsd_simple_server.pid --if_name $ONVIF_NETIF --xaddr "http://%s$D_HTTPD_PORT/onvif/device_service" -m yi_hack -n Yi
fi
fi
@@ -358,4 +470,3 @@ fi
$YI_HACK_PREFIX/script/check_update.sh
crond -c $YI_HACK_PREFIX/etc/crontabs
-
diff --git a/src/static/static/home/yi-hack-v5/script/system_init.sh b/src/static/static/home/yi-hack-v5/script/system_init.sh
index d381886..66a0b36 100755
--- a/src/static/static/home/yi-hack-v5/script/system_init.sh
+++ b/src/static/static/home/yi-hack-v5/script/system_init.sh
@@ -7,6 +7,8 @@ if [ -d "/usr/yi-hack-v5" ]; then
elif [ -d "/home/yi-hack-v5" ]; then
YI_HACK_V5_PREFIX="/home"
YI_PREFIX="/home/app"
+ YI_BASE="/home/base/tools"
+ YI_LIB="/home/lib"
UDHCPC_SCRIPT_DEST="/home/app/script/default.script"
fi
@@ -17,12 +19,24 @@ DHCP_SCRIPT_DEST="/home/app/script/wifidhcp.sh"
UDHCP_SCRIPT="$YI_HACK_V5_PREFIX/yi-hack-v5/script/default.script"
DHCP_SCRIPT="$YI_HACK_V5_PREFIX/yi-hack-v5/script/wifidhcp.sh"
-files=`find $YI_PREFIX -maxdepth 1 -name "*.7z"`
-if [ ${#files[@]} -gt 0 ]; then
+files=`find $YI_PREFIX -maxdepth 1 -name "*.7z" | awk 'END { print NR }'`
+if [ $files -gt 0 ]; then
/home/base/tools/7za x "$YI_PREFIX/*.7z" -y -o$YI_PREFIX
rm $YI_PREFIX/*.7z
fi
+files=`find $YI_BASE -maxdepth 1 -name "*.7z" | awk 'END { print NR }'`
+if [ $files -gt 0 ]; then
+ /home/base/tools/7za x "$YI_BASE/*.7z" -y -o$YI_BASE
+ rm $YI_BASE/*.7z
+fi
+
+files=`find $YI_LIB -maxdepth 1 -name "*.7z" | awk 'END { print NR }'`
+if [ $files -gt 0 ]; then
+ /home/base/tools/7za x "$YI_LIB/*.7z" -y -o$YI_LIB
+ rm $YI_LIB/*.7z
+fi
+
if [ -f $ARCHIVE_FILE ]; then
/home/base/tools/7za x $ARCHIVE_FILE -y -o$DESTDIR
rm $ARCHIVE_FILE
diff --git a/src/static/static/home/yi-hack-v5/script/wd_rtsp.sh b/src/static/static/home/yi-hack-v5/script/wd_rtsp.sh
index 838cf5b..df33a4e 100755
--- a/src/static/static/home/yi-hack-v5/script/wd_rtsp.sh
+++ b/src/static/static/home/yi-hack-v5/script/wd_rtsp.sh
@@ -27,17 +27,26 @@ COUNTER=0
COUNTER_LIMIT=10
INTERVAL=10
+if [[ "$(get_config USERNAME)" != "" ]] ; then
+ USERNAME=$(get_config USERNAME)
+ PASSWORD=$(get_config PASSWORD)
+fi
+
RRTSP_RES=$(get_config RTSP_STREAM)
RRTSP_AUDIO=$(get_config RTSP_AUDIO)
RRTSP_MODEL=$MODEL_SUFFIX
RRTSP_PORT=$(get_config RTSP_PORT)
-RRTSP_USER=$(get_config USERNAME)
-RRTSP_PWD=$(get_config PASSWORD)
+if [ ! -z $USERNAME ]; then
+ RRTSP_USER="-u $USERNAME"
+fi
+if [ ! -z $PASSWORD ]; then
+ RRTSP_PWD="-w $PASSWORD"
+fi
restart_rtsp()
{
killall -q rRTSPServer
- rRTSPServer -r $RRTSP_RES -a $RRTSP_AUDIO -p $RRTSP_PORT -u $RRTSP_USER -w $RRTSP_PWD &
+ rRTSPServer -r $RRTSP_RES -a $RRTSP_AUDIO -p $RRTSP_PORT $RRTSP_USER $RRTSP_PWD &
}
restart_grabber()
@@ -57,7 +66,7 @@ restart_grabber()
if [[ $(get_config RTSP_AUDIO) == "yes" ]]; then
h264grabber -r AUDIO -m $MODEL_SUFFIX -f &
fi
- rRTSPServer -r $RRTSP_RES -a $RRTSP_AUDIO -p $RRTSP_PORT -u $RRTSP_USER -w $RRTSP_PWD &
+ rRTSPServer -r $RRTSP_RES -a $RRTSP_AUDIO -p $RRTSP_PORT $RRTSP_USER $RRTSP_PWD &
}
restart_cloud()
@@ -70,6 +79,11 @@ restart_cloud()
fi
}
+restart_mqttv4()
+{
+ mqttv4 &
+}
+
check_rtsp()
{
SOCKET=`/bin/netstat -an 2>&1 | grep ":$RTSP_PORT " | grep LISTEN | grep -c ^`
@@ -135,15 +149,22 @@ check_grabber()
fi
}
+check_mqttv4()
+{
+ PS=`ps | grep mqttv4 | grep -v grep | grep -c ^`
+
+ if [ $PS -eq 0 ]; then
+ echo "$(date +'%Y-%m-%d %H:%M:%S') - No running processes, restarting mqttv4 ..." >> $LOG_FILE
+ killall -q mqttv4
+ sleep 1
+ restart_mqttv4
+ fi
+}
+
if [[ $(get_config RTSP) == "no" ]] ; then
exit
fi
-if [[ "$(get_config USERNAME)" != "" ]] ; then
- USERNAME=$(get_config USERNAME)
- PASSWORD=$(get_config PASSWORD)
-fi
-
# Re-enabled when its starting
echo "$(date +'%Y-%m-%d %H:%M:%S') - Starting RTSP watchdog..." >> $LOG_FILE
@@ -153,6 +174,7 @@ do
check_rtsp
check_rmm
check_cloud
+ check_mqttv4
if [ $COUNTER -eq 0 ]; then
sleep $INTERVAL
fi
diff --git a/src/wpa/.config b/src/wpa/.config
new file mode 100644
index 0000000..3be9eb0
--- /dev/null
+++ b/src/wpa/.config
@@ -0,0 +1,636 @@
+# Example wpa_supplicant build time configuration
+#
+# This file lists the configuration options that are used when building the
+# wpa_supplicant binary. All lines starting with # are ignored. Configuration
+# option lines must be commented out complete, if they are not to be included,
+# i.e., just setting VARIABLE=n is not disabling that variable.
+#
+# This file is included in Makefile, so variables like CFLAGS and LIBS can also
+# be modified from here. In most cases, these lines should use += in order not
+# to override previous values of the variables.
+
+
+# Uncomment following two lines and fix the paths if you have installed OpenSSL
+# or GnuTLS in non-default location
+CFLAGS += -I/home/dev/333hack/src/wpa/sysroot/include/openssl
+LIBS += -L/home/dev/333hack/src/wpa/sysroot/lib
+#LDFLAGS += -static
+
+# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
+# the kerberos files are not in the default include path. Following line can be
+# used to fix build issues on such systems (krb5.h not found).
+#CFLAGS += -I/usr/include/kerberos
+
+# Driver interface for generic Linux wireless extensions
+# Note: WEXT is deprecated in the current Linux kernel version and no new
+# functionality is added to it. nl80211-based interface is the new
+# replacement for WEXT and its use allows wpa_supplicant to properly control
+# the driver to improve existing functionality like roaming and to support new
+# functionality.
+CONFIG_DRIVER_WEXT=y
+
+# Driver interface for Linux drivers using the nl80211 kernel interface
+#CONFIG_DRIVER_NL80211=y
+
+# QCA vendor extensions to nl80211
+#CONFIG_DRIVER_NL80211_QCA=y
+
+# driver_nl80211.c requires libnl. If you are compiling it yourself
+# you may need to point hostapd to your version of libnl.
+#
+#CFLAGS += -I$
+#LIBS += -L$
+
+# Use libnl v2.0 (or 3.0) libraries.
+#CONFIG_LIBNL20=y
+
+# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
+CONFIG_LIBNL32=y
+
+
+# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
+#CONFIG_DRIVER_BSD=y
+#CFLAGS += -I/usr/local/include
+#LIBS += -L/usr/local/lib
+LIBS_p += -L/home/dev/333hack/src/wpa/sysroot/lib
+LIBS_c += -L/home/dev/333hack/src/wpa/sysroot/lib
+
+# Driver interface for Windows NDIS
+#CONFIG_DRIVER_NDIS=y
+#CFLAGS += -I/usr/include/w32api/ddk
+#LIBS += -L/usr/local/lib
+# For native build using mingw
+#CONFIG_NATIVE_WINDOWS=y
+# Additional directories for cross-compilation on Linux host for mingw target
+#CFLAGS += -I/opt/mingw/mingw32/include/ddk
+#LIBS += -L/opt/mingw/mingw32/lib
+CC=arm-hisiv300-linux-gcc
+# By default, driver_ndis uses WinPcap for low-level operations. This can be
+# replaced with the following option which replaces WinPcap calls with NDISUIO.
+# However, this requires that WZC is disabled (net stop wzcsvc) before starting
+# wpa_supplicant.
+# CONFIG_USE_NDISUIO=y
+
+# Driver interface for wired Ethernet drivers
+#CONFIG_DRIVER_WIRED=y
+
+# Driver interface for MACsec capable Qualcomm Atheros drivers
+#CONFIG_DRIVER_MACSEC_QCA=y
+
+# Driver interface for Linux MACsec drivers
+#CONFIG_DRIVER_MACSEC_LINUX=y
+
+# Driver interface for the Broadcom RoboSwitch family
+#CONFIG_DRIVER_ROBOSWITCH=y
+
+# Driver interface for no driver (e.g., WPS ER only)
+#CONFIG_DRIVER_NONE=y
+
+# Solaris libraries
+#LIBS += -lsocket -ldlpi -lnsl
+#LIBS_c += -lsocket
+
+# Enable IEEE 802.1X Supplicant (automatically included if any EAP method or
+# MACsec is included)
+#CONFIG_IEEE8021X_EAPOL=y
+
+# EAP-MD5
+#CONFIG_EAP_MD5=y
+
+# EAP-MSCHAPv2
+#CONFIG_EAP_MSCHAPV2=y
+
+# EAP-TLS
+#CONFIG_EAP_TLS=y
+
+# EAL-PEAP
+#CONFIG_EAP_PEAP=y
+
+# EAP-TTLS
+#CONFIG_EAP_TTLS=y
+
+# EAP-FAST
+#CONFIG_EAP_FAST=y
+
+# EAP-TEAP
+# Note: The current EAP-TEAP implementation is experimental and should not be
+# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
+# of conflicting statements and missing details and the implementation has
+# vendor specific workarounds for those and as such, may not interoperate with
+# any other implementation. This should not be used for anything else than
+# experimentation and interoperability testing until those issues has been
+# resolved.
+#CONFIG_EAP_TEAP=y
+
+# EAP-GTC
+#CONFIG_EAP_GTC=y
+
+# EAP-OTP
+#CONFIG_EAP_OTP=y
+
+# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
+#CONFIG_EAP_SIM=y
+
+# Enable SIM simulator (Milenage) for EAP-SIM
+#CONFIG_SIM_SIMULATOR=y
+
+# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
+#CONFIG_EAP_PSK=y
+
+# EAP-pwd (secure authentication using only a password)
+#CONFIG_EAP_PWD=y
+
+# EAP-PAX
+#CONFIG_EAP_PAX=y
+
+# LEAP
+#CONFIG_EAP_LEAP=y
+
+# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
+#CONFIG_EAP_AKA=y
+
+# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
+# This requires CONFIG_EAP_AKA to be enabled, too.
+#CONFIG_EAP_AKA_PRIME=y
+
+# Enable USIM simulator (Milenage) for EAP-AKA
+#CONFIG_USIM_SIMULATOR=y
+
+# EAP-SAKE
+#CONFIG_EAP_SAKE=y
+
+# EAP-GPSK
+CONFIG_EAP_GPSK=y
+# Include support for optional SHA256 cipher suite in EAP-GPSK
+#CONFIG_EAP_GPSK_SHA256=y
+
+# EAP-TNC and related Trusted Network Connect support (experimental)
+#CONFIG_EAP_TNC=y
+
+# Wi-Fi Protected Setup (WPS)
+CONFIG_WPS=y
+# Enable WPS external registrar functionality
+#CONFIG_WPS_ER=y
+# Disable credentials for an open network by default when acting as a WPS
+# registrar.
+#CONFIG_WPS_REG_DISABLE_OPEN=y
+# Enable WPS support with NFC config method
+#CONFIG_WPS_NFC=y
+
+# EAP-IKEv2
+#CONFIG_EAP_IKEV2=y
+
+# EAP-EKE
+#CONFIG_EAP_EKE=y
+
+# MACsec
+#CONFIG_MACSEC=y
+
+# PKCS#12 (PFX) support (used to read private key and certificate file from
+# a file that usually has extension .p12 or .pfx)
+#CONFIG_PKCS12=y
+
+# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
+# engine.
+#CONFIG_SMARTCARD=y
+
+# PC/SC interface for smartcards (USIM, GSM SIM)
+# Enable this if EAP-SIM or EAP-AKA is included
+#CONFIG_PCSC=y
+
+# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
+#CONFIG_HT_OVERRIDES=y
+
+# Support VHT overrides (disable VHT, mask MCS rates, etc.)
+#CONFIG_VHT_OVERRIDES=y
+
+# Development testing
+#CONFIG_EAPOL_TEST=y
+
+# Select control interface backend for external programs, e.g, wpa_cli:
+# unix = UNIX domain sockets (default for Linux/BSD)
+# udp = UDP sockets using localhost (127.0.0.1)
+# udp6 = UDP IPv6 sockets using localhost (::1)
+# named_pipe = Windows Named Pipe (default for Windows)
+# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
+# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose)
+# y = use default (backwards compatibility)
+# If this option is commented out, control interface is not included in the
+# build.
+CONFIG_CTRL_IFACE=y
+
+# Include support for GNU Readline and History Libraries in wpa_cli.
+# When building a wpa_cli binary for distribution, please note that these
+# libraries are licensed under GPL and as such, BSD license may not apply for
+# the resulting binary.
+#CONFIG_READLINE=y
+
+# Include internal line edit mode in wpa_cli. This can be used as a replacement
+# for GNU Readline to provide limited command line editing and history support.
+#CONFIG_WPA_CLI_EDIT=y
+
+# Remove debugging code that is printing out debug message to stdout.
+# This can be used to reduce the size of the wpa_supplicant considerably
+# if debugging code is not needed. The size reduction can be around 35%
+# (e.g., 90 kB).
+#CONFIG_NO_STDOUT_DEBUG=y
+
+# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
+# 35-50 kB in code size.
+#CONFIG_NO_WPA=y
+
+# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
+# This option can be used to reduce code size by removing support for
+# converting ASCII passphrases into PSK. If this functionality is removed, the
+# PSK can only be configured as the 64-octet hexstring (e.g., from
+# wpa_passphrase). This saves about 0.5 kB in code size.
+#CONFIG_NO_WPA_PASSPHRASE=y
+
+# Simultaneous Authentication of Equals (SAE), WPA3-Personal
+CONFIG_SAE=y
+
+# Disable scan result processing (ap_scan=1) to save code size by about 1 kB.
+# This can be used if ap_scan=1 mode is never enabled.
+#CONFIG_NO_SCAN_PROCESSING=y
+
+# Select configuration backend:
+# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
+# path is given on command line, not here; this option is just used to
+# select the backend that allows configuration files to be used)
+# winreg = Windows registry (see win_example.reg for an example)
+CONFIG_BACKEND=file
+
+# Remove configuration write functionality (i.e., to allow the configuration
+# file to be updated based on runtime configuration changes). The runtime
+# configuration can still be changed, the changes are just not going to be
+# persistent over restarts. This option can be used to reduce code size by
+# about 3.5 kB.
+#CONFIG_NO_CONFIG_WRITE=y
+
+# Remove support for configuration blobs to reduce code size by about 1.5 kB.
+#CONFIG_NO_CONFIG_BLOBS=y
+
+# Select program entry point implementation:
+# main = UNIX/POSIX like main() function (default)
+# main_winsvc = Windows service (read parameters from registry)
+# main_none = Very basic example (development use only)
+#CONFIG_MAIN=main
+
+# Select wrapper for operating system and C library specific functions
+# unix = UNIX/POSIX like systems (default)
+# win32 = Windows systems
+# none = Empty template
+#CONFIG_OS=unix
+
+# Select event loop implementation
+# eloop = select() loop (default)
+# eloop_win = Windows events and WaitForMultipleObject() loop
+#CONFIG_ELOOP=eloop
+
+# Should we use poll instead of select? Select is used by default.
+#CONFIG_ELOOP_POLL=y
+
+# Should we use epoll instead of select? Select is used by default.
+#CONFIG_ELOOP_EPOLL=y
+
+# Should we use kqueue instead of select? Select is used by default.
+#CONFIG_ELOOP_KQUEUE=y
+
+# Select layer 2 packet implementation
+# linux = Linux packet socket (default)
+# pcap = libpcap/libdnet/WinPcap
+# freebsd = FreeBSD libpcap
+# winpcap = WinPcap with receive thread
+# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
+# none = Empty template
+CONFIG_L2_PACKET=linux
+
+# Disable Linux packet socket workaround applicable for station interface
+# in a bridge for EAPOL frames. This should be uncommented only if the kernel
+# is known to not have the regression issue in packet socket behavior with
+# bridge interfaces (commit 'bridge: respect RFC2863 operational state')
+#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y
+
+# Support Operating Channel Validation
+#CONFIG_OCV=y
+
+# Select TLS implementation
+# openssl = OpenSSL (default)
+# gnutls = GnuTLS
+# internal = Internal TLSv1 implementation (experimental)
+# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
+# none = Empty template
+#CONFIG_TLS=none
+
+# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
+# can be enabled to get a stronger construction of messages when block ciphers
+# are used. It should be noted that some existing TLS v1.0 -based
+# implementation may not be compatible with TLS v1.1 message (ClientHello is
+# sent prior to negotiating which version will be used)
+#CONFIG_TLSV11=y
+
+# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
+# can be enabled to enable use of stronger crypto algorithms. It should be
+# noted that some existing TLS v1.0 -based implementation may not be compatible
+# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
+# will be used)
+#CONFIG_TLSV12=y
+
+# Select which ciphers to use by default with OpenSSL if the user does not
+# specify them.
+#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
+
+# If CONFIG_TLS=internal is used, additional library and include paths are
+# needed for LibTomMath. Alternatively, an integrated, minimal version of
+# LibTomMath can be used. See beginning of libtommath.c for details on benefits
+# and drawbacks of this option.
+#CONFIG_INTERNAL_LIBTOMMATH=y
+#ifndef CONFIG_INTERNAL_LIBTOMMATH
+#LTM_PATH=/usr/src/libtommath-0.39
+#CFLAGS += -I$(LTM_PATH)
+#LIBS += -L$(LTM_PATH)
+#LIBS_p += -L$(LTM_PATH)
+#endif
+# At the cost of about 4 kB of additional binary size, the internal LibTomMath
+# can be configured to include faster routines for exptmod, sqr, and div to
+# speed up DH and RSA calculation considerably
+#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
+
+# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
+# This is only for Windows builds and requires WMI-related header files and
+# WbemUuid.Lib from Platform SDK even when building with MinGW.
+#CONFIG_NDIS_EVENTS_INTEGRATED=y
+#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
+
+# Add support for new DBus control interface
+# (fi.w1.wpa_supplicant1)
+#CONFIG_CTRL_IFACE_DBUS_NEW=y
+
+# Add introspection support for new DBus control interface
+#CONFIG_CTRL_IFACE_DBUS_INTRO=y
+
+# Add support for loading EAP methods dynamically as shared libraries.
+# When this option is enabled, each EAP method can be either included
+# statically (CONFIG_EAP_=y) or dynamically (CONFIG_EAP_=dyn).
+# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
+# be loaded in the beginning of the wpa_supplicant configuration file
+# (see load_dynamic_eap parameter in the example file) before being used in
+# the network blocks.
+#
+# Note that some shared parts of EAP methods are included in the main program
+# and in order to be able to use dynamic EAP methods using these parts, the
+# main program must have been build with the EAP method enabled (=y or =dyn).
+# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
+# unless at least one of them was included in the main build to force inclusion
+# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
+# in the main build to be able to load these methods dynamically.
+#
+# Please also note that using dynamic libraries will increase the total binary
+# size. Thus, it may not be the best option for targets that have limited
+# amount of memory/flash.
+#CONFIG_DYNAMIC_EAP_METHODS=y
+
+# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode
+CONFIG_IEEE80211R=y
+
+# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
+CONFIG_DEBUG_FILE=y
+
+# Send debug messages to syslog instead of stdout
+CONFIG_DEBUG_SYSLOG=y
+# Set syslog facility for debug messages
+#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
+
+# Add support for sending all debug messages (regardless of debug verbosity)
+# to the Linux kernel tracing facility. This helps debug the entire stack by
+# making it easy to record everything happening from the driver up into the
+# same file, e.g., using trace-cmd.
+#CONFIG_DEBUG_LINUX_TRACING=y
+
+# Add support for writing debug log to Android logcat instead of standard
+# output
+#CONFIG_ANDROID_LOG=y
+
+# Enable privilege separation (see README 'Privilege separation' for details)
+#CONFIG_PRIVSEP=y
+
+# Enable mitigation against certain attacks against TKIP by delaying Michael
+# MIC error reports by a random amount of time between 0 and 60 seconds
+#CONFIG_DELAYED_MIC_ERROR_REPORT=y
+
+# Enable tracing code for developer debugging
+# This tracks use of memory allocations and other registrations and reports
+# incorrect use with a backtrace of call (or allocation) location.
+#CONFIG_WPA_TRACE=y
+# For BSD, uncomment these.
+#LIBS += -lexecinfo
+#LIBS_p += -lexecinfo
+#LIBS_c += -lexecinfo
+
+# Use libbfd to get more details for developer debugging
+# This enables use of libbfd to get more detailed symbols for the backtraces
+# generated by CONFIG_WPA_TRACE=y.
+#CONFIG_WPA_TRACE_BFD=y
+# For BSD, uncomment these.
+#LIBS += -lbfd -liberty -lz
+#LIBS_p += -lbfd -liberty -lz
+#LIBS_c += -lbfd -liberty -lz
+
+# wpa_supplicant depends on strong random number generation being available
+# from the operating system. os_get_random() function is used to fetch random
+# data when needed, e.g., for key generation. On Linux and BSD systems, this
+# works by reading /dev/urandom. It should be noted that the OS entropy pool
+# needs to be properly initialized before wpa_supplicant is started. This is
+# important especially on embedded devices that do not have a hardware random
+# number generator and may by default start up with minimal entropy available
+# for random number generation.
+#
+# As a safety net, wpa_supplicant is by default trying to internally collect
+# additional entropy for generating random data to mix in with the data fetched
+# from the OS. This by itself is not considered to be very strong, but it may
+# help in cases where the system pool is not initialized properly. However, it
+# is very strongly recommended that the system pool is initialized with enough
+# entropy either by using hardware assisted random number generator or by
+# storing state over device reboots.
+#
+# wpa_supplicant can be configured to maintain its own entropy store over
+# restarts to enhance random number generation. This is not perfect, but it is
+# much more secure than using the same sequence of random numbers after every
+# reboot. This can be enabled with -e command line option. The
+# specified file needs to be readable and writable by wpa_supplicant.
+#
+# If the os_get_random() is known to provide strong random data (e.g., on
+# Linux/BSD, the board in question is known to have reliable source of random
+# data from /dev/urandom), the internal wpa_supplicant random pool can be
+# disabled. This will save some in binary size and CPU use. However, this
+# should only be considered for builds that are known to be used on devices
+# that meet the requirements described above.
+#CONFIG_NO_RANDOM_POOL=y
+
+# Should we attempt to use the getrandom(2) call that provides more reliable
+# yet secure randomness source than /dev/random on Linux 3.17 and newer.
+# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
+#CONFIG_GETRANDOM=y
+
+# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
+#CONFIG_IEEE80211AC=y
+
+# Wireless Network Management (IEEE Std 802.11v-2011)
+# Note: This is experimental and not complete implementation.
+#CONFIG_WNM=y
+
+# Interworking (IEEE 802.11u)
+# This can be used to enable functionality to improve interworking with
+# external networks (GAS/ANQP to learn more about the networks and network
+# selection based on available credentials).
+CONFIG_INTERWORKING=y
+
+# Hotspot 2.0 <<< DONT TOUCH
+CONFIG_HS20=y
+
+# Enable interface matching in wpa_supplicant
+#CONFIG_MATCH_IFACE=y
+
+# Disable roaming in wpa_supplicant
+#CONFIG_NO_ROAMING=y
+
+# AP mode operations with wpa_supplicant
+# This can be used for controlling AP mode operations with wpa_supplicant. It
+# should be noted that this is mainly aimed at simple cases like
+# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
+# external RADIUS server can be supported with hostapd.
+#CONFIG_AP=y
+
+# P2P (Wi-Fi Direct)
+# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
+# more information on P2P operations.
+#CONFIG_P2P=y
+
+# Enable TDLS support
+#CONFIG_TDLS=y
+
+# Wi-Fi Display
+# This can be used to enable Wi-Fi Display extensions for P2P using an external
+# program to control the additional information exchanges in the messages.
+#CONFIG_WIFI_DISPLAY=y
+
+# Autoscan
+# This can be used to enable automatic scan support in wpa_supplicant.
+# See wpa_supplicant.conf for more information on autoscan usage.
+#
+# Enabling directly a module will enable autoscan support.
+# For exponential module:
+#CONFIG_AUTOSCAN_EXPONENTIAL=y
+# For periodic module:
+#CONFIG_AUTOSCAN_PERIODIC=y
+
+# Password (and passphrase, etc.) backend for external storage
+# These optional mechanisms can be used to add support for storing passwords
+# and other secrets in external (to wpa_supplicant) location. This allows, for
+# example, operating system specific key storage to be used
+#
+# External password backend for testing purposes (developer use)
+#CONFIG_EXT_PASSWORD_TEST=y
+# File-based backend to read passwords from an external file.
+#CONFIG_EXT_PASSWORD_FILE=y
+
+# Enable Fast Session Transfer (FST)
+#CONFIG_FST=y
+
+# Enable CLI commands for FST testing
+#CONFIG_FST_TEST=y
+
+# OS X builds. This is only for building eapol_test.
+#CONFIG_OSX=y
+
+# Automatic Channel Selection
+# This will allow wpa_supplicant to pick the channel automatically when channel
+# is set to "0".
+#
+# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative
+# to "channel=0". This would enable us to eventually add other ACS algorithms in
+# similar way.
+#
+# Automatic selection is currently only done through initialization, later on
+# we hope to do background checks to keep us moving to more ideal channels as
+# time goes by. ACS is currently only supported through the nl80211 driver and
+# your driver must have survey dump capability that is filled by the driver
+# during scanning.
+#
+# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with
+# a newly to create wpa_supplicant.conf variable acs_num_scans.
+#
+# Supported ACS drivers:
+# * ath9k
+# * ath5k
+# * ath10k
+#
+# For more details refer to:
+# http://wireless.kernel.org/en/users/Documentation/acs
+#CONFIG_ACS=y
+
+# Support Multi Band Operation
+#CONFIG_MBO=y
+
+# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
+#CONFIG_FILS=y
+# FILS shared key authentication with PFS
+#CONFIG_FILS_SK_PFS=y
+
+# Support RSN on IBSS networks
+# This is needed to be able to use mode=1 network profile with proto=RSN and
+# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None).
+CONFIG_IBSS_RSN=y
+
+# External PMKSA cache control
+# This can be used to enable control interface commands that allow the current
+# PMKSA cache entries to be fetched and new entries to be added.
+#CONFIG_PMKSA_CACHE_EXTERNAL=y
+
+# Mesh Networking (IEEE 802.11s)
+#CONFIG_MESH=y
+
+# Background scanning modules
+# These can be used to request wpa_supplicant to perform background scanning
+# operations for roaming within an ESS (same SSID). See the bgscan parameter in
+# the wpa_supplicant.conf file for more details.
+# Periodic background scans based on signal strength
+CONFIG_BGSCAN_SIMPLE=y
+# Learn channels used by the network and try to avoid bgscans on other
+# channels (experimental)
+#CONFIG_BGSCAN_LEARN=y
+
+# Opportunistic Wireless Encryption (OWE)
+# Experimental implementation of draft-harkins-owe-07.txt
+#CONFIG_OWE=y
+
+# Device Provisioning Protocol (DPP) (also known as Wi-Fi Easy Connect)
+CONFIG_DPP=y
+# DPP version 2 support
+CONFIG_DPP2=y
+# DPP version 3 support (experimental and still changing; do not enable for
+# production use)
+#CONFIG_DPP3=y
+
+# Wired equivalent privacy (WEP)
+# WEP is an obsolete cryptographic data confidentiality algorithm that is not
+# considered secure. It should not be used for anything anymore. The
+# functionality needed to use WEP is available in the current wpa_supplicant
+# release under this optional build parameter. This functionality is subject to
+# be completely removed in a future release.
+#CONFIG_WEP=y
+
+# Remove all TKIP functionality
+# TKIP is an old cryptographic data confidentiality algorithm that is not
+# considered secure. It should not be used anymore for anything else than a
+# backwards compatibility option as a group cipher when connecting to APs that
+# use WPA+WPA2 mixed mode. For now, the default wpa_supplicant build includes
+# support for this by default, but that functionality is subject to be removed
+# in the future.
+#CONFIG_NO_TKIP=y
+
+# Pre-Association Security Negotiation (PASN)
+# Experimental implementation based on IEEE P802.11z/D2.6 and the protocol
+# design is still subject to change. As such, this should not yet be enabled in
+# production use.
+#CONFIG_PASN=y
diff --git a/src/wpa/.gitignore b/src/wpa/.gitignore
new file mode 100644
index 0000000..bde5e9e
--- /dev/null
+++ b/src/wpa/.gitignore
@@ -0,0 +1,8 @@
+# Ignore the install dir
+_install/
+dbus*
+expat*
+libnl*
+openssl*
+wpa_supplicant*
+sysroot/
diff --git a/src/wpa/cleanup.wpa b/src/wpa/cleanup.wpa
new file mode 100755
index 0000000..aa32c30
--- /dev/null
+++ b/src/wpa/cleanup.wpa
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+SCRIPT_DIR=$(cd `dirname $0` && pwd)
+cd $SCRIPT_DIR
+
+rm -rf libnl*
+rm -rf openssl*
+rm -rf wpa_supplicant*
+
diff --git a/src/wpa/compile.wpa b/src/wpa/compile.wpa
new file mode 100755
index 0000000..977bd08
--- /dev/null
+++ b/src/wpa/compile.wpa
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+SCRIPT_DIR=$(cd `dirname $0` && pwd)
+PREFIX=$(pwd)/sysroot
+cd $SCRIPT_DIR
+
+cp -r openssl-1.1.1w/include/openssl wpa_supplicant-2.10/src/
+cd wpa_supplicant-2.10/wpa_supplicant || exit 1
+
+export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
+
+#cp defconfig .config
+#make CC=arm-hisiv300-linux-gcc CFLAGS=-I$SCRIPT_DIR/sysroot/openssl/include LIBS=-L$SCRIPT_DIR/sysroot/openssl/lib \
+make clean
+make
+make install DESTDIR="$SCRIPT_DIR/_install"
+arm-hisiv300-linux-strip $SCRIPT_DIR/_install/usr/local/sbin/*
diff --git a/src/wpa/init.wpa b/src/wpa/init.wpa
new file mode 100755
index 0000000..ff1d1c2
--- /dev/null
+++ b/src/wpa/init.wpa
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+SCRIPT_DIR=$(cd `dirname $0` && pwd)
+PREFIX=$(pwd)/sysroot
+cd $SCRIPT_DIR
+
+rm -rf ./_install
+rm -rf ./sysroot
+rm -rf ./openssl*
+rm -rf ./expat*
+rm -rf ./dbus*
+rm -rf ./libnl*
+rm -rf ./wpa_*
+
+#git reset --hard || exit 1
+
+wget -c https://www.openssl.org/source/openssl-1.1.1w.tar.gz
+wget -c https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
+wget -c https://w1.fi/releases/wpa_supplicant-2.10.tar.gz
+wget -c https://dbus.freedesktop.org/releases/dbus/dbus-1.15.8.tar.xz
+wget -c https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.gz
+
+tar zxf openssl-1.1.1w.tar.gz
+tar -xf libnl-3.2.25.tar.gz
+tar zxf wpa_supplicant-2.10.tar.gz
+tar -xf dbus-1.15.8.tar.xz
+tar zxf expat-2.5.0.tar.gz
+cp .config wpa_supplicant-2.10/wpa_supplicant
+
+#cp wpa_supplicant-2.10/wpa_supplicant/defconfig wpa_supplicant-2.10/wpa_supplicant/.config
+
+pushd openssl-1.1.1w
+
+#./Configure --cross-compile-prefix=arm-hisiv300-linux- linux-generic32 -DL_ENDIAN --prefix=/${PREFIX} --openssldir=/${PREFIX}
+#make CC=arm-hisiv300-linux-gcc LD=arm-hisiv300-linux-ld RANLIB=arm-hisiv300-linux-ranlib MAKEDEPPROG=arm-hisiv300-linux-gcc PROCESSOR=ARM install
+
+./Configure --cross-compile-prefix=arm-hisiv300-linux- linux-generic32 -DL_ENDIAN -no-async --prefix=/${PREFIX} --openssldir=/${PREFIX}
+make install
+
+popd
+
+pushd libnl-3.2.25
+
+./configure --host=arm-hisiv300-linux --prefix=${PREFIX}
+make CROSS_COMPILE=arm-hisiv300-linux- LD=arm-hisiv300-linux-ld AR=arm-hisiv300-linux-ar NM=arm-hisiv300-linux-nm AS=arm-hisiv300-linux-as install
+export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
+
+popd
+
+pushd expat-2.5.0
+
+./configure --host=arm-hisiv300-linux --prefix=${PREFIX} CC=arm-hisiv300-linux-gcc
+make
+make install
+
+popd
+
+pushd dbus-1.15.8
+
+./autogen.sh
+./configure --prefix=${PREFIX} --host=arm-hisiv300-linux --with-x=no ac_cv_have_abstract_sockets=yes "CC=arm-hisiv300-linux-gcc -I${PREFIX}/include -L${PREFIX}/lib"
+make
+make install
+
+popd
diff --git a/src/wpa/install.wpa b/src/wpa/install.wpa
new file mode 100755
index 0000000..663226b
--- /dev/null
+++ b/src/wpa/install.wpa
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+SCRIPT_DIR=$(cd `dirname $0` && pwd)
+cd $SCRIPT_DIR
+
+# Compress the file
+#upx ./_install/sbin/curl
+
+#mkdir -p ../../build/home/yi-hack-v5/wpa/
+mkdir -p ../../build/home/base/tools/
+mkdir -p ../../build/home/lib/
+
+#rsync -r ./_install/usr/local/sbin/ ../../build/home/yi-hack-v5/wpa/
+#cp sysroot/lib/libcrypto.so.1.1 ../../build/home/yi-hack-v5/wpa/
+
+rsync -r ./_install/usr/local/sbin/ ../../build/home/base/tools/
+arm-hisiv300-linux-strip sysroot/lib/libcrypto.so.1.1
+cp sysroot/lib/libcrypto.so* ../../build/home/lib/
diff --git a/src/wsdd/.gitignore b/src/wsdd/.gitignore
deleted file mode 100644
index cfea062..0000000
--- a/src/wsdd/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Ignore the install dir
-_install/
-wsdd/
diff --git a/src/wsdd/Makefile.wsdd b/src/wsdd/Makefile.wsdd
deleted file mode 100644
index 535da65..0000000
--- a/src/wsdd/Makefile.wsdd
+++ /dev/null
@@ -1,251 +0,0 @@
-DAEMON_NAME = wsdd
-DAEMON_MAJOR_VERSION = 2
-DAEMON_MINOR_VERSION = 1
-DAEMON_PATCH_VERSION = 0
-DAEMON_PID_FILE_NAME = $(DAEMON_NAME).pid
-DAEMON_LOG_FILE_NAME = $(DAEMON_NAME).log
-DAEMON_NO_CHDIR = 1
-DAEMON_NO_CLOSE_STDIO = 0
-
-
-GSOAP_VERSION = 2.8.92
-GSOAP_DIR = ./gsoap-2.8/gsoap
-GSOAP_PLUGIN_DIR = $(GSOAP_DIR)/plugin
-GSOAP_IMPORT_DIR = $(GSOAP_DIR)/import
-
-
-SOAPCPP2 = $(GSOAP_DIR)/src/soapcpp2
-WSDL2H = $(GSOAP_DIR)/wsdl/wsdl2h
-
-
-COMMON_DIR = ./src
-GENERATED_DIR = ./generated
-
-
-CFLAGS = -DDAEMON_NAME='"$(DAEMON_NAME)"'
-CFLAGS += -DDAEMON_MAJOR_VERSION=$(DAEMON_MAJOR_VERSION)
-CFLAGS += -DDAEMON_MINOR_VERSION=$(DAEMON_MINOR_VERSION)
-CFLAGS += -DDAEMON_PATCH_VERSION=$(DAEMON_PATCH_VERSION)
-CFLAGS += -DDAEMON_PID_FILE_NAME='"$(DAEMON_PID_FILE_NAME)"'
-CFLAGS += -DDAEMON_LOG_FILE_NAME='"$(DAEMON_LOG_FILE_NAME)"'
-CFLAGS += -DDAEMON_NO_CHDIR=$(DAEMON_NO_CHDIR)
-CFLAGS += -DDAEMON_NO_CLOSE_STDIO=$(DAEMON_NO_CLOSE_STDIO)
-
-CFLAGS += -I$(COMMON_DIR)
-CFLAGS += -I$(GENERATED_DIR)
-CFLAGS += -I$(GSOAP_DIR) -I$(GSOAP_PLUGIN_DIR) -I$(GSOAP_IMPORT_DIR)
-CFLAGS += -O2 -Wall -pipe
-CFLAGS += -DWITH_NO_C_LOCALE
-
-GCC ?= g++
-
-
-
-
-SOAP_SRC = $(GSOAP_DIR)/stdsoap2.c \
- $(GSOAP_PLUGIN_DIR)/wsaapi.c \
- $(GSOAP_PLUGIN_DIR)/wsddapi.c \
- $(GENERATED_DIR)/soapClient.c
-
-
-
-# Add your source files to the list.
-# Supported *.c *.cpp *.S files.
-# For other file types write a template rule for build, see below.
-SOURCES = $(COMMON_DIR)/$(DAEMON_NAME).c \
- $(COMMON_DIR)/daemon.c \
- $(COMMON_DIR)/net_utils.c \
- $(COMMON_DIR)/file_utils.c \
- $(COMMON_DIR)/wsdd_utils.c \
- $(COMMON_DIR)/client_events.c \
- $(GENERATED_DIR)/soapC.c \
- $(SOAP_SRC)
-
-
-
-
-
-OBJECTS := $(patsubst %.c, %.o, $(SOURCES) )
-OBJECTS := $(patsubst %.cpp,%.o, $(OBJECTS) )
-OBJECTS := $(patsubst %.S, %.o, $(OBJECTS) )
-
-
-DEBUG_SUFFIX = debug
-
-DEBUG_OBJECTS := $(patsubst %.o, %_$(DEBUG_SUFFIX).o, $(OBJECTS) )
-
-
-
-
-.PHONY: all
-all: debug release
-
-
-
-.PHONY: release
-release: CFLAGS := -s $(CFLAGS)
-release: $(DAEMON_NAME)
-
-
-
-.PHONY: debug
-debug: DAEMON_NO_CLOSE_STDIO = 1
-debug: CFLAGS := -DDEBUG -g $(CFLAGS)
-debug: $(DAEMON_NAME)_$(DEBUG_SUFFIX)
-
-
-
-# release
-$(DAEMON_NAME): .depend $(OBJECTS)
- $(call build_bin, $(OBJECTS))
-
-
-# debug
-$(DAEMON_NAME)_$(DEBUG_SUFFIX): .depend $(DEBUG_OBJECTS)
- $(call build_bin, $(DEBUG_OBJECTS))
-
-
-
-# Build release objects
-%.o: %.c
- $(build_object)
-
-
-%.o: %.cpp
- $(build_object)
-
-
-%.o: %.S
- $(build_object)
-
-
-
-# Build debug objects
-%_$(DEBUG_SUFFIX).o: %.c
- $(build_object)
-
-
-%_$(DEBUG_SUFFIX).o: %.cpp
- $(build_object)
-
-
-%_$(DEBUG_SUFFIX).o: %.S
- $(build_object)
-
-
-
-.PHONY: clean
-clean:
- -@rm -f $(DAEMON_NAME)
- -@rm -f $(DAEMON_NAME)_$(DEBUG_SUFFIX)
- -@rm -f $(OBJECTS)
- -@rm -f $(DEBUG_OBJECTS)
- -@rm -f .depend
- -@rm -f -d -R $(GENERATED_DIR)
- -@rm -f *.*~
-
-
-
-.PHONY: distclean
-distclean: clean
- -@rm -f -d -R SDK
- -@rm -f -d -R gsoap-2.8
- -@rm -f RECV.log SENT.log TEST.log
-
-
-
-.depend: $(GENERATED_DIR)/soapC.c
- -@rm -f .depend
- @echo "Generating dependencies..."
- @for src in $(SOURCES) ; do \
- echo " [depend] $$src" ; \
- $(GCC) $(CFLAGS) -MT ".depend $${src%.*}.o $${src%.*}_$(DEBUG_SUFFIX).o" -MM $$src >> .depend ; \
- done
-
-
-
-ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""
- include $(wildcard .depend)
-endif
-
-
-
-
-# ---- gSOAP ----
-
-$(GENERATED_DIR)/wsdd.h:
- @$(build_gsoap)
- @mkdir -p $(GENERATED_DIR)
- $(WSDL2H) -cg -t $(GSOAP_DIR)/WS/typemap.dat -o $@ wsdl/remotediscovery.wsdl
-
-
-
-$(GENERATED_DIR)/soapC.c: $(GENERATED_DIR)/wsdd.h
- $(SOAPCPP2) -C -L -x -c -2 -d $(GENERATED_DIR) -I$(GSOAP_DIR):$(GSOAP_IMPORT_DIR) $<
-
-
-
-# This targets is needed for parallel work of make
-$(OBJECTS) $(DEBUG_OBJECTS) $(SOAP_SRC): $(GENERATED_DIR)/soapC.c
-
-
-
-
-
-# Common commands
-BUILD_ECHO = echo "\n [build] $@:"
-
-
-define build_object
- @$(BUILD_ECHO)
- $(GCC) -c $< -o $@ $(CFLAGS)
-endef
-
-
-
-define build_bin
- @$(BUILD_ECHO)
- $(GCC) $1 -o $@ $(CFLAGS)
- @echo "\n---- Compiled $@ ver $(DAEMON_MAJOR_VERSION).$(DAEMON_MINOR_VERSION).$(DAEMON_PATCH_VERSION) ----\n"
-endef
-
-
-
-define build_gsoap
-
- # get archive
- if [ ! -f SDK/gsoap.zip ]; then \
- mkdir -p SDK; \
- wget -O ./SDK/gsoap.zip.tmp "http://dl.t2-project.org/mirror/trunk/g/gsoap_2.8.92.zip" || \
- wget -O ./SDK/gsoap.zip.tmp "https://sourceforge.net/projects/gsoap2/files/gsoap-2.8/gsoap_2.8.92.zip/download" && \
- mv ./SDK/gsoap.zip.tmp ./SDK/gsoap.zip; \
- fi
-
- # unzip
- if [ ! -f gsoap-2.8/README.txt ]; then \
- unzip ./SDK/gsoap.zip; \
- fi
-
- # build
- if [ ! -f $(SOAPCPP2) ] || [ ! -f $(WSDL2H) ]; then \
- cd gsoap-2.8; \
- ./configure --disable-c-locale && \
- make -j1; \
- cd ..;\
- fi
-endef
-
-
-
-
-.PHONY: help
-help:
- @echo "make [command]"
- @echo "command is:"
- @echo " all - build daemon in release and debug mode"
- @echo " debug - build in debug mode (#define DEBUG 1)"
- @echo " release - build in release mode (strip)"
- @echo " clean - remove all generated files"
- @echo " distclean - clean + remove all SDK files"
- @echo " help - this help"
-
diff --git a/src/wsdd/compile.wsdd b/src/wsdd/compile.wsdd
deleted file mode 100755
index 81abfbd..0000000
--- a/src/wsdd/compile.wsdd
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-export PATH=${PATH}:/opt/arm-hisiv300-linux/bin
-
-export TARGET=arm-hisiv300-linux-uclibcgnueabi
-export CROSS=arm-hisiv300-linux-uclibcgnueabi
-export BUILD=x86_64-pc-linux-gnu
-
-export CROSSPREFIX=${CROSS}-
-
-export GCC=${CROSSPREFIX}g++
-
-SCRIPT_DIR=$(cd `dirname $0` && pwd)
-cd $SCRIPT_DIR
-
-cd wsdd || exit 1
-
-make clean
-make release || exit 1
-mkdir -p $SCRIPT_DIR/_install/bin
-cp wsdd $SCRIPT_DIR/_install/bin/
diff --git a/src/wsdd/init.wsdd b/src/wsdd/init.wsdd
deleted file mode 100755
index b7da846..0000000
--- a/src/wsdd/init.wsdd
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-SCRIPT_DIR=$(cd `dirname $0` && pwd)
-cd $SCRIPT_DIR
-
-rm -rf ./_install
-
-cd wsdd || exit 1
-git reset --hard || exit 1
-
-cd ..
-
-patch -p0 < lock_error.patch
-patch -p0 < ip_mreqn.patch
-
-cp Makefile.wsdd wsdd/Makefile
diff --git a/src/wsdd/ip_mreqn.patch b/src/wsdd/ip_mreqn.patch
deleted file mode 100644
index 1fd0f62..0000000
--- a/src/wsdd/ip_mreqn.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur wsdd.ori/src/wsdd.c wsdd/src/wsdd.c
---- wsdd.ori/src/wsdd.c 2020-08-06 20:42:04.123972145 +0200
-+++ wsdd/src/wsdd.c 2020-08-06 20:37:38.000000000 +0200
-@@ -340,6 +340,7 @@
- }
-
- setsockopt(soap_srv->master, IPPROTO_IP, IP_MULTICAST_IF, &mcast.imr_address.s_addr, sizeof(struct in_addr));
-+ mcast.imr_ifindex = 0;
-
- if(setsockopt(soap_srv->master, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&mcast, sizeof(mcast)) != 0 )
- {
diff --git a/src/wsdd/lock_error.patch b/src/wsdd/lock_error.patch
deleted file mode 100644
index 77cf45f..0000000
--- a/src/wsdd/lock_error.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -Naur wsdd.ori/src/daemon.c wsdd/src/daemon.c
---- wsdd.ori/src/daemon.c 2020-06-22 14:30:19.000000000 +0200
-+++ wsdd/src/daemon.c 2020-06-22 14:29:17.000000000 +0200
-@@ -45,6 +45,7 @@
- #include
- #include
- #include
-+#include
-
- #include
- #include
-@@ -206,11 +207,11 @@
- return -1; // Could not create on PID file
-
-
-- if( lockf(fd, F_TLOCK, 0) == -1 )
-- {
-- close(fd);
-- return -1; // Could not get lock on PID file
-- }
-+// if( lockf(fd, F_TLOCK, 0) == -1 )
-+// {
-+// close(fd);
-+// return -1; // Could not get lock on PID file
-+// }
-
-
- if( ftruncate(fd, 0) != 0 )
diff --git a/src/wsdd/wsdd b/src/wsdd/wsdd
deleted file mode 160000
index f9d61ed..0000000
--- a/src/wsdd/wsdd
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f9d61ed16178fc376d73757ee283b303bff44870
diff --git a/src/www/httpd/cgi-bin/camera_settings.sh b/src/www/httpd/cgi-bin/camera_settings.sh
index be506fe..ad2888c 100755
--- a/src/www/httpd/cgi-bin/camera_settings.sh
+++ b/src/www/httpd/cgi-bin/camera_settings.sh
@@ -31,12 +31,6 @@ do
fi
elif [ "$CONF" == "sensitivity" ] ; then
ipc_cmd -s $VAL
- elif [ "$CONF" == "ai_human_detection" ] ; then
- if [ "$VAL" == "no" ] ; then
- ipc_cmd -a off
- else
- ipc_cmd -a on
- fi
elif [ "$CONF" == "sound_detection" ] ; then
if [ "$VAL" == "no" ] ; then
ipc_cmd -b off
@@ -47,6 +41,12 @@ do
if [ "$VAL" == "50" ] || [ "$VAL" == "60" ] || [ "$VAL" == "70" ] || [ "$VAL" == "80" ] || [ "$VAL" == "90" ] ; then
ipc_cmd -n $VAL
fi
+ elif [ "$CONF" == "baby_crying_detect" ] ; then
+ if [ "$VAL" == "no" ] ; then
+ ipc_cmd -B off
+ else
+ ipc_cmd -B on
+ fi
elif [ "$CONF" == "led" ] ; then
if [ "$VAL" == "no" ] ; then
ipc_cmd -l off
diff --git a/src/www/httpd/cgi-bin/links.sh b/src/www/httpd/cgi-bin/links.sh
index c4bcccc..8071e12 100755
--- a/src/www/httpd/cgi-bin/links.sh
+++ b/src/www/httpd/cgi-bin/links.sh
@@ -26,7 +26,7 @@ case $(get_config RTSP_PORT) in
*) RTSP_PORT=$(get_config RTSP_PORT) ;;
esac
case $(get_config HTTPD_PORT) in
- ''|*[!0-9]*) HTTPD_PORT=8080 ;;
+ ''|*[!0-9]*) HTTPD_PORT=80 ;;
*) HTTPD_PORT=$(get_config HTTPD_PORT) ;;
esac
diff --git a/src/www/httpd/cgi-bin/preset.sh b/src/www/httpd/cgi-bin/preset.sh
index 3bfc5b7..962b95e 100755
--- a/src/www/httpd/cgi-bin/preset.sh
+++ b/src/www/httpd/cgi-bin/preset.sh
@@ -1,19 +1,79 @@
#!/bin/sh
+YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
+PTZ_CONF_FILE=$YI_HACK_PREFIX/etc/ptz_presets.conf
+PTZ_SCRIPT=$YI_HACK_PREFIX/script/ptz_presets.sh
+
+. $YI_HACK_PREFIX/www/cgi-bin/validate.sh
+
+return_error() {
+ printf "Content-type: application/json\r\n\r\n"
+ printf "{\n"
+ printf "\"%s\":\"%s\",\\n" "error" "true"
+ printf "\"%s\":\"%s\"\\n" "message" "$@"
+ printf "}"
+}
+
+if ! $(validateQueryString $QUERY_STRING); then
+ return_error "Invalid query"
+ exit
+fi
+
+ACTION="none"
NUM=-1
+NAME=""
+
+for I in 1 2 3
+do
+ CONF="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f1)"
+ VAL="$(echo $QUERY_STRING | cut -d'&' -f$I | cut -d'=' -f2)"
-CONF="$(echo $QUERY_STRING | cut -d'=' -f1)"
-VAL="$(echo $QUERY_STRING | cut -d'=' -f2)"
+ if [ "$CONF" == "action" ] ; then
+ ACTION="$VAL"
+ elif [ "$CONF" == "num" ] ; then
+ if $(validateNumber $VAL); then
+ NUM="$VAL"
+ else
+ if [ "$VAL" == "all" ]; then
+ NUM="$VAL"
+ else
+ return_error "Wrong arguments"
+ exit
+ fi
+ fi
+ elif [ "$CONF" == "name" ] ; then
+ if $(validateString $VAL); then
+ NAME="$VAL"
+ else
+ return_error "Wrong arguments"
+ exit
+ fi
+ fi
+done
-if [ "$CONF" == "num" ] ; then
- NUM=$VAL
+if [ "$ACTION" == "none" ] || [ "$ACTION" == "get_presets" ]; then
+ return_error -99
+ exit
fi
-if [ $NUM -ne -1 ] ; then
- ipc_cmd -p $NUM
+if [ "$NUM" != "-1" ]; then
+ NUM="-n $NUM"
+else
+ NUM=""
+fi
+if [ ! -z $NAME ]; then
+ NAME="-m $NAME"
+else
+ NAME=""
fi
-printf "Content-type: application/json\r\n\r\n"
+RES=$($PTZ_SCRIPT -a $ACTION $NUM $NAME)
-printf "{\n"
-printf "}"
+if [ "$RES" == "" ]; then
+ printf "Content-type: application/json\r\n\r\n"
+ printf "{\n"
+ printf "\"%s\":\"%s\"\\n" "error" "false"
+ printf "}"
+else
+ return_error $RES
+fi
diff --git a/src/www/httpd/cgi-bin/service.sh b/src/www/httpd/cgi-bin/service.sh
index 6db82e0..8416008 100755
--- a/src/www/httpd/cgi-bin/service.sh
+++ b/src/www/httpd/cgi-bin/service.sh
@@ -23,19 +23,16 @@ init_config()
if [[ x$(get_config USERNAME) != "x" ]] ; then
USERNAME=$(get_config USERNAME)
PASSWORD=$(get_config PASSWORD)
- ONVIF_USERPWD="--user $USERNAME --password $PASSWORD"
+ ONVIF_USERPWD="user=$USERNAME\npassword=$PASSWORD"
+ RTSP_USERPWD=$USERNAME:$PASSWORD@
fi
case $(get_config RTSP_PORT) in
''|*[!0-9]*) RTSP_PORT=554 ;;
*) RTSP_PORT=$(get_config RTSP_PORT) ;;
esac
- case $(get_config ONVIF_PORT) in
- ''|*[!0-9]*) ONVIF_PORT=80 ;;
- *) ONVIF_PORT=$(get_config ONVIF_PORT) ;;
- esac
case $(get_config HTTPD_PORT) in
- ''|*[!0-9]*) HTTPD_PORT=8080 ;;
+ ''|*[!0-9]*) HTTPD_PORT=80 ;;
*) HTTPD_PORT=$(get_config HTTPD_PORT) ;;
esac
@@ -43,10 +40,6 @@ init_config()
D_RTSP_PORT=:$RTSP_PORT
fi
- if [[ $ONVIF_PORT != "80" ]] ; then
- D_ONVIF_PORT=:$ONVIF_PORT
- fi
-
if [[ $HTTPD_PORT != "80" ]] ; then
D_HTTPD_PORT=:$HTTPD_PORT
fi
@@ -102,36 +95,116 @@ start_onvif()
WATERMARK="&watermark=yes"
fi
if [[ $1 == "high" ]]; then
- ONVIF_PROFILE_0="--name Profile_0 --width $HIGHWIDTH --height $HIGHHEIGHT --url rtsp://%s$D_RTSP_PORT/ch0_0.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=high$WATERMARK --type H264"
+ ONVIF_PROFILE_0="name=Profile_0\nwidth=$HIGHWIDTH\nheight=$HIGHHEIGHT\nurl=rtsp://$RTSP_USERPWD%s$D_RTSP_PORT/ch0_0.h264\nsnapurl=http://$RTSP_USERPWD%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=high$WATERMARK\ntype=H264"
fi
if [[ $1 == "low" ]]; then
- ONVIF_PROFILE_1="--name Profile_1 --width 640 --height 360 --url rtsp://%s$D_RTSP_PORT/ch0_1.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK --type H264"
+ ONVIF_PROFILE_1="name=Profile_1\nwidth=640\nheight=360\nurl=rtsp://$RTSP_USERPWD%s$D_RTSP_PORT/ch0_1.h264\nsnapurl=http://$RTSP_USERPWD%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK\ntype=H264"
fi
if [[ $1 == "both" ]]; then
- ONVIF_PROFILE_0="--name Profile_0 --width $HIGHWIDTH --height $HIGHHEIGHT --url rtsp://%s$D_RTSP_PORT/ch0_0.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=high$WATERMARK --type H264"
- ONVIF_PROFILE_1="--name Profile_1 --width 640 --height 360 --url rtsp://%s$D_RTSP_PORT/ch0_1.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK --type H264"
+ ONVIF_PROFILE_0="name=Profile_0\nwidth=$HIGHWIDTH\nheight=$HIGHHEIGHT\nurl=rtsp://$RTSP_USERPWD%s$D_RTSP_PORT/ch0_0.h264\nsnapurl=http://$RTSP_USERPWD%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=high$WATERMARK\ntype=H264"
+ ONVIF_PROFILE_1="name=Profile_1\nwidth=640\nheight=360\nurl=rtsp://$RTSP_USERPWD%s$D_RTSP_PORT/ch0_1.h264\nsnapurl=http://$RTSP_USERPWD%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK\ntype=H264"
+ fi
+
+ ONVIF_SRVD_CONF="/tmp/onvif_simple_server.conf"
+
+ echo "model=Yi Hack" > $ONVIF_SRVD_CONF
+ echo "manufacturer=Yi" >> $ONVIF_SRVD_CONF
+ echo "firmware_ver=$YI_HACK_VER" >> $ONVIF_SRVD_CONF
+ echo "hardware_id=$HW_ID" >> $ONVIF_SRVD_CONF
+ echo "serial_num=$SERIAL_NUMBER" >> $ONVIF_SRVD_CONF
+ echo "ifs=$ONVIF_NETIF" >> $ONVIF_SRVD_CONF
+ echo "port=$HTTPD_PORT" >> $ONVIF_SRVD_CONF
+ echo "scope=onvif://www.onvif.org/Profile/Streaming" >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
+ if [ ! -z $ONVIF_USERPWD ]; then
+ echo -e $ONVIF_USERPWD >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
+ fi
+ if [ ! -z $ONVIF_PROFILE_0 ]; then
+ echo "#Profile 0" >> $ONVIF_SRVD_CONF
+ echo -e $ONVIF_PROFILE_0 >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
+ fi
+ if [ ! -z $ONVIF_PROFILE_1 ]; then
+ echo "#Profile 1" >> $ONVIF_SRVD_CONF
+ echo -e $ONVIF_PROFILE_1 >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
fi
if [[ $MODEL_SUFFIX == "yi_dome" ]] || [[ $MODEL_SUFFIX == "yi_dome_1080p" ]] || [[ $MODEL_SUFFIX == "yi_cloud_dome_1080p" ]] ; then
- onvif_srvd --pid_file /var/run/onvif_srvd.pid --model "$MODEL_SUFFIX" --manufacturer "Yi" --firmware_ver "$YI_HACK_VER" --hardware_id $HW_ID --serial_num $SERIAL_NUMBER --ifs $ONVIF_NETIF --port $ONVIF_PORT --scope onvif://www.onvif.org/Profile/S $ONVIF_PROFILE_0 $ONVIF_PROFILE_1 $ONVIF_USERPWD --ptz --move_left "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m left" --move_right "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m right" --move_up "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m up" --move_down "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m down" --move_stop "/tmp/sd/yi-hack-v5/bin/ipc_cmd -m stop" --move_preset "/tmp/sd/yi-hack-v5/bin/ipc_cmd -p %t"
- else
- onvif_srvd --pid_file /var/run/onvif_srvd.pid --model "$MODEL_SUFFIX" --manufacturer "Yi" --firmware_ver "$YI_HACK_VER" --hardware_id $HW_ID --serial_num $SERIAL_NUMBER --ifs $ONVIF_NETIF --port $ONVIF_PORT --scope onvif://www.onvif.org/Profile/S $ONVIF_PROFILE_0 $ONVIF_PROFILE_1 $ONVIF_USERPWD
+ echo "#PTZ" >> $ONVIF_SRVD_CONF
+ echo "ptz=1" >> $ONVIF_SRVD_CONF
+ echo "get_position=/tmp/sd/yi-hack-v5/bin/ipc_cmd -g" >> $ONVIF_SRVD_CONF
+ echo "is_running=/tmp/sd/yi-hack-v5/bin/ipc_cmd -u" >> $ONVIF_SRVD_CONF
+ echo "move_left=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m left" >> $ONVIF_SRVD_CONF
+ echo "move_right=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m right" >> $ONVIF_SRVD_CONF
+ echo "move_up=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m up" >> $ONVIF_SRVD_CONF
+ echo "move_down=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m down" >> $ONVIF_SRVD_CONF
+ echo "move_stop=/tmp/sd/yi-hack-v5/bin/ipc_cmd -m stop" >> $ONVIF_SRVD_CONF
+ echo "move_preset=/tmp/sd/yi-hack-v5/bin/ipc_cmd -p %d" >> $ONVIF_SRVD_CONF
+ echo "set_preset=/tmp/sd/yi-hack-v5/script/ptz_presets.sh -a add_preset -m %s" >> $ONVIF_SRVD_CONF
+ echo "set_home_position=/tmp/sd/yi-hack-v5/script/ptz_presets.sh -a set_home_position" >> $ONVIF_SRVD_CONF
+ echo "remove_preset=/tmp/sd/yi-hack-v5/script/ptz_presets.sh -a del_preset -n %d" >> $ONVIF_SRVD_CONF
+ echo "jump_to_abs=/tmp/sd/yi-hack-v5/bin/ipc_cmd -j %f,%f" >> $ONVIF_SRVD_CONF
+ echo "jump_to_rel=/tmp/sd/yi-hack-v5/bin/ipc_cmd -J %f,%f" >> $ONVIF_SRVD_CONF
+ echo "get_presets=/tmp/sd/yi-hack-v5/script/ptz_presets.sh -a get_presets" >> $ONVIF_SRVD_CONF
+ echo "" >> $ONVIF_SRVD_CONF
fi
+
+ echo "#EVENT" >> $ONVIF_SRVD_CONF
+ echo "events=3" >> $ONVIF_SRVD_CONF
+ echo "#Event 0" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:VideoSource/MotionAlarm" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/motion_alarm" >> $ONVIF_SRVD_CONF
+ echo "#Event 1" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:RuleEngine/MyRuleDetector/PeopleDetect" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/human_detection" >> $ONVIF_SRVD_CONF
+ echo "#Event 2" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:RuleEngine/MyRuleDetector/VehicleDetect" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/vehicle_detection" >> $ONVIF_SRVD_CONF
+ echo "#Event 3" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:RuleEngine/MyRuleDetector/DogCatDetect" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/animal_detection" >> $ONVIF_SRVD_CONF
+ echo "#Event 4" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:RuleEngine/MyRuleDetector/BabyCryingDetect" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/baby_crying" >> $ONVIF_SRVD_CONF
+ echo "#Event 5" >> $ONVIF_SRVD_CONF
+ echo "topic=tns1:AudioAnalytics/Audio/DetectedSound" >> $ONVIF_SRVD_CONF
+ echo "source_name=VideoSourceConfigurationToken" >> $ONVIF_SRVD_CONF
+ echo "source_value=VideoSourceToken" >> $ONVIF_SRVD_CONF
+ echo "input_file=/tmp/onvif_notify_server/sound_detection" >> $ONVIF_SRVD_CONF
+
+ chmod 0600 $ONVIF_SRVD_CONF
+ onvif_simple_server --conf_file $ONVIF_SRVD_CONF
+ ipc2file
+ onvif_notify_server --conf_file $ONVIF_SRVD_CONF
}
stop_onvif()
{
- killall onvif_srvd
+ killall onvif_notify_server
+ killall ipc2file
+ killall onvif_simple_server
}
start_wsdd()
{
- wsdd --pid_file /var/run/wsdd.pid --if_name wlan0 --type tdn:NetworkVideoTransmitter --xaddr "http://%s$D_ONVIF_PORT" --scope "onvif://www.onvif.org/name/Unknown onvif://www.onvif.org/Profile/Streaming"
+ wsd_simple_server --pid_file /var/run/wsd_simple_server.pid --if_name $ONVIF_NETIF --xaddr "http://%s$D_HTTPD_PORT/onvif/device_service" -m yi_hack -n Yi
}
stop_wsdd()
{
- killall wsdd
+ killall wsd_simple_server
}
start_ftpd()
@@ -182,6 +255,16 @@ ps_program()
fi
}
+. $YI_HACK_PREFIX/www/cgi-bin/validate.sh
+
+if ! $(validateQueryString $QUERY_STRING); then
+ printf "Content-type: application/json\r\n\r\n"
+ printf "{\n"
+ printf "\"%s\":\"%s\"\\n" "error" "true"
+ printf "}"
+ exit
+fi
+
NAME="none"
ACTION="none"
PARAM1="none"
@@ -208,7 +291,7 @@ init_config
if [ "$ACTION" == "start" ] ; then
if [ "$NAME" == "rtsp" ]; then
- start_rtsp $PARAM1
+ start_rtsp $PARAM1 $PARAM2
elif [ "$NAME" == "onvif" ]; then
start_onvif $PARAM1 $PARAM2
elif [ "$NAME" == "wsdd" ]; then
@@ -216,20 +299,20 @@ if [ "$ACTION" == "start" ] ; then
elif [ "$NAME" == "ftpd" ]; then
start_ftpd $PARAM1
elif [ "$NAME" == "mqtt" ]; then
- mqttv4 >/dev/null &
- mqtt-config >/dev/null &
+ mqttv4 > /dev/null &
+ mqtt-config > /dev/null &
elif [ "$NAME" == "mp4record" ]; then
cd /home/app
- ./mp4record >/dev/null &
+ ./mp4record > /dev/null &
elif [ "$NAME" == "all" ]; then
start_rtsp
start_onvif
start_wsdd
start_ftpd
- mqttv4 >/dev/null &
- mqtt-config >/dev/null &
+ mqttv4 > /dev/null &
+ mqtt-config > /dev/null &
cd /home/app
- ./mp4record >/dev/null &
+ ./mp4record > /dev/null &
fi
elif [ "$ACTION" == "stop" ] ; then
if [ "$NAME" == "rtsp" ]; then
@@ -258,9 +341,9 @@ elif [ "$ACTION" == "status" ] ; then
if [ "$NAME" == "rtsp" ]; then
RES=$(ps_program rRTSPServer)
elif [ "$NAME" == "onvif" ]; then
- RES=$(ps_program onvif_srvd)
+ RES=$(ps_program onvif_simple_server)
elif [ "$NAME" == "wsdd" ]; then
- RES=$(ps_program wsdd)
+ RES=$(ps_program wsd_simple_server)
elif [ "$NAME" == "ftpd" ]; then
RES=$(ps_program ftpd)
elif [ "$NAME" == "mqtt" ]; then
diff --git a/src/www/httpd/htdocs/js/modules/camera_settings.js b/src/www/httpd/htdocs/js/modules/camera_settings.js
index b7e815e..57cdfd0 100644
--- a/src/www/httpd/htdocs/js/modules/camera_settings.js
+++ b/src/www/httpd/htdocs/js/modules/camera_settings.js
@@ -57,9 +57,9 @@ APP.camera_settings = (function ($) {
url: 'cgi-bin/camera_settings.sh?' +
'save_video_on_motion=' + configs["SAVE_VIDEO_ON_MOTION"] +
'&sensitivity=' + configs["SENSITIVITY"] +
- '&ai_human_detection=' + configs["AI_HUMAN_DETECTION"] +
'&sound_detection=' + configs["SOUND_DETECTION"] +
'&sound_sensitivity=' + configs["SOUND_SENSITIVITY"] +
+ '&baby_crying_detect=' + configs["BABY_CRYING_DETECT"] +
'&led=' + configs["LED"] +
'&ir=' + configs["IR"] +
'&rotate=' + configs["ROTATE"] +
diff --git a/src/www/httpd/htdocs/js/modules/configurations.js b/src/www/httpd/htdocs/js/modules/configurations.js
index 6add4fb..7320b49 100644
--- a/src/www/httpd/htdocs/js/modules/configurations.js
+++ b/src/www/httpd/htdocs/js/modules/configurations.js
@@ -25,7 +25,7 @@ APP.configurations = (function ($) {
loadingStatusElem.fadeOut(500);
$.each(response, function (key, state) {
- if(key=="HOSTNAME" || key=="TIMEZONE" || key=="NTP_SERVER" || key=="HTTPD_PORT" || key=="RTSP_PORT" || key=="ONVIF_PORT" || key=="USERNAME")
+ if(key=="HOSTNAME" || key=="TIMEZONE" || key=="NTP_SERVER" || key=="HTTPD_PORT" || key=="RTSP_PORT" || key=="USERNAME")
$('input[type="text"][data-key="' + key +'"]').prop('value', state);
else if(key=="RTSP_STREAM" || key=="RTSP_AUDIO" || key=="ONVIF_PROFILE" || key=="ONVIF_NETIF")
$('select[data-key="' + key +'"]').prop('value', state);
@@ -70,7 +70,6 @@ APP.configurations = (function ($) {
configs["RTSP_STREAM"] = $('select[data-key="RTSP_STREAM"]').prop('value');
configs["RTSP_AUDIO"] = $('select[data-key="RTSP_AUDIO"]').prop('value');
configs["RTSP_PORT"] = $('input[type="text"][data-key="RTSP_PORT"]').prop('value');
- configs["ONVIF_PORT"] = $('input[type="text"][data-key="ONVIF_PORT"]').prop('value');
configs["ONVIF_PROFILE"] = $('select[data-key="ONVIF_PROFILE"]').prop('value');
configs["ONVIF_NETIF"] = $('select[data-key="ONVIF_NETIF"]').prop('value');
configs["USERNAME"] = $('input[type="text"][data-key="USERNAME"]').prop('value');
diff --git a/src/www/httpd/htdocs/js/modules/ptz.js b/src/www/httpd/htdocs/js/modules/ptz.js
index 25d3817..e7424ca 100644
--- a/src/www/httpd/htdocs/js/modules/ptz.js
+++ b/src/www/httpd/htdocs/js/modules/ptz.js
@@ -5,6 +5,7 @@ APP.ptz = (function ($) {
function init() {
updatePage();
registerEventHandler();
+ initPage();
snapshotTimer();
}
@@ -61,7 +62,7 @@ APP.ptz = (function ($) {
$(button).attr("disabled", true);
$.ajax({
type: "GET",
- url: 'cgi-bin/preset.sh?num='+$(select + " option:selected").text(),
+ url: 'cgi-bin/preset.sh?action=go_preset&num='+$(select + " option:selected").text(),
dataType: "json",
error: function(response) {
console.log('error', response);
@@ -73,6 +74,89 @@ APP.ptz = (function ($) {
});
}
+ function addPreset(button) {
+ $(button).attr("disabled", true);
+ $.ajax({
+ type: "POST",
+ url: 'cgi-bin/preset.sh?action=add_preset&name='+$('input[type="text"][data-key="PRESET_NAME"]').prop('value'),
+ dataType: "json",
+ error: function(response) {
+ console.log('error', response);
+ $(button).attr("disabled", false);
+ },
+ success: function(data) {
+ $(button).attr("disabled", false);
+ window.location.reload();
+ }
+ });
+ }
+
+ function delPreset(button, select) {
+ $(button).attr("disabled", true);
+ $.ajax({
+ type: "POST",
+ url: 'cgi-bin/preset.sh?action=del_preset&num='+$(select + " option:selected").val(),
+ dataType: "json",
+ error: function(response) {
+ console.log('error', response);
+ $(button).attr("disabled", false);
+ },
+ success: function(data) {
+ $(button).attr("disabled", false);
+ window.location.reload();
+ }
+ });
+ }
+
+ function delAllPreset(button) {
+ $(button).attr("disabled", true);
+ $.ajax({
+ type: "POST",
+ url: 'cgi-bin/preset.sh?action=del_preset&num=all',
+ dataType: "json",
+ error: function(response) {
+ console.log('error', response);
+ $(button).attr("disabled", false);
+ },
+ success: function(data) {
+ $(button).attr("disabled", false);
+ window.location.reload();
+ }
+ });
+ }
+
+ function initPage() {
+ $.ajax({
+ type: "GET",
+ url: 'cgi-bin/get_configs.sh?conf=ptz_presets',
+ dataType: "json",
+ success: function(data) {
+ html = "\n";
+ for (let key in data) {
+ if (key != "NULL") {
+ fields = data[key].split(',');
+ html += "" + key + " - " + fields[0] + " \n";
+ }
+ }
+ html += " \n";
+ document.getElementById("select-goto-container").innerHTML = html;
+
+ html = "\n";
+ for (let key in data) {
+ if (key != "NULL") {
+ fields = data[key].split(',');
+ html += "" + key + " - " + fields[0] + " \n";
+ }
+ }
+ html += " \n";
+ document.getElementById("select-del-container").innerHTML = html;
+ },
+ error: function(response) {
+ console.log('error', response);
+ }
+ });
+ }
+
function updatePage() {
$.ajax({
type: "GET",
diff --git a/src/www/httpd/htdocs/pages/camera_settings.html b/src/www/httpd/htdocs/pages/camera_settings.html
index 55bc522..367f725 100644
--- a/src/www/httpd/htdocs/pages/camera_settings.html
+++ b/src/www/httpd/htdocs/pages/camera_settings.html
@@ -76,9 +76,9 @@ General
Enable/disable AI Human Detection.
-
+ -->
- Sound Detection
+ Sound Detection (if supported by your cam)
@@ -103,7 +103,20 @@ General
- -->
+
+
+ Baby crying detect (if supported by your cam)
+
+
+
+
+
+
+
+ Enable/disable baby crying detect.
+
+
+
Status led
diff --git a/src/www/httpd/htdocs/pages/configurations.html b/src/www/httpd/htdocs/pages/configurations.html
index 1249f0a..9973ef1 100644
--- a/src/www/httpd/htdocs/pages/configurations.html
+++ b/src/www/httpd/htdocs/pages/configurations.html
@@ -160,15 +160,47 @@ General
- ONVIF watermark
+ Enable/disable time OSD
-
+
- Add watermark to snapshot.
+ Enable/disable time OSD in the upper left corner.
+
+
+
+ It works only if the cam doesn't show osd natively.
+
+
+
+
+ Snapshot
+
+
+
+
+
+
+
+ Enable snapshot feature.
+
+ If you want to use this feature, enable swap file to avoid memory problems.
+
+
+
+
+ Force low resolution snapshot
+
+
+
+
+
+
+
+ Take low resolution snapshots only and no watermark (useful for avoiding memory problems).
@@ -322,21 +354,12 @@ TCP ports
-
- ONVIF Port
-
-
-
- TCP port used by ONVIF Server (default 80).
-
-
-
HTTPD Port
- TCP port used by HTTPD Server (default 8080).
+ TCP port used by HTTPD Server (default 80).
diff --git a/src/www/httpd/htdocs/pages/mqtt.html b/src/www/httpd/htdocs/pages/mqtt.html
index 3dc3326..5aace03 100644
--- a/src/www/httpd/htdocs/pages/mqtt.html
+++ b/src/www/httpd/htdocs/pages/mqtt.html
@@ -130,16 +130,20 @@ Topics
Motion Stop Message
+ Baby Crying Message
+
Topic Suffix for jpeg image
A raw jpeg image is sent to this topic when a motion is detected.
+ Delay between motion detection and snapshot (s)
+
Topic Suffix for video list message
-
+
Sound Detection
@@ -157,7 +161,7 @@ Topics
-
+
@@ -242,7 +246,7 @@ Advanced
-
+
Retain for Sound Detection messages
diff --git a/src/www/httpd/htdocs/pages/ptz.html b/src/www/httpd/htdocs/pages/ptz.html
index 054e731..a8fc6f9 100644
--- a/src/www/httpd/htdocs/pages/ptz.html
+++ b/src/www/httpd/htdocs/pages/ptz.html
@@ -1,5 +1,5 @@
-
+
@@ -7,7 +7,7 @@
In this page you can move your cam.
-
+
PTZ functions are not available for this camera model.
@@ -38,29 +38,80 @@
Move pad
-
Presets
+
Go to Preset
-
+
+
+
+
+
+ Preset Number
+
+
+
+
+ Number of the preset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Add Preset
+
+
+
+
+
+
+
+
Delete Preset
+
+
+
+
+
+
+ Preset Number
+
+
+
+
+ Number of the preset to remove.
+
+
+
+
+
+
+
+
+
+
+
+