[dsmr] Fix payload length calculation for Smarty meters (#11328)
Fixes #10932 Supersedes #10933 and adds a unit test. Also-by: Alexander Hotz <alex.hotz@gmail.com> Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
This commit is contained in:
committed by
GitHub
parent
46e1b675cb
commit
1b80f1d492
@@ -79,7 +79,7 @@ public class SmartyDecrypter implements TelegramParser {
|
||||
private int ivLength;
|
||||
private int dataLength;
|
||||
private boolean lenientMode;
|
||||
private P1TelegramListener telegramListener;
|
||||
private final P1TelegramListener telegramListener;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -140,7 +140,7 @@ public class SmartyDecrypter implements TelegramParser {
|
||||
break;
|
||||
case READ_PAYLOAD_LENGTH:
|
||||
dataLength <<= 8;
|
||||
dataLength |= rawInput;
|
||||
dataLength |= rawInput & 0xFF;
|
||||
if (currentBytePosition >= changeToNextStateAt) {
|
||||
state = State.READ_SEPARATOR_30;
|
||||
changeToNextStateAt++;
|
||||
|
||||
Reference in New Issue
Block a user