7 * Copyright (C) 2015 Tommy Vestermark
8 * Copyright (C) 2015 nebman
9 * COpyringt (C) 2016 Roman Bazalevskiy
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
16 #include "pulse_demod.h"
20 static int lelux_callback(bitbuffer_t *bitbuffer) {
21 bitrow_t *bb = bitbuffer->bb;
24 char time_str[LOCAL_TIME_BUFLEN];
26 if (bitbuffer->num_rows != 1) return 0;
28 unsigned bits = bitbuffer->bits_per_row[0];
33 uint32_t FULL = b[0] << 24 | b[1] << 16 | b[2] << 8 | b[3];
35 snprintf(id_buf,15,"%08x",FULL);
37 local_time_str(0, time_str);
40 "time", "", DATA_STRING, time_str,
41 "model", "", DATA_STRING, "Lelux PIR",
42 "id", "House Code", DATA_STRING, id_buf,
43 "command", "", DATA_STRING, "PIR",
46 data_acquired_handler(data);
55 .name = "Lelux PIR sensor",
56 .modulation = OOK_PULSE_PPM_RAW,
60 .json_callback = &lelux_callback,