Skip to content

Commit

Permalink
Replaced duplicate code by log_message()
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Jul 10, 2023
1 parent e9748ae commit d48ca60
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions src/WeatherSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,19 +865,7 @@ DecodeStatus WeatherSensor::decodeBresser7In1Payload(uint8_t *msg, uint8_t msgSi
}

#if CORE_DEBUG_LEVEL == ARDUHAL_LOG_LEVEL_VERBOSE
char buf[128];
*buf = '\0';
// Print byte index
for (size_t i = 0 ; i < msgSize; i++) {
sprintf(&buf[strlen(buf)], "%02d ", i);
}
log_v(" Byte #: %s", buf);

*buf = '\0';
for (size_t i = 0 ; i < msgSize; i++) {
sprintf(&buf[strlen(buf)], "%02X ", msgw[i]);
}
log_v("De-whitened Data: %s", buf);
log_message("De-whitened Data", msgw, msgSize);
#endif

int id_tmp = (msgw[2] << 8) | (msgw[3]);
Expand Down Expand Up @@ -1020,19 +1008,7 @@ DecodeStatus WeatherSensor::decodeBresserLightningPayload(uint8_t *msg, uint8_t
}

#if CORE_DEBUG_LEVEL == ARDUHAL_LOG_LEVEL_VERBOSE
char buf[128];
*buf = '\0';
// Print byte index
for (size_t i = 0 ; i < msgSize; i++) {
sprintf(&buf[strlen(buf)], "%02d ", i);
}
log_v(" Byte #: %s", buf);

*buf = '\0';
for (size_t i = 0 ; i < msgSize; i++) {
sprintf(&buf[strlen(buf)], "%02X ", msgw[i]);
}
log_v("De-whitened Data: %s", buf);
log_message("De-whitened Data", msgw, msgSize);
#endif

int id_tmp = (msgw[2] << 8) | (msgw[3]);
Expand Down

0 comments on commit d48ca60

Please sign in to comment.