1 /* Akhan remote keyless entry system
3 * This RKE system uses a HS1527 OTP encoder (http://sc-tech.cn/en/hs1527.pdf)
4 * Each message consists of a preamble, 20 bit id and 4 data bits.
6 * (code based on chuango.c and generic_remote.c)
9 #include "pulse_demod.h"
13 static int akhan_rke_callback(bitbuffer_t *bitbuffer) {
14 bitrow_t *bb = bitbuffer->bb;
17 //invert bits, short pulse is 0, long pulse is 1
22 unsigned bits = bitbuffer->bits_per_row[0];
25 char time_str[LOCAL_TIME_BUFLEN];
26 local_time_str(0, time_str);
29 uint32_t ID = (b[0] << 12) | (b[1] << 4) | (b[2] >> 4);
30 uint32_t dataBits = b[2] & 0x0F;
35 case 0x1: CMD = "0x1 (Lock)"; break;
36 case 0x2: CMD = "0x2 (Unlock)"; break;
37 case 0x4: CMD = "0x4 (Mute)"; break;
38 case 0x8: CMD = "0x8 (Alarm)"; break;
45 data = data_make( "time", "", DATA_STRING, time_str,
46 "device", "", DATA_STRING, "Akhan 100F14 remote keyless entry",
47 "id", "ID (20bit)", DATA_FORMAT, "0x%x", DATA_INT, ID,
48 "data", "Data (4bit)", DATA_STRING, CMD,
51 data_acquired_handler(data);
59 static char *output_fields[] = {
68 PWM_Precise_Parameters pwm_precise_parameters_akhan = {
69 .pulse_tolerance = 20,
70 .pulse_sync_width = 0,
73 r_device akhan_100F14 = {
74 .name = "Akhan 100F14 remote keyless entry",
75 .modulation = OOK_PULSE_PWM_PRECISE,
79 .json_callback = &akhan_rke_callback,
81 .demod_arg = (uintptr_t)&pwm_precise_parameters_akhan,