X-Git-Url: https://git.rvb.name/rtl-433.git/blobdiff_plain/337eb4ba945097205fbb6a3ca7912fb0697092d1..refs/heads/master:/src/devices/silvercrest.c?ds=inline diff --git a/src/devices/silvercrest.c b/src/devices/silvercrest.c index 03fbe93..72d2dba 100644 --- a/src/devices/silvercrest.c +++ b/src/devices/silvercrest.c @@ -1,6 +1,7 @@ #include "rtl_433.h" -static int silvercrest_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_per_row[BITBUF_ROWS]) { +static int silvercrest_callback(bitbuffer_t *bitbuffer) { + bitrow_t *bb = bitbuffer->bb; /* FIXME validate the received message better */ if (bb[1][0] == 0xF8 && bb[2][0] == 0xF8 && @@ -11,11 +12,9 @@ static int silvercrest_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bit 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); + fprintf(stdout, "Remote button event:\n"); + fprintf(stdout, "model = Silvercrest, %d bits\n",bitbuffer->bits_per_row[1]); + fprintf(stdout, "%02x %02x %02x %02x %02x\n",bb[1][0],bb[0][1],bb[0][2],bb[0][3],bb[0][4]); return 1; } @@ -23,11 +22,12 @@ static int silvercrest_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bit } 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, + .name = "Silvercrest Remote Control", + .modulation = OOK_PULSE_PWM_RAW, + .short_limit = 600, + .long_limit = 5000, + .reset_limit = 15000, + .json_callback = &silvercrest_callback, + .disabled = 1, + .demod_arg = 1, // Remove startbit };