3 static int waveman_callback(uint8_t bb[BITBUF_ROWS][BITBUF_COLS],int16_t bits_per_row[BITBUF_ROWS]) {
4 /* Two bits map to 2 states, 0 1 -> 0 and 1 1 -> 1 */
8 if (((bb[0][0]&0x55)==0x55) && ((bb[0][1]&0x55)==0x55) && ((bb[0][2]&0x55)==0x55) && ((bb[0][3]&0x55)==0x00)) {
9 for (i=0 ; i<3 ; i++) {
10 nb[i] |= ((bb[0][i]&0xC0)==0xC0) ? 0x00 : 0x01;
11 nb[i] |= ((bb[0][i]&0x30)==0x30) ? 0x00 : 0x02;
12 nb[i] |= ((bb[0][i]&0x0C)==0x0C) ? 0x00 : 0x04;
13 nb[i] |= ((bb[0][i]&0x03)==0x03) ? 0x00 : 0x08;
16 fprintf(stdout, "BUTTON:TYPE=WAVEMAN,");
17 fprintf(stdout, "ID= %c,", 'A'+nb[0]);
18 fprintf(stdout, "CHANNEL=%d,", (nb[1]>>2)+1);
19 fprintf(stdout, "PRESSED=%d,", (nb[1]&3)+1);
20 fprintf(stdout, "STATE=%s\n", (nb[2]==0xe) ? "on" : "off");
21 fprintf(stderr, "%02x %02x %02x\n",nb[0],nb[1],nb[2]);
24 debug_callback(bb, bits_per_row);
33 /* .name = */ "Waveman Switch Transmitter",
34 /* .modulation = */ OOK_PWM_P,
35 /* .short_limit = */ 1000/4,
36 /* .long_limit = */ 8000/4,
37 /* .reset_limit = */ 30000/4,
38 /* .json_callback = */ &waveman_callback,