00_HMUARTLGW.pm: check if LastSendLen is defined before using it

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@14899 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mgernoth 2017-08-14 16:49:04 +00:00
parent d543ddd08d
commit efd162d90a

View File

@ -1459,7 +1459,8 @@ sub HMUARTLGW_Read($)
my $crc = HMUARTLGW_crc16(chr(0xfd).$unescaped); my $crc = HMUARTLGW_crc16(chr(0xfd).$unescaped);
if ($crc != 0x0000 && if ($crc != 0x0000 &&
$hash->{DevState} != HMUARTLGW_STATE_RUNNING) { $hash->{DevState} != HMUARTLGW_STATE_RUNNING &&
defined($hash->{Helper}{LastSendLen})) {
#When writing to the device while it prepares to write a frame to #When writing to the device while it prepares to write a frame to
#the host, the device seems to initialize the crc with 0x827f or #the host, the device seems to initialize the crc with 0x827f or
#0x8281 plus the length of the frame being received (firmware bug). #0x8281 plus the length of the frame being received (firmware bug).