Skip to content

Commit a5f826f

Browse files
committed
fineoffset: Decode family and unknown bit in WH0290
1 parent 50de2c7 commit a5f826f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/devices/fineoffset.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,9 @@ static int fineoffset_WH0290_callback(r_device *decoder, bitbuffer_t *bitbuffer)
385385
}
386386

387387
// Decode data
388+
uint8_t family = b[0];
388389
uint8_t id = b[1];
390+
uint8_t unknown1 = (b[2] & 0x80) ? 1 : 0;
389391
int pm25 = (b[2] & 0x3f) << 8 | b[3];
390392
int pm100 = (b[4] & 0x3f) << 8 | b[5];
391393
int battery_bars = (b[2] & 0x40) >> 4 | (b[4] & 0xC0) >> 6; //out of 5
@@ -398,6 +400,8 @@ static int fineoffset_WH0290_callback(r_device *decoder, bitbuffer_t *bitbuffer)
398400
"battery_ok", "Battery Level", DATA_FORMAT, "%.1f", DATA_DOUBLE, battery_ok,
399401
"pm2_5_ug_m3", "2.5um Fine Particulate Matter", DATA_FORMAT, "%i ug/m3", DATA_INT, pm25/10,
400402
"pm10_0_ug_m3", "10um Coarse Particulate Matter", DATA_FORMAT, "%i ug/m3", DATA_INT, pm100/10,
403+
"family", "FAMILY", DATA_INT, family,
404+
"unknown1", "UNKNOWN1", DATA_INT, unknown1,
401405
"mic", "Integrity", DATA_STRING, "CRC",
402406
NULL);
403407
/* clang-format on */

0 commit comments

Comments
 (0)