X-Git-Url: https://git.rvb.name/rtl-433.git/blobdiff_plain/337eb4ba945097205fbb6a3ca7912fb0697092d1..a3166201c6f1fa7e56c7e4b86083a42fffb0c568:/src/devices/mebus.c~ diff --git a/src/devices/mebus.c~ b/src/devices/mebus.c~ deleted file mode 100644 index e29d3cd..0000000 --- a/src/devices/mebus.c~ +++ /dev/null @@ -1,46 +0,0 @@ -#include "rtl_433.h" - -static int mebus433_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_per_row[BITBUF_ROWS]) { - int temperature_before_dec; - int temperature_after_dec; - int16_t temp; - int8_t hum; - - if (bb[0][0] == 0 && bb[1][4] !=0 && (bb[1][0] & 0b01100000) && bb[1][3]==bb[5][3] && bb[1][4] == bb[12][4]){ - // Upper 4 bits are stored in nibble 1, lower 8 bits are stored in nibble 2 - // upper 4 bits of nibble 1 are reserved for other usages. - temp = (int16_t)((uint16_t)(bb[1][1] << 12 ) | bb[1][2]<< 4); - temp = temp >> 4; - // lower 4 bits of nibble 3 and upper 4 bits of nibble 4 contains - // humidity as decimal value - hum = (bb[1][3] << 4 | bb[1][4] >> 4); - - temperature_before_dec = abs(temp / 10); - temperature_after_dec = abs(temp % 10); - - fprintf(stdout, "SENSOR:TYPE=MEBUS,"); - fprintf(stdout, "ID=%i,", bb[1][0] & 0b00011111); - fprintf(stdout, "CHANNEL=%i,",((bb[1][1] & 0b00110000) >> 4)+1); - fprintf(stdout, "BATTERY=%s,", bb[1][1] & 0b10000000?"OK":"LOW"); - fprintf(stdout, "TEMP=%s%d.%d,",temp<0?"-":"",temperature_before_dec, temperature_after_dec); - fprintf(stdout, "HUMIDITY=%i\n", hum); - fprintf(stderr, "%02x %02x %02x %02x %02x\n",bb[1][0],bb[1][1],bb[1][2],bb[1][3],bb[1][4]); - - if (debug_output) - debug_callback(bb, bits_per_row); - - return 1; - } - return 0; -} - -r_device mebus433 = { - /* .id = */ 16, - /* .name = */ "Mebus 433", - /* .modulation = */ OOK_PWM_D, - /* .short_limit = */ 300, - /* .long_limit = */ 600, - /* .reset_limit = */ 1500, - /* .json_callback = */ &mebus433_callback, - /* .json_callback = */ //&debug_callback, -};