Change modbus rx message length check

Start evaluating messages already after message length information byte is received. Necessary to support read coil status messages.
This commit is contained in:
barkow 2022-10-27 21:46:07 +02:00 committed by GitHub
parent 32fbb03471
commit 3cccdd9c4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1683,7 +1683,7 @@ void sml_shift_in(uint32_t meters,uint32_t shard) {
meter_spos[meters] = 0;
}
// modbus
if (meter_spos[meters] >= 8) {
if (meter_spos[meters] >= 3) {
uint32_t mlen = smltbuf[meters][2] + 5;
if (mlen > SML_BSIZ) mlen = SML_BSIZ;
if (meter_spos[meters] >= mlen) {