From 894b12e1bcaaddbcd2a67fa20058b390336c8aca Mon Sep 17 00:00:00 2001 From: Tommy Vestermark Date: Fri, 21 Aug 2015 00:14:05 +0200 Subject: [PATCH] Add device: Valeo Car Key Mainly to detect event / identify signal. Does not attempt to decrypt rolling code. --- include/rtl_433_devices.h | 3 ++- src/CMakeLists.txt | 1 + src/devices/valeo.c | 43 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/devices/valeo.c diff --git a/include/rtl_433_devices.h b/include/rtl_433_devices.h index ac50a41b..dbcefc67 100644 --- a/include/rtl_433_devices.h +++ b/include/rtl_433_devices.h @@ -30,7 +30,8 @@ DECL(brennstuhl_rcs_2044) \ DECL(gt_wt_02) \ DECL(danfoss_CFR) \ - DECL(ec3k) + DECL(ec3k) \ + DECL(valeo) typedef struct { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 74bb66cc..7c2dce71 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,6 +47,7 @@ add_executable(rtl_433 devices/gt_wt_02.c devices/danfoss.c devices/ec3k.c + devices/valeo.c ) target_link_libraries(rtl_433 diff --git a/src/devices/valeo.c b/src/devices/valeo.c new file mode 100644 index 00000000..b4baacc6 --- /dev/null +++ b/src/devices/valeo.c @@ -0,0 +1,43 @@ +/* Valeo Car Key + * + * Identifies event, but does not attempt to decrypt rolling code... + * + * Copyright (C) 2015 Tommy Vestermark + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include "rtl_433.h" + + +static int valeo_callback(bitbuffer_t *bitbuffer) { + bitrow_t *bb = bitbuffer->bb; + + // Validate package + unsigned bits = bitbuffer->bits_per_row[0]; + if ((bits == 461) + && (bb[0][1] == 0xe8) && (bb[0][2] == 0xe8) // Check a couple of preambles + ) { + fprintf(stdout, "Valeo Car Key:\n"); + fprintf(stdout, "Rolling code = "); + for (unsigned n=49; n<(49+9); ++n) { + fprintf(stdout, "%02X", bb[0][n]); + } + fprintf(stdout, "\n"); + return 1; + } + return 0; +} + + +r_device valeo = { + .name = "Valeo Car Key", + .modulation = OOK_PULSE_MANCHESTER_ZEROBIT, + .short_limit = 26, // Probably 26.5 + .long_limit = 0, // Not used + .reset_limit = 100, + .json_callback = &valeo_callback, + .disabled = 0, + .demod_arg = 0, +};