|
@@ -59,6 +59,23 @@
|
|
|
hc, cc = house code and channel code
|
|
|
rh, t = relative humidity, temperature
|
|
|
p = parity bit 1111111111111110
|
|
|
+
|
|
|
+
|
|
|
+ This interpretation is from: https://github.com/merbanan/rtl_433/blob/master/src/devices/wt450.c
|
|
|
+
|
|
|
+ 1100 0001 | 0011 0011 | 1000 0011 | 1011 0011 | 0001
|
|
|
+ xxxx ssss | ccxx bhhh | hhhh tttt | tttt tttt | sseo
|
|
|
+
|
|
|
+ - x: constant
|
|
|
+ - s: House code
|
|
|
+ - c: Channel
|
|
|
+ - b: battery low indicator (0=>OK, 1=>LOW)
|
|
|
+ - h: Humidity
|
|
|
+ - t: Temperature, 12 bit, offset 50, scale 16
|
|
|
+ - s: sequence number of message repeat
|
|
|
+ - e: parity of all even bits
|
|
|
+ - o: parity of all odd bits
|
|
|
+
|
|
|
**********************************************************************************
|
|
|
*/
|
|
|
|
|
@@ -208,6 +225,7 @@ RES: 0000 0001 00 110 0000000 000000000000000 0 = 00000001001100000000000000
|
|
|
}
|
|
|
// A correct code has been received
|
|
|
//printf("Code received: %llu on row:%d\n",(code&0xFFFFFFFF),row_no);
|
|
|
+ temp3_x_data &= 0xFFFFFFF0; // Remove sequence and parity bits in lowest nibble
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
@@ -234,15 +252,28 @@ static int temp3decode (unsigned int inWidth) {
|
|
|
|
|
|
int64_t nextPulseESICSensor(uint32_t width) {
|
|
|
|
|
|
- volatile static int result;
|
|
|
+ static int64_t previous_data = 0;
|
|
|
+ static uint32_t old_time=0;
|
|
|
+ static uint32_t now;
|
|
|
+ int64_t retVal = -1;
|
|
|
|
|
|
- if( width > 0 ) {
|
|
|
- if( temp3_x_data == 0 ) {
|
|
|
-
|
|
|
- result = temp3decode(width);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+ if( width > 0 ) {
|
|
|
+ if( temp3_x_data == 0 ) {
|
|
|
+ temp3decode(width);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- return (temp3_x_data > 0);
|
|
|
+ if( temp3_x_data > 0 ) {
|
|
|
+ now = millis();
|
|
|
+
|
|
|
+ if( temp3_x_data != previous_data || (now > (old_time+1000)) ) {
|
|
|
+ previous_data = temp3_x_data;
|
|
|
+ retVal = temp3_x_data;
|
|
|
+ blinkTheLED();
|
|
|
+ }
|
|
|
+ old_time = now;
|
|
|
+ ESIC_ResetDecoder();
|
|
|
+ }
|
|
|
+
|
|
|
+ return retVal;
|
|
|
}
|