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(stderr, "Remote button event:\n");
17 fprintf(stderr, "model = Waveman Switch Transmitter, %d bits\n",bits_per_row[1]);
18 fprintf(stderr, "id = %c\n", 'A'+nb[0]);
19 fprintf(stderr, "channel = %d\n", (nb[1]>>2)+1);
20 fprintf(stderr, "button = %d\n", (nb[1]&3)+1);
21 fprintf(stderr, "state = %s\n", (nb[2]==0xe) ? "on" : "off");
22 fprintf(stderr, "%02x %02x %02x\n",nb[0],nb[1],nb[2]);
25 debug_callback(bb, bits_per_row);
34 /* .name = */ "Waveman Switch Transmitter",
35 /* .modulation = */ OOK_PWM_P,
36 /* .short_limit = */ 1000/4,
37 /* .long_limit = */ 8000/4,
38 /* .reset_limit = */ 30000/4,
39 /* .json_callback = */ &waveman_callback,