Fix many compile warnings

This commit is contained in:
Tommy Vestermark
2015-07-14 23:43:30 +02:00
parent 00ff066903
commit 4bc796d9e4
16 changed files with 159 additions and 144 deletions

View File

@@ -172,28 +172,34 @@ static int acurite_th_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bit
}
r_device acurite5n1 = {
/* .name = */ "Acurite 5n1 Weather Station",
/* .modulation = */ OOK_PWM_P,
/* .short_limit = */ 70,
/* .long_limit = */ 240,
/* .reset_limit = */ 21000,
/* .json_callback = */ &acurite5n1_callback,
.name = "Acurite 5n1 Weather Station",
.modulation = OOK_PWM_P,
.short_limit = 70,
.long_limit = 240,
.reset_limit = 21000,
.json_callback = &acurite5n1_callback,
.disabled = 0,
.demod_arg = 0,
};
r_device acurite_rain_gauge = {
/* .name = */ "Acurite 896 Rain Gauge",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 1744/4,
/* .long_limit = */ 3500/4,
/* .reset_limit = */ 5000/4,
/* .json_callback = */ &acurite_rain_gauge_callback,
.name = "Acurite 896 Rain Gauge",
.modulation = OOK_PWM_D,
.short_limit = 1744/4,
.long_limit = 3500/4,
.reset_limit = 5000/4,
.json_callback = &acurite_rain_gauge_callback,
.disabled = 0,
.demod_arg = 0,
};
r_device acurite_th = {
/* .name = */ "Acurite Temperature and Humidity Sensor",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 300,
/* .long_limit = */ 550,
/* .reset_limit = */ 2500,
/* .json_callback = */ &acurite_th_callback,
.name = "Acurite Temperature and Humidity Sensor",
.modulation = OOK_PWM_D,
.short_limit = 300,
.long_limit = 550,
.reset_limit = 2500,
.json_callback = &acurite_th_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -64,8 +64,6 @@ static int alectov1_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_
int16_t temp;
uint8_t humidity, csum = 0, csum2 = 0;
int i;
time_t time_now;
char time_str[LOCAL_TIME_BUFLEN];
if (bb[1][0] == bb[5][0] && bb[2][0] == bb[6][0] && (bb[1][4] & 0xf) == 0 && (bb[5][4] & 0xf) == 0
&& (bb[5][0] != 0 && bb[5][1] != 0)) {
@@ -85,11 +83,7 @@ static int alectov1_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_
/* Quit if checksup does not work out */
if (csum != (bb[1][4] >> 4) || csum2 != (bb[5][4] >> 4)) {
//fprintf(stdout, "\nAlectoV1 CRC error");
time(&time_now);
local_time_str(time_now, time_str);
fprintf(stdout,
"%s AlectoV1 Checksum/Parity error\n",
time_str);
fprintf(stderr, "AlectoV1 Checksum/Parity error\n");
return 0;
} //Invalid checksum
@@ -98,13 +92,8 @@ static int alectov1_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_
if ((bb[1][1] & 0xe0) == 0x60) {
wind = ((bb[1][1] & 0xf) == 0xc) ? 0 : 1;
time(&time_now);
local_time_str(time_now, time_str);
time(&time_now);
local_time_str(time_now, time_str);
fprintf(stdout,
"%s AlectoV1 %s Sensor %d",
time_str,
"AlectoV1 %s Sensor %d",
wind ? "Wind" : "Rain",
reverse8(bb[1][0])
);
@@ -147,16 +136,13 @@ static int alectov1_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_
temperature_before_dec = abs(temp / 10);
temperature_after_dec = abs(temp % 10);
humidity = bcd_decode8(reverse8(bb[1][3]));
time(&time_now);
local_time_str(time_now, time_str);
fprintf(stdout,
"%s AlectoV1 Sensor %d Channel %d",
time_str,
"AlectoV1 Sensor %d Channel %d",
reverse8(bb[1][0]),
(bb[1][0] & 0xc) >> 2
);
fprintf(stdout, ": Temperature %s%d.%d C", temp < 0 ? "-" : "", temperature_before_dec, temperature_after_dec);
fprintf(stdout, ": Humidity %d %", humidity);
fprintf(stdout, ": Humidity %d %%", humidity);
fprintf(stdout, ": Battery %s\n", bb[1][1]&0x80 ? "Low" : "OK");
}
@@ -175,11 +161,12 @@ static int alectov1_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_
//Timing based on 250000
r_device alectov1 = {
/* .name = */ "AlectoV1 Weather Sensor (Alecto WS3500 WS4500 Ventus W155/W044 Oregon)",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 3500 / 4, //875
/* .long_limit = */ 7000 / 4, //1750
/* .reset_limit = */ 15000 / 4, //3750
/* .json_callback = */ &alectov1_callback,
/* .Disable = */ 0,
.name = "AlectoV1 Weather Sensor (Alecto WS3500 WS4500 Ventus W155/W044 Oregon)",
.modulation = OOK_PWM_D,
.short_limit = 3500 / 4, //875
.long_limit = 7000 / 4, //1750
.reset_limit = 15000 / 4, //3750
.json_callback = &alectov1_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -145,10 +145,12 @@ ambient_weather_callback (uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_per
}
r_device ambient_weather = {
/* .name = */ "Ambient Weather Temperature Sensor",
/* .modulation = */ OOK_PULSE_MANCHESTER_ZEROBIT,
/* .short_limit = */ 125,
/* .long_limit = */ 0, // not used
/* .reset_limit = */ 600,
/* .json_callback = */ &ambient_weather_callback,
.name = "Ambient Weather Temperature Sensor",
.modulation = OOK_PULSE_MANCHESTER_ZEROBIT,
.short_limit = 125,
.long_limit = 0, // not used
.reset_limit = 600,
.json_callback = &ambient_weather_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -119,12 +119,12 @@ static int cardin_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_pe
}
r_device cardin = {
/* .name = */ "Cardin S466-TX2",
/* .modulation = */ OOK_PULSE_PPM_RAW,
/* .short_limit = */ 303,
/* .long_limit = */ 400,
/* .reset_limit = */ 8000,
/* .json_callback = */ &cardin_callback,
/* .disabled = */ 0,
/* .json_callback = */ //&debug_callback,
.name = "Cardin S466-TX2",
.modulation = OOK_PULSE_PPM_RAW,
.short_limit = 303,
.long_limit = 400,
.reset_limit = 8000,
.json_callback = &cardin_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -127,19 +127,23 @@ static int ws2000_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_per
}
r_device elv_em1000 = {
/* .name = */ "ELV EM 1000",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 750/4,
/* .long_limit = */ 7250/4,
/* .reset_limit = */ 30000/4,
/* .json_callback = */ &em1000_callback,
.name = "ELV EM 1000",
.modulation = OOK_PWM_D,
.short_limit = 750/4,
.long_limit = 7250/4,
.reset_limit = 30000/4,
.json_callback = &em1000_callback,
.disabled = 0,
.demod_arg = 0,
};
r_device elv_ws2000 = {
/* .name = */ "ELV WS 2000",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ (602+(1155-602)/2)/4,
/* .long_limit = */ ((1755635-1655517)/2)/4, // no repetitions
/* .reset_limit = */ ((1755635-1655517)*2)/4,
/* .json_callback = */ &ws2000_callback,
.name = "ELV WS 2000",
.modulation = OOK_PWM_D,
.short_limit = (602+(1155-602)/2)/4,
.long_limit = ((1755635-1655517)/2)/4, // no repetitions
.reset_limit = ((1755635-1655517)*2)/4,
.json_callback = &ws2000_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -63,7 +63,6 @@ static int fineoffset_WH2_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t
fprintf(stdout, "ID = 0x%2X\n", ID);
fprintf(stdout, "temperature = %.1f C\n", temperature);
fprintf(stdout, "humidity = %2.0f %%\n", humidity);
// fprintf(stdout, "raw = %02x %02x %02x %02x %02x %02x\n",bb[0][0],bb[0][1],bb[0][2],bb[0][3],bb[0][4],bb[0][5]);
return 1;
}
@@ -72,12 +71,14 @@ static int fineoffset_WH2_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t
r_device fineoffset_WH2 = {
/* .name = */ "Fine Offset Electronics, WH-2 Sensor",
/* .modulation = */ OOK_PULSE_PWM_RAW,
/* .short_limit = */ 200, // Short pulse 136, long pulse 381, fixed gap 259
/* .long_limit = */ 700, // Maximum pulse period (long pulse + fixed gap)
/* .reset_limit = */ 700, // We just want 1 package
/* .json_callback = */ &fineoffset_WH2_callback,
.name = "Fine Offset Electronics, WH-2 Sensor",
.modulation = OOK_PULSE_PWM_RAW,
.short_limit = 200, // Short pulse 136, long pulse 381, fixed gap 259
.long_limit = 700, // Maximum pulse period (long pulse + fixed gap)
.reset_limit = 700, // We just want 1 package
.json_callback = &fineoffset_WH2_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -16,7 +16,7 @@ static int intertechno_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bi
fprintf(stdout, "rid = %x\n",bb[1][7]);
fprintf(stdout, "ADDR Slave = %i\n",bb[1][7] & 0b00001111);
fprintf(stdout, "ADDR Master = %i\n",(bb[1][7] & 0b11110000) >> 4);
fprintf(stdout, "command = %i\n",(bb[1][6] & 0b00000111));
fprintf(stdout, "command = %i\n",(bb[1][6] & 0b00000111));
fprintf(stdout, "%02x %02x %02x %02x %02x\n",bb[1][0],bb[1][1],bb[1][2],bb[1][3],bb[1][4]);
return 1;
@@ -25,11 +25,12 @@ static int intertechno_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bi
}
r_device intertechno = {
/* .name = */ "Intertechno 433",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 100,
/* .long_limit = */ 350,
/* .reset_limit = */ 3000,
/* .json_callback = */ &intertechno_callback,
/* .json_callback = */ //&debug_callback,
.name = "Intertechno 433",
.modulation = OOK_PWM_D,
.short_limit = 100,
.long_limit = 350,
.reset_limit = 3000,
.json_callback = &intertechno_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -35,11 +35,12 @@ static int mebus433_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_
}
r_device mebus433 = {
/* .name = */ "Mebus 433",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 300,
/* .long_limit = */ 600,
/* .reset_limit = */ 1500,
/* .json_callback = */ &mebus433_callback,
/* .json_callback = */ //&debug_callback,
.name = "Mebus 433",
.modulation = OOK_PWM_D,
.short_limit = 300,
.long_limit = 600,
.reset_limit = 1500,
.json_callback = &mebus433_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -115,10 +115,12 @@ static int newkaku_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_p
}
r_device newkaku = {
/* .name = */ "KlikAanKlikUit Wireless Switch",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 200,
/* .long_limit = */ 800,
/* .reset_limit = */ 4000,
/* .json_callback = */ &newkaku_callback,
.name = "KlikAanKlikUit Wireless Switch",
.modulation = OOK_PWM_D,
.short_limit = 200,
.long_limit = 800,
.reset_limit = 4000,
.json_callback = &newkaku_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -47,11 +47,13 @@ static int nexus_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_per_
// timings based on samp_rate=1024000
r_device nexus = {
/* .name = */ "Nexus Temperature & Humidity Sensor",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 1744/4,
/* .long_limit = */ 3500/4,
/* .reset_limit = */ 5000/4,
/* .json_callback = */ &nexus_callback,
.name = "Nexus Temperature & Humidity Sensor",
.modulation = OOK_PWM_D,
.short_limit = 1744/4,
.long_limit = 3500/4,
.reset_limit = 5000/4,
.json_callback = &nexus_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -341,10 +341,12 @@ static int oregon_scientific_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int1
}
r_device oregon_scientific = {
/* .name = */ "Oregon Scientific Weather Sensor",
/* .modulation = */ OOK_PULSE_MANCHESTER_ZEROBIT,
/* .short_limit = */ 125,
/* .long_limit = */ 0, // not used
/* .reset_limit = */ 600,
/* .json_callback = */ &oregon_scientific_callback,
.name = "Oregon Scientific Weather Sensor",
.modulation = OOK_PULSE_MANCHESTER_ZEROBIT,
.short_limit = 125,
.long_limit = 0, // not used
.reset_limit = 600,
.json_callback = &oregon_scientific_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -28,8 +28,8 @@ static int prologue_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_p
/* FIXME validate the received message better */
if (((bb[1][0]&0xF0) == 0x90 && (bb[2][0]&0xF0) == 0x90 && (bb[3][0]&0xF0) == 0x90 && (bb[4][0]&0xF0) == 0x90 &&
(bb[5][0]&0xF0) == 0x90 && (bb[6][0]&0xF0) == 0x90) ||
((bb[1][0]&0xF0) == 0x50 && (bb[2][0]&0xF0) == 0x50 && (bb[3][0]&0xF0) == 0x50 && (bb[4][0]&0xF0) == 0x50) &&
(bb[1][3] == bb[2][3]) && (bb[1][4] == bb[2][4])) {
((bb[1][0]&0xF0) == 0x50 && (bb[2][0]&0xF0) == 0x50 && (bb[3][0]&0xF0) == 0x50 && (bb[4][0]&0xF0) == 0x50 &&
(bb[1][3] == bb[2][3]) && (bb[1][4] == bb[2][4]))) {
/* Prologue sensor */
temp2 = (int16_t)((uint16_t)(bb[1][2] << 8) | (bb[1][3]&0xF0));
@@ -45,19 +45,18 @@ static int prologue_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_p
rid = ((bb[1][0]&0x0F)<<4)|(bb[1][1]&0xF0)>>4;
fprintf(stdout, "rid = %d\n", rid);
fprintf(stdout, "hrid = %02x\n", rid);
fprintf(stdout, "%02x %02x %02x %02x %02x\n",bb[1][0],bb[1][1],bb[1][2],bb[1][3],bb[1][4]);
return 1;
}
return 0;
}
r_device prologue = {
/* .name = */ "Prologue Temperature Sensor",
/* .modulation = */ OOK_PULSE_PPM_RAW,
/* .short_limit = */ 3500/4,
/* .long_limit = */ 7000/4,
/* .reset_limit = */ 2500,
/* .json_callback = */ &prologue_callback,
.name = "Prologue Temperature Sensor",
.modulation = OOK_PULSE_PPM_RAW,
.short_limit = 3500/4,
.long_limit = 7000/4,
.reset_limit = 2500,
.json_callback = &prologue_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -45,11 +45,13 @@ static int rubicson_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_p
// timings based on samp_rate=1024000
r_device rubicson = {
/* .name = */ "Rubicson Temperature Sensor",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 1744/4,
/* .long_limit = */ 3500/4,
/* .reset_limit = */ 5000/4,
/* .json_callback = */ &rubicson_callback,
.name = "Rubicson Temperature Sensor",
.modulation = OOK_PWM_D,
.short_limit = 1744/4,
.long_limit = 3500/4,
.reset_limit = 5000/4,
.json_callback = &rubicson_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -21,10 +21,12 @@ static int silvercrest_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bit
}
r_device silvercrest = {
/* .name = */ "Silvercrest Remote Control",
/* .modulation = */ OOK_PWM_P,
/* .short_limit = */ 600/4,
/* .long_limit = */ 5000/4,
/* .reset_limit = */ 15000/4,
/* .json_callback = */ &silvercrest_callback,
.name = "Silvercrest Remote Control",
.modulation = OOK_PWM_P,
.short_limit = 600/4,
.long_limit = 5000/4,
.reset_limit = 15000/4,
.json_callback = &silvercrest_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -33,10 +33,12 @@ static int steffen_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_pe
}
r_device steffen = {
/* .name = */ "Steffen Switch Transmitter",
/* .modulation = */ OOK_PWM_D,
/* .short_limit = */ 140,
/* .long_limit = */ 270,
/* .reset_limit = */ 1500,
/* .json_callback = */ &steffen_callback,
.name = "Steffen Switch Transmitter",
.modulation = OOK_PWM_D,
.short_limit = 140,
.long_limit = 270,
.reset_limit = 1500,
.json_callback = &steffen_callback,
.disabled = 0,
.demod_arg = 0,
};

View File

@@ -27,10 +27,12 @@ static int waveman_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_pe
}
r_device waveman = {
/* .name = */ "Waveman Switch Transmitter",
/* .modulation = */ OOK_PWM_P,
/* .short_limit = */ 1000/4,
/* .long_limit = */ 8000/4,
/* .reset_limit = */ 30000/4,
/* .json_callback = */ &waveman_callback,
.name = "Waveman Switch Transmitter",
.modulation = OOK_PWM_P,
.short_limit = 1000/4,
.long_limit = 8000/4,
.reset_limit = 30000/4,
.json_callback = &waveman_callback,
.disabled = 0,
.demod_arg = 0,
};