4 * QH-C-CE-3V (which should be compatible with QH-832AC),
5 * also sold as "1 by One" wireless doorbell
7 * Copyright (C) 2016 Ask Jakobsen
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
14 #include "pulse_demod.h"
19 static int quhwa_callback(bitbuffer_t *bitbuffer) {
20 bitrow_t *bb = bitbuffer->bb;
27 unsigned bits = bitbuffer->bits_per_row[0];
30 ((b[1] & 0x03) == 0x03) &&
31 ((b[2] & 0xC0) == 0xC0))
33 uint32_t ID = (b[0] << 8) | b[1];
36 char time_str[LOCAL_TIME_BUFLEN];
37 local_time_str(0, time_str);
39 data = data_make("time", "", DATA_STRING, time_str,
40 "model", "", DATA_STRING, "Quhwa doorbell",
41 "id", "ID", DATA_INT, ID,
44 data_acquired_handler(data);
51 static char *output_fields[] = {
59 PWM_Precise_Parameters pwm_precise_parameters_quhwa = {
60 .pulse_tolerance = 20,
61 .pulse_sync_width = 0, // No sync bit used
66 .modulation = OOK_PULSE_PWM_PRECISE,
67 .short_limit = 360, // Pulse: Short 360µs, Long 1070µs
68 .long_limit = 1070, // Gaps: Short 360µs, Long 1070µs
69 .reset_limit = 1200, // Intermessage Gap 5200µs
70 .json_callback = &quhwa_callback,
72 .demod_arg = (uintptr_t)&pwm_precise_parameters_quhwa,