Skip to content

Commit

Permalink
minor: Fix log levels in DeltaDore-X3D
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Dec 18, 2024
1 parent 14e6d21 commit e454605
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/devices/deltadore_x3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,7 @@ static int deltadore_x3d_decode(r_device *decoder, bitbuffer_t *bitbuffer)
ccitt_whitening(&len, 1);

if (len > DELTADORE_X3D_MAX_PKT_LEN) {
if (decoder->verbose) {
decoder_logf(decoder, 0, __func__, "packet too large (%u bytes), dropping it\n", len);
}
decoder_logf(decoder, 1, __func__, "packet too large (%u bytes), dropping it\n", len);
return DECODE_ABORT_LENGTH;
}

Expand All @@ -299,17 +297,13 @@ static int deltadore_x3d_decode(r_device *decoder, bitbuffer_t *bitbuffer)
// dewhite the data
ccitt_whitening(frame, len);

if (decoder->verbose > 1) {
decoder_log_bitrow(decoder, 0, __func__, frame, len * 8, "frame data");
}
decoder_log_bitrow(decoder, 2, __func__, frame, len * 8, "frame data");

const uint16_t crc = crc16(frame, len - 2, 0x1021, 0x0000);
const uint16_t actual_crc = (frame[len - 2] << 8 | frame[len - 1]);

if (actual_crc != crc) {
if (decoder->verbose) {
decoder_logf(decoder, 0, __func__, "CRC invalid %04x != %04x\n", actual_crc, crc);
}
decoder_logf(decoder, 1, __func__, "CRC invalid %04x != %04x\n", actual_crc, crc);
return DECODE_FAIL_MIC;
}

Expand Down

0 comments on commit e454605

Please sign in to comment.