Acurite 5in1 minor fixes
authorRoman Bazalevsky <rvb@rvb.name>
Sun, 22 Feb 2015 09:54:51 +0000 (12:54 +0300)
committerRoman Bazalevsky <rvb@rvb.name>
Sun, 22 Feb 2015 09:54:51 +0000 (12:54 +0300)
src/devices/acurite.c

index 1a00324ce6b5fa885c3c4ceb3770064a2f687393..c5b50ae7a42ddcf5e212d074967ec5de25548fe1 100644 (file)
@@ -87,7 +87,6 @@ static int acurite5n1_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits
 
     if (buf) {
         // decode packet here
-        fprintf(stdout, "SENSOR:TYPE=ACURITE_5IN1,");
         if (debug_output) {
             for (i=0; i < 8; i++)
                 fprintf(stderr, "%02X ", buf[i]);
@@ -96,6 +95,7 @@ static int acurite5n1_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits
 
         if ((buf[2] & 0x0F) == 1) {
             // wind speed, wind direction, rainfall
+            fprintf(stdout, "SENSOR:TYPE=ACURITE_5IN1,");
 
             float rainfall = 0.00;
             int raincounter = acurite_getRainfallCounter(buf[5], buf[6]);
@@ -114,6 +114,7 @@ static int acurite5n1_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits
             fprintf(stdout, "RAINGAUGE=%0.2f\n", rainfall);
 
         } else if ((buf[2] & 0x0F) == 8) {
+            fprintf(stdout, "SENSOR:TYPE=ACURITE_5IN1,");
             // wind speed, temp, RH
             fprintf(stdout, "WINDSPEED=%d,",
                 acurite_getWindSpeed(buf[3], buf[4]));
@@ -166,7 +167,7 @@ static int acurite_th_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bit
     if(buf){
         fprintf(stdout, "SENSOR:TYPE=ACURITE_TEMP,");
         fprintf(stdout, "TEMPERATURE=%.1f,", acurite_th_temperature(buf));
-        fprintf(stderr, "HUMIDITY=%d\n", buf[3]);
+        fprintf(stdout, "HUMIDITY=%d\n", buf[3]);
         return 1;
     }