Skip to content

Commit

Permalink
Update WeatherSensor.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Jun 24, 2023
1 parent dce1c46 commit 9b5bc1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/WeatherSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,12 +1001,12 @@ DecodeStatus WeatherSensor::decodeBresserLightningPayload(uint8_t *msg, uint8_t
return status;

uint8_t ctr = (msgw[4] << 4) | (msgw[5] & 0xf0) >> 4;
log_v("--> CTR RAW: %d BCD: %d", ctr, (((msgw[4] & 0xf0) >> 4) * 100 + (msgw[4] & 0x0f) * 10 + (msgw[5] & 0xf0) >> 4));
log_v("--> CTR RAW: %d BCD: %d", ctr, ((((msgw[4] & 0xf0) >> 4) * 100) + (msgw[4] & 0x0f) * 10 + ((msgw[5] & 0xf0) >> 4)));
uint8_t battery_low = (msgw[5] & 0x08) == 0x00;
uint16_t unknown1 = ((msgw[5] & 0x0f) << 8) | msgw[6];
uint8_t type = msgw[6] >> 4;
uint8_t distance_km = msgw[7];
log_v("--> DST RAW: %d BCD: %d TAB: %d", msgw[7], (((msgw[7] & 0xf0) >> 4) * 10 + msgw[7] & 0x0f), distance_map[ msgw[7] ]);
log_v("--> DST RAW: %d BCD: %d TAB: %d", msgw[7], ((((msgw[7] & 0xf0) >> 4) * 10) + (msgw[7] & 0x0f)), distance_map[ msgw[7] ]);
uint16_t unknown2 = (msgw[8] << 8) | msgw[9];

sensor[slot].sensor_id = id_tmp;
Expand Down

0 comments on commit 9b5bc1b

Please sign in to comment.