diff --git a/sonoff/xnrg_08_sdm120.ino b/sonoff/xnrg_08_sdm120.ino index 9b1cf6cbc..0cfe9a4b2 100644 --- a/sonoff/xnrg_08_sdm120.ino +++ b/sonoff/xnrg_08_sdm120.ino @@ -80,7 +80,7 @@ void SDM120Every250ms(void) uint8_t buffer[14]; // At least 5 + (2 * 2) = 9 uint32_t error = Sdm120Modbus->ReceiveBuffer(buffer, 2); - AddLogBuffer(LOG_LEVEL_DEBUG_MORE, buffer, sizeof(buffer)); + AddLogBuffer(LOG_LEVEL_DEBUG_MORE, buffer, Sdm120Modbus->ReceiveCount()); if (error) { AddLog_P2(LOG_LEVEL_DEBUG, PSTR("SDM: SDM120 error %d"), error); diff --git a/sonoff/xnrg_09_dds2382.ino b/sonoff/xnrg_09_dds2382.ino index c2ae02746..b6e5a7e5c 100644 --- a/sonoff/xnrg_09_dds2382.ino +++ b/sonoff/xnrg_09_dds2382.ino @@ -47,7 +47,7 @@ void Dds2382EverySecond(void) uint8_t buffer[46]; // At least 5 + (2 * 18) = 41 uint32_t error = Dds2382Modbus->ReceiveBuffer(buffer, 18); - AddLogBuffer(LOG_LEVEL_DEBUG_MORE, buffer, (buffer[2]) ? buffer[2] +5 : sizeof(buffer)); + AddLogBuffer(LOG_LEVEL_DEBUG_MORE, buffer, Dds2382Modbus->ReceiveCount()); if (error) { AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_DEBUG "DDS2382 response error %d"), error); diff --git a/sonoff/xnrg_10_sdm630.ino b/sonoff/xnrg_10_sdm630.ino index 0478e8037..140226589 100644 --- a/sonoff/xnrg_10_sdm630.ino +++ b/sonoff/xnrg_10_sdm630.ino @@ -73,7 +73,7 @@ void SDM630Every250ms(void) uint8_t buffer[14]; // At least 5 + (2 * 2) = 9 uint32_t error = Sdm630Modbus->ReceiveBuffer(buffer, 2); - AddLogBuffer(LOG_LEVEL_DEBUG_MORE, buffer, sizeof(buffer)); + AddLogBuffer(LOG_LEVEL_DEBUG_MORE, buffer, Sdm630Modbus->ReceiveCount()); if (error) { AddLog_P2(LOG_LEVEL_DEBUG, PSTR("SDM: SDM630 error %d"), error);