Bugfixes
[rtl-433.git] / src / devices / intertechno.c
1 #include "rtl_433.h"
2
3 static int intertechno_callback(bitbuffer_t *bitbuffer) {
4     bitrow_t *bb = bitbuffer->bb;
5
6       //if (bb[1][1] == 0 && bb[1][0] != 0 && bb[1][3]==bb[2][3]){
7       if(bb[0][0]==0 && bb[0][0] == 0 && bb[1][0] == 0x56){
8         fprintf(stdout, "Switch event:\n");
9         fprintf(stdout, "protocol       = Intertechno\n");
10         fprintf(stdout, "rid            = %x\n",bb[1][0]);
11         fprintf(stdout, "rid            = %x\n",bb[1][1]);
12         fprintf(stdout, "rid            = %x\n",bb[1][2]);
13         fprintf(stdout, "rid            = %x\n",bb[1][3]);
14         fprintf(stdout, "rid            = %x\n",bb[1][4]);
15         fprintf(stdout, "rid            = %x\n",bb[1][5]);
16         fprintf(stdout, "rid            = %x\n",bb[1][6]);
17         fprintf(stdout, "rid            = %x\n",bb[1][7]);
18         fprintf(stdout, "ADDR Slave     = %i\n",bb[1][7] & 0b00001111);
19         fprintf(stdout, "ADDR Master    = %i\n",(bb[1][7] & 0b11110000) >> 4);
20         fprintf(stdout, "command        = %i\n",(bb[1][6] & 0b00000111));
21         fprintf(stdout, "%02x %02x %02x %02x %02x\n",bb[1][0],bb[1][1],bb[1][2],bb[1][3],bb[1][4]);
22
23         return 1;
24     }
25     return 0;
26 }
27
28 r_device intertechno = {
29     .name           = "Intertechno 433",
30     .modulation     = OOK_PULSE_PPM_RAW,
31     .short_limit    = 400,
32     .long_limit     = 1400,
33     .reset_limit    = 10000,
34     .json_callback  = &intertechno_callback,
35     .disabled       = 1,
36     .demod_arg      = 0,
37 };