Skip to content

Commit 7a2decb

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

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
@@ -394,7 +396,9 @@ static int fineoffset_WH0290_callback(r_device *decoder, bitbuffer_t *bitbuffer)
394396
/* clang-format off */
395397
data = data_make(
396398
"model", "", DATA_STRING, _X("Fineoffset-WH0290","Fine Offset Electronics, WH0290"),
399+
"family", "FAMILY", DATA_INT, family,
397400
"id", "ID", DATA_INT, id,
401+
"unknown1", "UNKNOWN1", DATA_INT, unknown1,
398402
"battery_ok", "Battery Level", DATA_FORMAT, "%.1f", DATA_DOUBLE, battery_ok,
399403
"pm2_5_ug_m3", "2.5um Fine Particulate Matter", DATA_FORMAT, "%i ug/m3", DATA_INT, pm25/10,
400404
"pm10_0_ug_m3", "10um Coarse Particulate Matter", DATA_FORMAT, "%i ug/m3", DATA_INT, pm100/10,

0 commit comments

Comments
 (0)