X-Git-Url: https://git.rvb.name/rtl-433.git/blobdiff_plain/337eb4ba945097205fbb6a3ca7912fb0697092d1..a3166201c6f1fa7e56c7e4b86083a42fffb0c568:/src/devices/leak.c~ diff --git a/src/devices/leak.c~ b/src/devices/leak.c~ deleted file mode 100644 index aa7534f..0000000 --- a/src/devices/leak.c~ +++ /dev/null @@ -1,54 +0,0 @@ -#include "rtl_433.h" - -int leak_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS], int16_t bits_per_row[BITBUF_ROWS]) { - int i,j,k; - int rows_used[BITBUF_ROWS]; - int col_max = 0; - int row_cnt = 0; - - // determine what part of bb[][] has non-zero data to avoid - // outputting lots of empty rows - for (i=0 ; i 0 ; j--) { - if (bb[i][j] != 0) - break; - } - if (j != 0) { - rows_used[i] = 1; - row_cnt++; - if (j > col_max) - col_max = j; - } else { - rows_used[i] = 0; - } - } - - fprintf(stderr,"Rows=%d,Cols=%d",row_cnt,col_max); - - if (row_cnt != 1) { - return 0; - } - - if (col_max !=4) { - return 0; - } - - if ((bb[0][0] == 0x76) || (bb[0][0] == 0x77)) { - - fprintf(stdout,"ALARM:TYPE=LEAK,ID=%2X%2X%2X%2X\n",bb[0][0],bb[0][1],bb[0][2],bb[0][3]); - - } - - return 1; - -} - -r_device leak = { - /* .id = */ 20, - /* .name = */ "Leak sensor", - /* .modulation = */ OOK_MANCHESTER, - /* .short_limit = */ 150, - /* .long_limit = */ 0, - /* .reset_limit = */ 1000, - /* .json_callback = */ &leak_callback, -};