X-Git-Url: https://git.rvb.name/rtl-433.git/blobdiff_plain/7771049ddd733b759484442a3b10ade8faea75ff..337eb4ba945097205fbb6a3ca7912fb0697092d1:/src/devices/silvercrest.c diff --git a/src/devices/silvercrest.c b/src/devices/silvercrest.c new file mode 100644 index 0000000..03fbe93 --- /dev/null +++ b/src/devices/silvercrest.c @@ -0,0 +1,33 @@ +#include "rtl_433.h" + +static int silvercrest_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_per_row[BITBUF_ROWS]) { + /* FIXME validate the received message better */ + if (bb[1][0] == 0xF8 && + bb[2][0] == 0xF8 && + bb[3][0] == 0xF8 && + bb[4][0] == 0xF8 && + bb[1][1] == 0x4d && + bb[2][1] == 0x4d && + bb[3][1] == 0x4d && + bb[4][1] == 0x4d) { + /* Pretty sure this is a Silvercrest remote */ + fprintf(stdout, "BUTTON:TYPE=SILVERCREST,"); + fprintf(stdout, "MESSAGE=%02x%02x%02x%02x%02x\n",bb[1][0],bb[0][1],bb[0][2],bb[0][3],bb[0][4]); + + if (debug_output) + debug_callback(bb, bits_per_row); + + return 1; + } + return 0; +} + +r_device silvercrest = { + /* .id = */ 3, + /* .name = */ "Silvercrest Remote Control", + /* .modulation = */ OOK_PWM_P, + /* .short_limit = */ 600/4, + /* .long_limit = */ 5000/4, + /* .reset_limit = */ 15000/4, + /* .json_callback = */ &silvercrest_callback, +};