Branch oldpackages for 14.07
[14.07/packages.git] / utils / wview / patches / 040-WMRUSB-process-absent-dewpoint.patch
1 Index: wview-5.19.0-jgoerzen/stations/WMRUSB/wmrusbprotocol.c
2 ===================================================================
3 --- wview-5.19.0-jgoerzen.orig/stations/WMRUSB/wmrusbprotocol.c 2012-12-15 15:32:03.000000000 +0000
4 +++ wview-5.19.0-jgoerzen/stations/WMRUSB/wmrusbprotocol.c      2012-12-15 15:36:47.199715376 +0000
5 @@ -70,12 +70,9 @@
6  {
7      a &= 0xff;
8      b &= 0xff;
9 -    int t = (b << 8) | a;
10 -    if (t & 0x8000)
11 -    {
12 -        t &= 0x7FFF;
13 +    int t = ((b & 0x0f) << 8) | a;
14 +    if (b & 0x80)
15          return -(t / 10.0);
16 -    }
17      else
18          return t / 10.0;
19  }
20 @@ -166,6 +163,9 @@
21              return;
22          }
23  
24 +        if (ptr[5] & 0x20)
25 +            dew = ARCHIVE_VALUE_NULL;
26 +
27          wmrWork.sensorData.humidity[sensor] = humid;
28          wmrWork.sensorData.temp[sensor]     = temp;
29          wmrWork.sensorData.dewpoint[sensor] = dew;