- fprintf(stdout, "BUTTON:TYPE=WAVEMAN,");
- fprintf(stdout, "ID= %c,", 'A'+nb[0]);
- fprintf(stdout, "CHANNEL=%d,", (nb[1]>>2)+1);
- fprintf(stdout, "PRESSED=%d,", (nb[1]&3)+1);
- fprintf(stdout, "STATE=%s\n", (nb[2]==0xe) ? "on" : "off");
- fprintf(stderr, "%02x %02x %02x\n",nb[0],nb[1],nb[2]);
-
- if (debug_output)
- debug_callback(bb, bits_per_row);
+ id_str[0] = 'A'+nb[0];
+ id_str[1] = 0;
+ data = data_make("model", NULL, DATA_STRING, "Waveman Switch Transmitter",
+ "id", NULL, DATA_STRING, id_str,
+ "channel", NULL, DATA_INT, (nb[1]>>2)+1,
+ "button", NULL, DATA_INT, (nb[1]&3)+1,
+ "state", NULL, DATA_STRING, (nb[2]==0xe) ? "on" : "off",
+ NULL);
+ data_acquired_handler(data);