mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
49_SSCam: Vars "USERNAME" and "RECTIME" removed from Internals,
Var (Internals) "SERVERNAME" changed to "SERVERADDR", minor change of Log messages, git-svn-id: https://svn.fhem.de/fhem/trunk@10468 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7ee2b25de2
commit
03839e1aed
@ -1,5 +1,9 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- change: 49_SSCam: Vars "USERNAME" and "RECTIME" removed from Internals,
|
||||||
|
Var (Internals) "SERVERNAME" changed to "SERVERADDR",
|
||||||
|
minor change of Log messages,
|
||||||
|
Note: use rereadcfg in order to activate the changes
|
||||||
- feature: version: version command shows also internal helper modules that
|
- feature: version: version command shows also internal helper modules that
|
||||||
are loaded (HttpUtils, Blocking, ...)
|
are loaded (HttpUtils, Blocking, ...)
|
||||||
- feature: 70_VIERA: Using non blocking for status update.
|
- feature: 70_VIERA: Using non blocking for status update.
|
||||||
|
@ -27,26 +27,30 @@
|
|||||||
##########################################################################################################
|
##########################################################################################################
|
||||||
# Versions History:
|
# Versions History:
|
||||||
#
|
#
|
||||||
# 1.5 04.01.2016 Function "Get" for creating Camera-Readings integrated,
|
# 1.5.1 11.01.2016 Vars "USERNAME" and "RECTIME" removed from internals,
|
||||||
# Attributs pollcaminfoall, pollnologging added,
|
# Var (Internals) "SERVERNAME" changed to "SERVERADDR",
|
||||||
# Function for Polling Cam-Infos added.
|
# minor change of Log messages,
|
||||||
# 1.4 23.12.2015 function "enable" and "disable" for SS-Cams added,
|
# Note: use rereadcfg in order to activate the changes
|
||||||
# changed timout of Http-calls to a higher value
|
# 1.5 04.01.2016 Function "Get" for creating Camera-Readings integrated,
|
||||||
# 1.3 19.12.2015 function "snap" for taking snapshots added,
|
# Attributs pollcaminfoall, pollnologging added,
|
||||||
# fixed a bug that functions may impact each other
|
# Function for Polling Cam-Infos added.
|
||||||
# 1.2 14.12.2015 improve usage of verbose-modes
|
# 1.4 23.12.2015 function "enable" and "disable" for SS-Cams added,
|
||||||
# 1.1 13.12.2015 use of InternalTimer instead of fhem(sleep)
|
# changed timout of Http-calls to a higher value
|
||||||
# 1.0 12.12.2015 changed completly to HttpUtils_NonblockingGet for calling websites nonblocking,
|
# 1.3 19.12.2015 function "snap" for taking snapshots added,
|
||||||
# LWP is not needed anymore
|
# fixed a bug that functions may impact each other
|
||||||
|
# 1.2 14.12.2015 improve usage of verbose-modes
|
||||||
|
# 1.1 13.12.2015 use of InternalTimer instead of fhem(sleep)
|
||||||
|
# 1.0 12.12.2015 changed completly to HttpUtils_NonblockingGet for calling websites nonblocking,
|
||||||
|
# LWP is not needed anymore
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Definition: define <name> SSCam <serverIP> <serverport> <username> <password> <camname> <rectime>
|
# Definition: define <name> SSCam <ServerAddr> <ServerPort> <username> <password> <camname> <rectime>
|
||||||
#
|
#
|
||||||
# Example: define CamCP1 SSCAM 192.168.2.20 5000 apiuser apipw Carport 5
|
# Example: define CamCP1 SSCAM 192.168.2.20 5000 apiuser apipw Carport 5
|
||||||
#
|
#
|
||||||
# Parameters:
|
# Parameters:
|
||||||
#
|
#
|
||||||
# $servername = ""; # DS-Sername oder IP
|
# $serveraddr = ""; # DS-IP-Address
|
||||||
# $serverport = ""; # DS Port
|
# $serverport = ""; # DS Port
|
||||||
# $username = ""; # User für login auf DS
|
# $username = ""; # User für login auf DS
|
||||||
# $password = ""; # Passwort für User login
|
# $password = ""; # Passwort für User login
|
||||||
@ -94,10 +98,10 @@ sub SSCam_Define {
|
|||||||
my @a = split("[ \t][ \t]*", $def);
|
my @a = split("[ \t][ \t]*", $def);
|
||||||
|
|
||||||
if(int(@a) < 8) {
|
if(int(@a) < 8) {
|
||||||
return "You need to specify more parameters.\n". "Format: define <name> SSCAM <Servername> <Port> <User> <Password> <Cameraname> <Recordtime>";
|
return "You need to specify more parameters.\n". "Format: define <name> SSCAM <ServerAddress> <Port> <User> <Password> <Cameraname> <Recordtime>";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $servername = $a[2];
|
my $serveraddr = $a[2];
|
||||||
my $serverport = $a[3];
|
my $serverport = $a[3];
|
||||||
my $username = $a[4];
|
my $username = $a[4];
|
||||||
my $password = $a[5];
|
my $password = $a[5];
|
||||||
@ -109,15 +113,15 @@ sub SSCam_Define {
|
|||||||
# führende Nullen entfernen
|
# führende Nullen entfernen
|
||||||
$rectime =~ s/^0+//;
|
$rectime =~ s/^0+//;
|
||||||
|
|
||||||
$hash->{SERVERNAME} = $servername;
|
$hash->{SERVERADDR} = $serveraddr;
|
||||||
$hash->{SERVERPORT} = $serverport;
|
$hash->{SERVERPORT} = $serverport;
|
||||||
$hash->{USERNAME} = $username;
|
$hash->{HELPER}{USERNAME} = $username;
|
||||||
$hash->{HELPER}{PASSWORD} = $password;
|
$hash->{HELPER}{PASSWORD} = $password;
|
||||||
$hash->{CAMNAME} = $camname;
|
$hash->{CAMNAME} = $camname;
|
||||||
$hash->{RECTIME} = $rectime;
|
$hash->{HELPER}{RECTIME} = $rectime;
|
||||||
# für später
|
# für später
|
||||||
# Standard für rectime setzen, überschreibbar durch Attribut "rectime"
|
# Standard für rectime setzen, überschreibbar durch Attribut "rectime"
|
||||||
# $hash->{RECTIME} = 15;
|
# $hash->{HELPER}{RECTIME} = 15;
|
||||||
# $attr{$name}{rectime} = $rectime;
|
# $attr{$name}{rectime} = $rectime;
|
||||||
|
|
||||||
# benötigte API's in $hash einfügen
|
# benötigte API's in $hash einfügen
|
||||||
@ -129,9 +133,9 @@ sub SSCam_Define {
|
|||||||
$hash->{HELPER}{APIPTZ} = "SYNO.SurveillanceStation.PTZ";
|
$hash->{HELPER}{APIPTZ} = "SYNO.SurveillanceStation.PTZ";
|
||||||
|
|
||||||
# Anfangswerte setzen
|
# Anfangswerte setzen
|
||||||
$hash->{HELPER}{ACTIVE} = "off"; # Funktionstoken "off", Funktionen können sofort starten
|
$hash->{HELPER}{ACTIVE} = "off"; # Funktionstoken "off", Funktionen können sofort starten
|
||||||
$hash->{HELPER}{OLDVALPOLLNOLOGGING} ="0"; # Loggingfunktion für Polling ist an
|
$hash->{HELPER}{OLDVALPOLLNOLOGGING} = "0"; # Loggingfunktion für Polling ist an
|
||||||
$hash->{STATE} = "initialized"; # Anfangsstatus der Geräte
|
$hash->{STATE} = "initialized"; # Anfangsstatus der Geräte
|
||||||
readingsSingleUpdate($hash,"Record","Stop",0); # Recordings laufen nicht
|
readingsSingleUpdate($hash,"Record","Stop",0); # Recordings laufen nicht
|
||||||
readingsSingleUpdate($hash,"Availability", "", 0); # Verfügbarkeit ist unbekannt
|
readingsSingleUpdate($hash,"Availability", "", 0); # Verfügbarkeit ist unbekannt
|
||||||
readingsSingleUpdate($hash,"PollState","Inactive",0); # es ist keine Gerätepolling aktiv
|
readingsSingleUpdate($hash,"PollState","Inactive",0); # es ist keine Gerätepolling aktiv
|
||||||
@ -263,7 +267,7 @@ sub watchdogpollcaminfo ($) {
|
|||||||
# Polling ist jetzt aktiv
|
# Polling ist jetzt aktiv
|
||||||
readingsSingleUpdate($hash,"PollState","Active",0);
|
readingsSingleUpdate($hash,"PollState","Active",0);
|
||||||
|
|
||||||
$logstr = "Polling Camera $camname is activated now - Pollinginterval: ".AttrVal($name, "pollcaminfoall", undef)."s";
|
$logstr = "Polling Camera $camname is currently activated - Pollinginterval: ".AttrVal($name, "pollcaminfoall", undef)."s";
|
||||||
&printlog($hash,$logstr,"2");
|
&printlog($hash,$logstr,"2");
|
||||||
|
|
||||||
# in $hash eintragen für späteren Vergleich (Changes von pollcaminfoall)
|
# in $hash eintragen für späteren Vergleich (Changes von pollcaminfoall)
|
||||||
@ -287,12 +291,12 @@ sub watchdogpollcaminfo ($) {
|
|||||||
if (defined(AttrVal($name, "pollnologging", undef))) {
|
if (defined(AttrVal($name, "pollnologging", undef))) {
|
||||||
if ($hash->{HELPER}{OLDVALPOLLNOLOGGING} ne AttrVal($name, "pollnologging", undef)) {
|
if ($hash->{HELPER}{OLDVALPOLLNOLOGGING} ne AttrVal($name, "pollnologging", undef)) {
|
||||||
if (AttrVal($name, "pollnologging", undef) == "1") {
|
if (AttrVal($name, "pollnologging", undef) == "1") {
|
||||||
$logstr = "Log of Polling Camera $camname is deactivated now";
|
$logstr = "Log of Polling Camera $camname is currently deactivated";
|
||||||
&printlog($hash,$logstr,"2");
|
&printlog($hash,$logstr,"2");
|
||||||
# in $hash eintragen für späteren Vergleich (Changes von pollnologging)
|
# in $hash eintragen für späteren Vergleich (Changes von pollnologging)
|
||||||
$hash->{HELPER}{OLDVALPOLLNOLOGGING} = AttrVal($name, "pollnologging", undef);
|
$hash->{HELPER}{OLDVALPOLLNOLOGGING} = AttrVal($name, "pollnologging", undef);
|
||||||
} else {
|
} else {
|
||||||
$logstr = "Log of Polling Camera $camname is activated now";
|
$logstr = "Log of Polling Camera $camname is currently activated";
|
||||||
&printlog($hash,$logstr,"2");
|
&printlog($hash,$logstr,"2");
|
||||||
# in $hash eintragen für späteren Vergleich (Changes von pollnologging)
|
# in $hash eintragen für späteren Vergleich (Changes von pollnologging)
|
||||||
$hash->{HELPER}{OLDVALPOLLNOLOGGING} = AttrVal($name, "pollnologging", undef);
|
$hash->{HELPER}{OLDVALPOLLNOLOGGING} = AttrVal($name, "pollnologging", undef);
|
||||||
@ -301,7 +305,7 @@ sub watchdogpollcaminfo ($) {
|
|||||||
} else {
|
} else {
|
||||||
# alter Wert von "pollnologging" war 1 -> Logging war deaktiviert
|
# alter Wert von "pollnologging" war 1 -> Logging war deaktiviert
|
||||||
if ($hash->{HELPER}{OLDVALPOLLNOLOGGING} == "1") {
|
if ($hash->{HELPER}{OLDVALPOLLNOLOGGING} == "1") {
|
||||||
$logstr = "Log of Polling Camera $camname is activated now";
|
$logstr = "Log of Polling Camera $camname is currently activated";
|
||||||
&printlog($hash,$logstr,"2");
|
&printlog($hash,$logstr,"2");
|
||||||
# in $hash eintragen für späteren Vergleich (Changes von pollnologging)
|
# in $hash eintragen für späteren Vergleich (Changes von pollnologging)
|
||||||
$hash->{HELPER}{OLDVALPOLLNOLOGGING} = "0";
|
$hash->{HELPER}{OLDVALPOLLNOLOGGING} = "0";
|
||||||
@ -680,7 +684,7 @@ sub getptzlistpatrol ($) {
|
|||||||
|
|
||||||
sub getapisites_nonbl {
|
sub getapisites_nonbl {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
my $servername = $hash->{SERVERNAME};
|
my $serveraddr = $hash->{SERVERADDR};
|
||||||
my $serverport = $hash->{SERVERPORT};
|
my $serverport = $hash->{SERVERPORT};
|
||||||
my $apiinfo = $hash->{HELPER}{APIINFO}; # Info-Seite für alle API's, einzige statische Seite !
|
my $apiinfo = $hash->{HELPER}{APIINFO}; # Info-Seite für alle API's, einzige statische Seite !
|
||||||
my $apiauth = $hash->{HELPER}{APIAUTH}; # benötigte API-Pfade für Funktionen,
|
my $apiauth = $hash->{HELPER}{APIAUTH}; # benötigte API-Pfade für Funktionen,
|
||||||
@ -698,7 +702,7 @@ sub getapisites_nonbl {
|
|||||||
&printlog($hash,$logstr,"4");
|
&printlog($hash,$logstr,"4");
|
||||||
|
|
||||||
# URL zur Abfrage der Eigenschaften der API's
|
# URL zur Abfrage der Eigenschaften der API's
|
||||||
$url = "http://$servername:$serverport/webapi/query.cgi?api=$apiinfo&method=Query&version=1&query=$apiauth,$apiextrec,$apicam,$apitakesnap,$apiptz";
|
$url = "http://$serveraddr:$serverport/webapi/query.cgi?api=$apiinfo&method=Query&version=1&query=$apiauth,$apiextrec,$apicam,$apitakesnap,$apiptz";
|
||||||
|
|
||||||
$param = {
|
$param = {
|
||||||
url => $url,
|
url => $url,
|
||||||
@ -722,9 +726,9 @@ sub login_nonbl ($) {
|
|||||||
my ($param, $err, $myjson) = @_;
|
my ($param, $err, $myjson) = @_;
|
||||||
my $hash = $param->{hash};
|
my $hash = $param->{hash};
|
||||||
my $device = $hash->{NAME};
|
my $device = $hash->{NAME};
|
||||||
my $servername = $hash->{SERVERNAME};
|
my $serveraddr = $hash->{SERVERADDR};
|
||||||
my $serverport = $hash->{SERVERPORT};
|
my $serverport = $hash->{SERVERPORT};
|
||||||
my $username = $hash->{USERNAME};
|
my $username = $hash->{HELPER}{USERNAME};
|
||||||
my $password = $hash->{HELPER}{PASSWORD};
|
my $password = $hash->{HELPER}{PASSWORD};
|
||||||
my $apiauth = $hash->{HELPER}{APIAUTH};
|
my $apiauth = $hash->{HELPER}{APIAUTH};
|
||||||
my $apiextrec = $hash->{HELPER}{APIEXTREC};
|
my $apiextrec = $hash->{HELPER}{APIEXTREC};
|
||||||
@ -900,7 +904,7 @@ sub login_nonbl ($) {
|
|||||||
$logstr = "--- Begin Function serverlogin nonblocking ---";
|
$logstr = "--- Begin Function serverlogin nonblocking ---";
|
||||||
&printlog($hash,$logstr,"4");
|
&printlog($hash,$logstr,"4");
|
||||||
|
|
||||||
$url = "http://$servername:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthmaxver&method=Login&account=$username&passwd=$password&format=\"sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthmaxver&method=Login&account=$username&passwd=$password&format=\"sid\"";
|
||||||
|
|
||||||
$param = {
|
$param = {
|
||||||
url => $url,
|
url => $url,
|
||||||
@ -925,9 +929,9 @@ sub getcamid_nonbl ($) {
|
|||||||
|
|
||||||
my ($param, $err, $myjson) = @_;
|
my ($param, $err, $myjson) = @_;
|
||||||
my $hash = $param->{hash};
|
my $hash = $param->{hash};
|
||||||
my $servername = $hash->{SERVERNAME};
|
my $serveraddr = $hash->{SERVERADDR};
|
||||||
my $serverport = $hash->{SERVERPORT};
|
my $serverport = $hash->{SERVERPORT};
|
||||||
my $username = $hash->{USERNAME};
|
my $username = $hash->{HELPER}{USERNAME};
|
||||||
my $apicam = $hash->{HELPER}{APICAM};
|
my $apicam = $hash->{HELPER}{APICAM};
|
||||||
my $apicampath = $hash->{HELPER}{APICAMPATH};
|
my $apicampath = $hash->{HELPER}{APICAMPATH};
|
||||||
my $apicammaxver = $hash->{HELPER}{APICAMMAXVER};
|
my $apicammaxver = $hash->{HELPER}{APICAMMAXVER};
|
||||||
@ -1030,7 +1034,7 @@ sub getcamid_nonbl ($) {
|
|||||||
&printlog($hash,$logstr,"4");
|
&printlog($hash,$logstr,"4");
|
||||||
|
|
||||||
# einlesen aller Kameras - Auswertung in Rückkehrfunktion "camop_nonbl"
|
# einlesen aller Kameras - Auswertung in Rückkehrfunktion "camop_nonbl"
|
||||||
$url = "http://$servername:$serverport/webapi/$apicampath?api=$apicam&version=$apicammaxver&method=List&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apicampath?api=$apicam&version=$apicammaxver&method=List&_sid=\"$sid\"";
|
||||||
|
|
||||||
$param = {
|
$param = {
|
||||||
url => $url,
|
url => $url,
|
||||||
@ -1054,10 +1058,10 @@ sub getcamid_nonbl ($) {
|
|||||||
sub camop_nonbl ($) {
|
sub camop_nonbl ($) {
|
||||||
my ($param, $err, $myjson) = @_;
|
my ($param, $err, $myjson) = @_;
|
||||||
my $hash = $param->{hash};
|
my $hash = $param->{hash};
|
||||||
my $servername = $hash->{SERVERNAME};
|
my $serveraddr = $hash->{SERVERADDR};
|
||||||
my $serverport = $hash->{SERVERPORT};
|
my $serverport = $hash->{SERVERPORT};
|
||||||
my $camname = $hash->{CAMNAME};
|
my $camname = $hash->{CAMNAME};
|
||||||
my $username = $hash->{USERNAME};
|
my $username = $hash->{HELPER}{USERNAME};
|
||||||
my $apicam = $hash->{HELPER}{APICAM};
|
my $apicam = $hash->{HELPER}{APICAM};
|
||||||
my $apicampath = $hash->{HELPER}{APICAMPATH};
|
my $apicampath = $hash->{HELPER}{APICAMPATH};
|
||||||
my $apicammaxver = $hash->{HELPER}{APICAMMAXVER};
|
my $apicammaxver = $hash->{HELPER}{APICAMMAXVER};
|
||||||
@ -1202,49 +1206,49 @@ sub camop_nonbl ($) {
|
|||||||
if ($OpMode eq "Start")
|
if ($OpMode eq "Start")
|
||||||
{
|
{
|
||||||
# die Aufnahme wird gestartet, Rückkehr wird mit "camret_nonbl" verarbeitet
|
# die Aufnahme wird gestartet, Rückkehr wird mit "camret_nonbl" verarbeitet
|
||||||
$url = "http://$servername:$serverport/webapi/$apiextrecpath?api=$apiextrec&method=Record&version=$apiextrecmaxver&cameraId=$camid&action=start&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apiextrecpath?api=$apiextrec&method=Record&version=$apiextrecmaxver&cameraId=$camid&action=start&_sid=\"$sid\"";
|
||||||
}
|
}
|
||||||
elsif ($OpMode eq "Stop")
|
elsif ($OpMode eq "Stop")
|
||||||
{
|
{
|
||||||
# die Aufnahme wird gestoppt, Rückkehr wird mit "camret_nonbl" verarbeitet
|
# die Aufnahme wird gestoppt, Rückkehr wird mit "camret_nonbl" verarbeitet
|
||||||
$url = "http://$servername:$serverport/webapi/$apiextrecpath?api=$apiextrec&method=Record&version=$apiextrecmaxver&cameraId=$camid&action=stop&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apiextrecpath?api=$apiextrec&method=Record&version=$apiextrecmaxver&cameraId=$camid&action=stop&_sid=\"$sid\"";
|
||||||
}
|
}
|
||||||
elsif ($OpMode eq "Snap")
|
elsif ($OpMode eq "Snap")
|
||||||
{
|
{
|
||||||
# ein Schnappschuß wird ausgelöst und in SS gespeichert, Rückkehr wird mit "camret_nonbl" verarbeitet
|
# ein Schnappschuß wird ausgelöst und in SS gespeichert, Rückkehr wird mit "camret_nonbl" verarbeitet
|
||||||
$url = "http://$servername:$serverport/webapi/$apitakesnappath?api=\"$apitakesnap\"&dsId=0&method=\"TakeSnapshot\"&version=\"$apitakesnapmaxver\"&camId=$camid&blSave=true&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apitakesnappath?api=\"$apitakesnap\"&dsId=0&method=\"TakeSnapshot\"&version=\"$apitakesnapmaxver\"&camId=$camid&blSave=true&_sid=\"$sid\"";
|
||||||
$hash->{STATE} = "snap";
|
$hash->{STATE} = "snap";
|
||||||
readingsSingleUpdate($hash, "LastSnapId", "", 1);
|
readingsSingleUpdate($hash, "LastSnapId", "", 1);
|
||||||
}
|
}
|
||||||
elsif ($OpMode eq "Enable")
|
elsif ($OpMode eq "Enable")
|
||||||
{
|
{
|
||||||
# eine Kamera wird aktiviert, Rückkehr wird mit "camret_nonbl" verarbeitet
|
# eine Kamera wird aktiviert, Rückkehr wird mit "camret_nonbl" verarbeitet
|
||||||
$url = "http://$servername:$serverport/webapi/$apicampath?api=$apicam&version=$apicammaxver&method=Enable&cameraIds=$camid&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apicampath?api=$apicam&version=$apicammaxver&method=Enable&cameraIds=$camid&_sid=\"$sid\"";
|
||||||
}
|
}
|
||||||
elsif ($OpMode eq "Disable")
|
elsif ($OpMode eq "Disable")
|
||||||
{
|
{
|
||||||
# eine Kamera wird aktiviert, Rückkehr wird mit "camret_nonbl" verarbeitet
|
# eine Kamera wird aktiviert, Rückkehr wird mit "camret_nonbl" verarbeitet
|
||||||
$url = "http://$servername:$serverport/webapi/$apicampath?api=$apicam&version=$apicammaxver&method=Disable&cameraIds=$camid&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apicampath?api=$apicam&version=$apicammaxver&method=Disable&cameraIds=$camid&_sid=\"$sid\"";
|
||||||
}
|
}
|
||||||
elsif ($OpMode eq "Getcaminfo")
|
elsif ($OpMode eq "Getcaminfo")
|
||||||
{
|
{
|
||||||
# Infos einer Kamera werden abgerufen, Rückkehr wird mit "camret_nonbl" verarbeitet
|
# Infos einer Kamera werden abgerufen, Rückkehr wird mit "camret_nonbl" verarbeitet
|
||||||
$url = "http://$servername:$serverport/webapi/$apicampath?api=\"$apicam\"&version=\"$apicammaxver\"&method=\"GetInfo\"&cameraIds=\"$camid\"&deviceOutCap=true&streamInfo=true&ptz=true&basic=true&camAppInfo=true&optimize=true&fisheye=true&eventDetection=true&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apicampath?api=\"$apicam\"&version=\"$apicammaxver\"&method=\"GetInfo\"&cameraIds=\"$camid\"&deviceOutCap=true&streamInfo=true&ptz=true&basic=true&camAppInfo=true&optimize=true&fisheye=true&eventDetection=true&_sid=\"$sid\"";
|
||||||
}
|
}
|
||||||
elsif ($OpMode eq "Getptzlistpreset")
|
elsif ($OpMode eq "Getptzlistpreset")
|
||||||
{
|
{
|
||||||
# PTZ-ListPresets werden abgerufen, Rückkehr wird mit "camret_nonbl" verarbeitet
|
# PTZ-ListPresets werden abgerufen, Rückkehr wird mit "camret_nonbl" verarbeitet
|
||||||
$url = "http://$servername:$serverport/webapi/$apiptzpath?api=$apiptz&version=$apiptzmaxver&method=ListPreset&cameraId=$camid&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apiptzpath?api=$apiptz&version=$apiptzmaxver&method=ListPreset&cameraId=$camid&_sid=\"$sid\"";
|
||||||
}
|
}
|
||||||
elsif ($OpMode eq "Getcapabilities")
|
elsif ($OpMode eq "Getcapabilities")
|
||||||
{
|
{
|
||||||
# Capabilities einer Cam werden abgerufen, Rückkehr wird mit "camret_nonbl" verarbeitet
|
# Capabilities einer Cam werden abgerufen, Rückkehr wird mit "camret_nonbl" verarbeitet
|
||||||
$url = "http://$servername:$serverport/webapi/$apicampath?api=$apicam&version=$apicammaxver&method=GetCapabilityByCamId&cameraId=$camid&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apicampath?api=$apicam&version=$apicammaxver&method=GetCapabilityByCamId&cameraId=$camid&_sid=\"$sid\"";
|
||||||
}
|
}
|
||||||
elsif ($OpMode eq "Getptzlistpatrol")
|
elsif ($OpMode eq "Getptzlistpatrol")
|
||||||
{
|
{
|
||||||
# PTZ-ListPatrol werden abgerufen, Rückkehr wird mit "camret_nonbl" verarbeitet
|
# PTZ-ListPatrol werden abgerufen, Rückkehr wird mit "camret_nonbl" verarbeitet
|
||||||
$url = "http://$servername:$serverport/webapi/$apiptzpath?api=$apiptz&version=$apiptzmaxver&method=ListPatrol&cameraId=$camid&_sid=\"$sid\"";
|
$url = "http://$serveraddr:$serverport/webapi/$apiptzpath?api=$apiptz&version=$apiptzmaxver&method=ListPatrol&cameraId=$camid&_sid=\"$sid\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1272,10 +1276,10 @@ sub camret_nonbl ($) {
|
|||||||
my ($param, $err, $myjson) = @_;
|
my ($param, $err, $myjson) = @_;
|
||||||
my $hash = $param->{hash};
|
my $hash = $param->{hash};
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $servername = $hash->{SERVERNAME};
|
my $serveraddr = $hash->{SERVERADDR};
|
||||||
my $serverport = $hash->{SERVERPORT};
|
my $serverport = $hash->{SERVERPORT};
|
||||||
my $camname = $hash->{CAMNAME};
|
my $camname = $hash->{CAMNAME};
|
||||||
my $rectime = AttrVal($name, "rectime",undef) ? AttrVal($name, "rectime",undef) : $hash->{RECTIME};
|
my $rectime = AttrVal($name, "rectime",undef) ? AttrVal($name, "rectime",undef) : $hash->{HELPER}{RECTIME};
|
||||||
my $apiauth = $hash->{HELPER}{APIAUTH};
|
my $apiauth = $hash->{HELPER}{APIAUTH};
|
||||||
my $apiauthpath = $hash->{HELPER}{APIAUTHPATH};
|
my $apiauthpath = $hash->{HELPER}{APIAUTHPATH};
|
||||||
my $apiauthmaxver = $hash->{HELPER}{APIAUTHMAXVER};
|
my $apiauthmaxver = $hash->{HELPER}{APIAUTHMAXVER};
|
||||||
@ -1738,7 +1742,7 @@ sub camret_nonbl ($) {
|
|||||||
$logstr = "--- Begin Function logout nonblocking ---";
|
$logstr = "--- Begin Function logout nonblocking ---";
|
||||||
&printlog($hash,$logstr,"4");
|
&printlog($hash,$logstr,"4");
|
||||||
|
|
||||||
$url = "http://$servername:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthmaxver&method=Logout&_sid=$sid";
|
$url = "http://$serveraddr:$serverport/webapi/$apiauthpath?api=$apiauth&version=$apiauthmaxver&method=Logout&_sid=$sid";
|
||||||
|
|
||||||
$param = {
|
$param = {
|
||||||
url => $url,
|
url => $url,
|
||||||
@ -1761,7 +1765,7 @@ sub camret_nonbl ($) {
|
|||||||
sub logout_nonbl ($) {
|
sub logout_nonbl ($) {
|
||||||
my ($param, $err, $myjson) = @_;
|
my ($param, $err, $myjson) = @_;
|
||||||
my $hash = $param->{hash};
|
my $hash = $param->{hash};
|
||||||
my $username = $hash->{USERNAME};
|
my $username = $hash->{HELPER}{USERNAME};
|
||||||
my $sid = $hash->{HELPER}{SID};
|
my $sid = $hash->{HELPER}{SID};
|
||||||
my $data;
|
my $data;
|
||||||
my $logstr;
|
my $logstr;
|
||||||
|
Loading…
Reference in New Issue
Block a user