mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-02 00:48:53 +00:00
00_MQTT2_CLIENT.pm: nextOpenDelay Attribut (Forum #111959)
git-svn-id: https://svn.fhem.de/fhem/trunk@27435 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
3f655a0fe9
commit
ee5fcadb4b
@ -54,6 +54,7 @@ MQTT2_CLIENT_Initialize($)
|
|||||||
msgAfterConnect
|
msgAfterConnect
|
||||||
msgBeforeDisconnect
|
msgBeforeDisconnect
|
||||||
mqttVersion:3.1.1,3.1
|
mqttVersion:3.1.1,3.1
|
||||||
|
nextOpenDelay
|
||||||
privacy:0,1
|
privacy:0,1
|
||||||
qosMaxQueueLength
|
qosMaxQueueLength
|
||||||
rawEvents
|
rawEvents
|
||||||
@ -118,21 +119,21 @@ MQTT2_CLIENT_connect($;$)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $cfn = AttrVal($hash->{NAME}, "connectFn", undef); # for AWS-IOT / auth
|
my $cfn = AttrVal($me, "connectFn", undef); # for AWS-IOT / auth
|
||||||
if($cfn) {
|
if($cfn) {
|
||||||
if($calledFromConnectFn) {
|
if($calledFromConnectFn) {
|
||||||
delete($hash->{inConnectFn});
|
delete($hash->{inConnectFn});
|
||||||
} else {
|
} else {
|
||||||
return if($hash->{inConnectFn}); # called by readyFn
|
return if($hash->{inConnectFn}); # called by readyFn
|
||||||
$hash->{inConnectFn} = 1;
|
$hash->{inConnectFn} = 1;
|
||||||
$cfn = EvalSpecials($cfn, ("%NAME" => $hash->{NAME}));
|
$cfn = EvalSpecials($cfn, ("%NAME" => $me));
|
||||||
return AnalyzeCommand(undef, $cfn);
|
return AnalyzeCommand(undef, $cfn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $disco = (DevIo_getState($hash) eq "disconnected");
|
my $disco = (DevIo_getState($hash) eq "disconnected");
|
||||||
$hash->{connecting} = 1 if($disco && !$hash->{connecting});
|
$hash->{connecting} = 1 if($disco && !$hash->{connecting});
|
||||||
$hash->{nextOpenDelay} = 10;
|
$hash->{nextOpenDelay} = AttrVal($me, "nextOpenDelay", 10);
|
||||||
$hash->{BUF}="";
|
$hash->{BUF}="";
|
||||||
if($hash->{DeviceName} =~ m/^wss?:/) {
|
if($hash->{DeviceName} =~ m/^wss?:/) {
|
||||||
$hash->{binary} = 1;
|
$hash->{binary} = 1;
|
||||||
@ -985,6 +986,14 @@ MQTT2_CLIENT_feedTheList($$$;$)
|
|||||||
set the MQTT protocol version in the CONNECT header, default is 3.1
|
set the MQTT protocol version in the CONNECT header, default is 3.1
|
||||||
</li></br>
|
</li></br>
|
||||||
|
|
||||||
|
<a id="MQTT2_CLIENT-attr-nextOpenDelay"></a>
|
||||||
|
<li>nextOpenDelay <sec><br>
|
||||||
|
if the server is unavailable or after it terminates the connection,
|
||||||
|
MQTT2_CLIENT tries to reconnect every "nextOpenDelay" seconds. The
|
||||||
|
default is 10, but this is too short in some cases, especially if a
|
||||||
|
failed reconnect is problematic (see maxFailedConnects).
|
||||||
|
</li></br>
|
||||||
|
|
||||||
<a id="MQTT2_CLIENT-attr-msgAfterConnect"></a>
|
<a id="MQTT2_CLIENT-attr-msgAfterConnect"></a>
|
||||||
<li>msgAfterConnect [-r] topic message<br>
|
<li>msgAfterConnect [-r] topic message<br>
|
||||||
publish the topic after each connect or reconnect.<br>
|
publish the topic after each connect or reconnect.<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user