mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 08:11:44 +00:00
00_MQTT2_CLIENT.pm: Initialize buffer after disconnect (Forum #91304)
git-svn-id: https://svn.fhem.de/fhem/trunk@22339 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
5f9473e5c3
commit
4b773202dc
@ -86,6 +86,7 @@ MQTT2_CLIENT_connect($)
|
||||
my $disco = (ReadingsVal($hash->{NAME}, "state", "") eq "disconnected");
|
||||
$hash->{connecting} = 1 if($disco && !$hash->{connecting});
|
||||
$hash->{nextOpenDelay} = 5;
|
||||
$hash->{BUF}="";
|
||||
return DevIo_OpenDev($hash, $disco, "MQTT2_CLIENT_doinit", sub(){})
|
||||
if($hash->{connecting});
|
||||
}
|
||||
@ -206,6 +207,7 @@ MQTT2_CLIENT_Disco($;$)
|
||||
if($ond && $ond =~ m/^(-r\s)?([^\s]*)\s*(.*)$/);
|
||||
MQTT2_CLIENT_send($hash, pack("C",0xE0).pack("C",0), 1); # DISCONNECT
|
||||
$isUndef ? DevIo_CloseDev($hash) : DevIo_Disconnected($hash);
|
||||
delete($hash->{BUF});
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user