31 #include <sys/socket.h>
34 #include <sys/types.h>
38 #ifdef HAVE_KERNEL_LIRC_H
39 #include <linux/lirc.h>
41 #include "media/lirc.h"
44 #include "lirc/lirc_log.h"
45 #include "lirc/lirc_options.h"
46 #include "lirc/ir_remote.h"
47 #include "lirc/config_file.h"
48 #include "lirc/transmit.h"
49 #include "lirc/config_flags.h"
54 enum directive { ID_none, ID_remote, ID_codes, ID_raw_codes, ID_raw_name };
71 typedef void* (*array_guest_func)(
void* item,
void* arg);
75 #define MAX_INCLUDES 10
77 const char* whitespace =
" \t";
80 static int parse_error;
82 static struct ir_remote* read_config_recursive(FILE* f,
const char*
name,
int depth);
83 static void calculate_signal_lengths(
struct ir_remote* remote);
85 void** init_void_array(
struct void_array* ar,
size_t chunk_size,
size_t item_size)
87 ar->chunk_size = chunk_size;
88 ar->item_size = item_size;
90 ar->ptr = calloc(chunk_size, ar->item_size);
112 {
"REVERSE", REVERSE },
127 if ((ar->nr_items % ar->chunk_size) == (ar->chunk_size) - 1) {
130 ptr = realloc(ar->ptr,
132 (ar->nr_items + ar->chunk_size + 1));
140 memcpy((ar->ptr) + (ar->item_size * ar->nr_items), dataptr, ar->item_size);
141 ar->nr_items = (ar->nr_items) + 1;
142 memset((ar->ptr) + (ar->item_size * ar->nr_items), 0, ar->item_size);
164 for (i = 0; i < ar->nr_items; i += 1) {
165 r = func(ar->ptr + (i * ar->item_size), arg);
176 if (node1 == NULL || node2 == NULL)
177 return node1 == node2;
178 return node1->code == node2->code;
186 static void* array_guest_code_equals(
void* arg1,
void* arg2)
194 if (code1 == NULL || code2 == NULL)
200 while (next1 != NULL) {
201 if (!ir_code_node_equals(next1, next2))
206 return next2 == NULL ? arg1 : NULL;
214 static void* array_guest_ncode_cmp(
void* item,
void* arg)
220 if (strcmp(code1->
name, code2->
name) == 0)
226 void* s_malloc(
size_t size)
236 memset(ptr, 0, size);
240 char* s_strdup(
char*
string)
244 ptr = strdup(
string);
253 ir_code s_strtocode(
const char* val)
259 code = strtoull(val, &endptr, 0);
260 if ((
code == (uint64_t) -1 && errno == ERANGE) || strlen(endptr) != 0 || strlen(val) == 0) {
261 log_error(
"error in configfile line %d:", line);
262 log_error(
"\"%s\": must be a valid (uint64_t) number", val);
269 uint32_t s_strtou32(
char* val)
274 n = strtoul(val, &endptr, 0);
275 if (!*val || *endptr) {
276 log_error(
"error in configfile line %d:", line);
277 log_error(
"\"%s\": must be a valid (uint32_t) number", val);
284 int s_strtoi(
char* val)
290 n = strtol(val, &endptr, 0);
292 if (!*val || *endptr || n != ((
long)h)) {
293 log_error(
"error in configfile line %d:", line);
294 log_error(
"\"%s\": must be a valid (int) number", val);
301 unsigned int s_strtoui(
char* val)
307 n = strtoul(val, &endptr, 0);
309 if (!*val || *endptr || n != ((uint32_t)h)) {
310 log_error(
"error in configfile line %d:", line);
311 log_error(
"\"%s\": must be a valid (unsigned int) number", val);
318 lirc_t s_strtolirc_t(
char* val)
324 n = strtoul(val, &endptr, 0);
326 if (!*val || *endptr || n != ((uint32_t)h)) {
327 log_error(
"error in configfile line %d:", line);
328 log_error(
"\"%s\": must be a valid (lirc_t) number", val);
333 log_warn(
"error in configfile line %d:", line);
334 log_warn(
"\"%s\" is out of range", val);
339 int checkMode(
int is_mode,
int c_mode,
char* error)
341 if (is_mode != c_mode) {
342 log_error(
"fatal error in configfile line %d:", line);
343 log_error(
"\"%s\" isn't valid at this position", error);
350 int addSignal(
struct void_array*
signals,
char* val)
366 code->name = s_strdup(key);
367 code->code = s_strtocode(val);
376 node = s_malloc(
sizeof(*node));
380 node->code = s_strtocode(val);
385 if (code->current == NULL) {
387 code->current = node;
389 code->current->next = node;
390 code->current = node;
395 int parseFlags(
char* val)
403 while (
flag != NULL) {
404 while (*help !=
'|' && *help != 0)
414 while (flaglptr->
name != NULL) {
415 if (strcasecmp(flaglptr->
name,
flag) == 0) {
416 if (flaglptr->
flag & IR_PROTOCOL_MASK && flags & IR_PROTOCOL_MASK) {
417 log_error(
"error in configfile line %d:", line);
418 log_error(
"multiple protocols given in flags: \"%s\"",
flag);
422 flags = flags | flaglptr->
flag;
428 if (flaglptr->
name == NULL) {
429 log_error(
"error in configfile line %d:", line);
441 int defineRemote(
char* key,
char* val,
char* val2,
struct ir_remote* rem)
443 if ((strcasecmp(
"name", key)) == 0) {
444 if (rem->
name != NULL)
445 free((
void*)(rem->
name));
446 rem->
name = s_strdup(val);
450 if (options_getboolean(
"lircd:dynamic-codes")) {
451 if ((strcasecmp(
"dyncodes_name", key)) == 0) {
457 }
else if (strcasecmp(
"driver", key) == 0) {
459 free((
void*)(rem->
driver));
460 rem->
driver = s_strdup(val);
462 }
else if ((strcasecmp(
"bits", key)) == 0) {
463 rem->
bits = s_strtoi(val);
465 }
else if (strcasecmp(
"flags", key) == 0) {
466 rem->
flags |= parseFlags(val);
468 }
else if (strcasecmp(
"eps", key) == 0) {
469 rem->
eps = s_strtoi(val);
471 }
else if (strcasecmp(
"aeps", key) == 0) {
472 rem->
aeps = s_strtoi(val);
474 }
else if (strcasecmp(
"plead", key) == 0) {
475 rem->
plead = s_strtolirc_t(val);
477 }
else if (strcasecmp(
"ptrail", key) == 0) {
478 rem->
ptrail = s_strtolirc_t(val);
480 }
else if (strcasecmp(
"pre_data_bits", key) == 0) {
483 }
else if (strcasecmp(
"pre_data", key) == 0) {
486 }
else if (strcasecmp(
"post_data_bits", key) == 0) {
489 }
else if (strcasecmp(
"post_data", key) == 0) {
492 }
else if (strcasecmp(
"gap", key) == 0) {
494 rem->
gap2 = s_strtou32(val2);
495 rem->
gap = s_strtou32(val);
496 return val2 != NULL ? 2 : 1;
497 }
else if (strcasecmp(
"repeat_gap", key) == 0) {
500 }
else if (strcasecmp(
"repeat_mask", key) == 0) {
505 else if (strcasecmp(
"toggle_bit", key) == 0) {
508 }
else if (strcasecmp(
"toggle_bit_mask", key) == 0) {
511 }
else if (strcasecmp(
"toggle_mask", key) == 0) {
514 }
else if (strcasecmp(
"rc6_mask", key) == 0) {
517 }
else if (strcasecmp(
"ignore_mask", key) == 0) {
520 }
else if (strcasecmp(
"manual_sort", key) == 0) {
525 else if (strcasecmp(
"repeat_bit", key) == 0) {
528 }
else if (strcasecmp(
"suppress_repeat", key) == 0) {
531 }
else if (strcasecmp(
"min_repeat", key) == 0) {
534 }
else if (strcasecmp(
"min_code_repeat", key) == 0) {
537 }
else if (strcasecmp(
"frequency", key) == 0) {
538 rem->
freq = s_strtoui(val);
540 }
else if (strcasecmp(
"duty_cycle", key) == 0) {
543 }
else if (strcasecmp(
"baud", key) == 0) {
544 rem->
baud = s_strtoui(val);
546 }
else if (strcasecmp(
"serial_mode", key) == 0) {
547 if (val[0] <
'5' || val[0] >
'9') {
548 log_error(
"error in configfile line %d:", line);
554 switch (toupper(val[1])) {
556 rem->
parity = IR_PARITY_NONE;
559 rem->
parity = IR_PARITY_EVEN;
562 rem->
parity = IR_PARITY_ODD;
565 log_error(
"error in configfile line %d:", line);
570 if (strcmp(val + 2,
"1.5") == 0)
575 }
else if (val2 != NULL) {
576 if (strcasecmp(
"header", key) == 0) {
577 rem->phead = s_strtolirc_t(val);
578 rem->
shead = s_strtolirc_t(val2);
580 }
else if (strcasecmp(
"three", key) == 0) {
581 rem->pthree = s_strtolirc_t(val);
582 rem->
sthree = s_strtolirc_t(val2);
584 }
else if (strcasecmp(
"two", key) == 0) {
585 rem->ptwo = s_strtolirc_t(val);
586 rem->
stwo = s_strtolirc_t(val2);
588 }
else if (strcasecmp(
"one", key) == 0) {
589 rem->pone = s_strtolirc_t(val);
590 rem->
sone = s_strtolirc_t(val2);
592 }
else if (strcasecmp(
"zero", key) == 0) {
593 rem->pzero = s_strtolirc_t(val);
594 rem->
szero = s_strtolirc_t(val2);
596 }
else if (strcasecmp(
"foot", key) == 0) {
597 rem->pfoot = s_strtolirc_t(val);
598 rem->
sfoot = s_strtolirc_t(val2);
600 }
else if (strcasecmp(
"repeat", key) == 0) {
601 rem->prepeat = s_strtolirc_t(val);
602 rem->
srepeat = s_strtolirc_t(val2);
604 }
else if (strcasecmp(
"pre", key) == 0) {
605 rem->pre_p = s_strtolirc_t(val);
606 rem->
pre_s = s_strtolirc_t(val2);
608 }
else if (strcasecmp(
"post", key) == 0) {
609 rem->post_p = s_strtolirc_t(val);
610 rem->
post_s = s_strtolirc_t(val2);
615 log_error(
"error in configfile line %d:", line);
616 log_error(
"unknown definiton: \"%s %s %s\"", key, val, val2);
618 log_error(
"error in configfile line %d:", line);
619 log_error(
"unknown definiton or too few arguments: \"%s %s\"", key, val);
625 static int sanityChecks(
struct ir_remote* rem,
const char* path)
630 path = path != NULL ? path :
"unknown file";
633 log_error(
"%s: Missing remote name", path);
637 log_warn(
"%s: %s: Gap value missing or invalid",
640 if (has_repeat_gap(rem) && is_const(rem)) {
641 log_warn(
"%s: %s: Repeat_gap ignored (CONST_LENGTH is set)",
650 "%s: %s: Invalid pre_data", path, rem->
name);
654 log_warn(
"%s: %s: Invalid post_data",
662 for (codes = rem->codes; codes->
name != NULL; codes++) {
663 if ((codes->
code & gen_mask(rem->
bits)) != codes->
code) {
664 log_warn(
"%s: %s: Invalid code : %s",
668 for (node = codes->
next; node != NULL; node = node->next) {
669 if ((node->code & gen_mask(rem->
bits)) != node->code) {
670 log_warn(
"%s: %s: Invalid code %s: %s",
672 node->code &= gen_mask(rem->
bits);
691 int r1_is_raw = is_raw(r1);
692 int r2_is_raw = is_raw(r2);
694 if (!r1_is_raw && r2_is_raw)
696 if (r1_is_raw && !r2_is_raw)
699 if (r1_is_raw && r2_is_raw) {
700 for (c = r1->codes, r1_size = 0; c->
name != NULL; c++)
702 for (c = r2->codes, r2_size = 0; c->
name != NULL; c++)
705 r1_size = bit_count(r1);
706 r2_size = bit_count(r2);
708 if (r1_size == r2_size)
710 return r1_size < r2_size ? -1 : 1;
727 for (r = remotes; r != NULL && r != (
void*)-1; r = r->next)
732 while (rem != NULL && rem != (
void*)-1) {
737 while (scan && remote_bits_cmp(scan, rem) <= 0) {
756 static const char* lirc_parse_include(
char* s)
765 while (last > s && strchr(whitespace, *last) != NULL)
769 if (*s !=
'"' && *s !=
'<')
771 if (*s ==
'"' && *last !=
'"')
773 else if (*s ==
'<' && *last !=
'>')
776 memmove(s, s + 1, len - 2 + 1);
783 static const char* lirc_parse_relative(
char* dst,
796 snprintf(dst, dst_size,
"%s", child);
799 if (strlen(current) >= dst_size)
801 strcpy(dst, current);
803 dirlen = strlen(dir);
805 memmove(dst, dir, dirlen + 1);
807 if (dirlen + 1 + strlen(child) + 1 > dst_size)
826 if (root == NULL && what != NULL)
830 for (r = root; r->next != NULL; r = r->next)
841 head = read_config_recursive(f,
name, 0);
842 head = sort_by_bit_count(head);
858 read_included(
const char*
name,
int depth,
char* val,
struct ir_remote* top_rem)
861 const char* childName;
864 if (depth > MAX_INCLUDES) {
865 log_error(
"error opening child file defined at %s:%d",
name, line);
869 childName = lirc_parse_include(val);
871 log_error(
"error parsing child file value defined at line %d:", line);
875 childFile = fopen(childName,
"r");
876 if (childFile == NULL) {
877 log_error(
"error opening child file '%s' defined at line %d:",
879 log_error(
"ignoring this child file for now.");
882 rem = read_config_recursive(childFile, childName, depth + 1);
883 top_rem = ir_remotes_append(top_rem, rem);
906 char buff[256] = {
'\0' };
908 memset(&globbuf, 0,
sizeof(globbuf));
910 val[strlen(val) - 1] =
'\0';
911 lirc_parse_relative(buff,
sizeof(buff), val,
name);
912 glob(buff, 0, NULL, &globbuf);
913 for (i = 0; i < globbuf.gl_pathc; i += 1) {
914 snprintf(buff,
sizeof(buff),
"\"%s\"", globbuf.gl_pathv[i]);
915 top_rem = read_included(
name, depth, buff, top_rem);
922 static void check_ncode_dups(
const char* path,
924 struct void_array* ar,
927 if (foreach_void_array(ar, array_guest_ncode_cmp, code) != NULL) {
928 log_notice(
"%s: %s: Multiple definitions of: %s",
929 path,
name, code->name);
931 if (foreach_void_array(ar, array_guest_code_equals, code) != NULL) {
932 log_notice(
"%s: %s: Multiple values for same code: %s",
933 path,
name, code->name);
939 read_config_recursive(FILE* f,
const char*
name,
int depth)
941 char buf[LINE_LEN + 1];
948 struct void_array codes_list, raw_codes, signals;
949 struct ir_ncode raw_code = { NULL, 0, 0, NULL };
950 struct ir_ncode name_code = { NULL, 0, 0, NULL };
958 while (fgets(buf, LINE_LEN, f) != NULL) {
961 if (len == LINE_LEN && buf[len - 1] !=
'\n') {
962 log_error(
"line %d too long in config file", line);
969 if (buf[len] ==
'\n')
974 if (buf[len] ==
'\r')
980 key = strtok(buf, whitespace);
984 val = strtok(NULL, whitespace);
986 val2 = strtok(NULL, whitespace);
987 log_trace2(
"Tokens: \"%s\" \"%s\" \"%s\"", key, val, (val2 == NULL ?
"(null)" : val));
988 if (strcasecmp(
"include", key) == 0) {
989 int save_line = line;
991 top_rem = read_all_included(
name,
996 }
else if (strcasecmp(
"begin", key) == 0) {
997 if (strcasecmp(
"codes", val) == 0) {
1000 if (!checkMode(mode, ID_remote,
"begin codes"))
1003 log_error(
"error in configfile line %d:", line);
1009 init_void_array(&codes_list, 30,
sizeof(
struct ir_ncode));
1011 }
else if (strcasecmp(
"raw_codes", val) == 0) {
1014 if (!checkMode(mode, ID_remote,
"begin raw_codes"))
1017 log_error(
"error in configfile line %d:", line);
1024 init_void_array(&raw_codes, 30,
sizeof(
struct ir_ncode));
1025 mode = ID_raw_codes;
1026 }
else if (strcasecmp(
"remote", val) == 0) {
1029 if (!checkMode(mode, ID_none,
"begin remote"))
1035 rem = top_rem = s_malloc(
sizeof(
struct ir_remote));
1036 rem->
freq = DEFAULT_FREQ;
1040 rem = s_malloc(
sizeof(
struct ir_remote));
1041 rem->
freq = DEFAULT_FREQ;
1042 ir_remotes_append(top_rem, rem);
1044 }
else if (mode == ID_codes) {
1045 code = defineCode(key, val, &name_code);
1046 while (!parse_error && val2 != NULL) {
1049 defineNode(
code, val2);
1050 val2 = strtok(NULL, whitespace);
1052 code->current = NULL;
1056 log_error(
"error in configfile line %d:", line);
1057 log_error(
"unknown section \"%s\"", val);
1060 if (!parse_error && val2 != NULL) {
1061 log_warn(
"%s: garbage after '%s' token "
1062 "in line %d ignored",
1063 rem->
name, val, line);
1065 }
else if (strcasecmp(
"end", key) == 0) {
1066 if (strcasecmp(
"codes", val) == 0) {
1069 if (!checkMode(mode, ID_codes,
"end codes"))
1073 }
else if (strcasecmp(
"raw_codes", val) == 0) {
1077 if (mode == ID_raw_name) {
1080 if (raw_code.
length % 2 == 0) {
1081 log_error(
"error in configfile line %d:", line);
1087 mode = ID_raw_codes;
1089 if (!checkMode(mode, ID_raw_codes,
"end raw_codes"))
1093 }
else if (strcasecmp(
"remote", val) == 0) {
1097 if (!checkMode(mode, ID_remote,
"end remote"))
1099 if (!sanityChecks(rem,
name)) {
1103 if (options_getboolean(
"lircd:dynamic-codes")) {
1114 }
else if (mode == ID_codes) {
1115 code = defineCode(key, val, &name_code);
1116 while (!parse_error && val2 != NULL) {
1119 defineNode(
code, val2);
1120 val2 = strtok(NULL, whitespace);
1122 code->current = NULL;
1125 log_error(
"error in configfile line %d:", line);
1129 if (!parse_error && val2 != NULL) {
1131 "%s: garbage after '%s'"
1132 " token in line %d ignored",
1133 rem->
name, val, line);
1138 argc = defineRemote(key, val, val2, rem);
1140 && ((argc == 1 && val2 != NULL)
1141 || (argc == 2 && val2 != NULL && strtok(NULL, whitespace) != NULL))) {
1143 " token in line %d ignored",
1144 rem->
name, key, line);
1148 code = defineCode(key, val, &name_code);
1149 while (!parse_error && val2 != NULL) {
1152 defineNode(
code, val2);
1153 val2 = strtok(NULL, whitespace);
1155 code->current = NULL;
1156 check_ncode_dups(
name,
1164 if (strcasecmp(
"name", key) == 0) {
1166 if (mode == ID_raw_name) {
1169 if (raw_code.
length % 2 == 0) {
1170 log_error(
"error in configfile line %d:",
1178 raw_code.
name = s_strdup(val);
1182 init_void_array(&
signals, 50,
sizeof(lirc_t));
1184 if (!parse_error && val2 != NULL) {
1186 " token in line %d ignored",
1187 rem->
name, key, line);
1190 if (mode == ID_raw_codes) {
1191 log_error(
"no name for signal defined at line %d",
1196 if (!addSignal(&
signals, key))
1198 if (!addSignal(&
signals, val))
1201 if (!addSignal(&
signals, val2))
1203 while ((val = strtok(NULL, whitespace)))
1204 if (!addSignal(&
signals, val))
1210 }
else if (mode == ID_raw_name) {
1211 if (!addSignal(&
signals, key))
1214 log_error(
"error in configfile line %d", line);
1221 if (mode != ID_none) {
1224 if (raw_code.
name != NULL) {
1225 free(raw_code.
name);
1242 static int print_error = 1;
1257 while (rem != NULL) {
1258 if ((!is_raw(rem)) && rem->
flags & REVERSE) {
1266 while (codes->
name != NULL) {
1277 int all_bits = bit_count(rem);
1282 int all_bits = bit_count(rem);
1284 if (has_toggle_bit_mask(rem)) {
1285 log_warn(
"%s uses both toggle_bit and toggle_bit_mask", rem->
name);
1291 if (has_toggle_bit_mask(rem)) {
1292 if (!is_raw(rem) && rem->codes) {
1294 if (rem->toggle_bit_mask_state)
1299 if (is_serial(rem)) {
1302 if (rem->
baud > 0) {
1303 base = 1000000 / rem->
baud;
1304 if (rem->pzero == 0 && rem->
szero == 0)
1306 if (rem->pone == 0 && rem->
sone == 0)
1314 log_warn(
"invalid min_code_repeat value");
1318 calculate_signal_lengths(rem);
1325 void calculate_signal_lengths(
struct ir_remote* remote)
1327 if (is_const(remote)) {
1335 lirc_t min_signal_length = 0, max_signal_length = 0;
1336 lirc_t max_pulse = 0, max_space = 0;
1338 struct ir_ncode* c = remote->codes;
1351 code.code = next->code;
1354 for (repeat = 0; repeat < 2; repeat++) {
1355 if (init_sim(remote, &code, repeat)) {
1359 if (first_sum || sum < min_signal_length)
1360 min_signal_length = sum;
1361 if (first_sum || sum > max_signal_length)
1362 max_signal_length = sum;
1386 }
else if (is_const(remote)) {
1390 log_warn(
"min_gap_length is 0 for '%s' remote",
1397 log_warn(
"max_gap_length is 0 for '%s' remote", remote->
name);
1413 while (remotes != NULL) {
1414 next = remotes->next;
1418 if (remotes->
name != NULL)
1419 free((
void*)(remotes->
name));
1420 if (remotes->codes != NULL) {
1421 codes = remotes->codes;
1422 while (codes->
name != NULL) {
1431 next_node = node->next;
1437 free(remotes->codes);
void *(* array_guest_func)(void *item, void *arg)
foreach_void_array argument.
void * get_void_array(struct void_array *ar)
Return the array dataptr, an array[nr_items] of item_size elements.
int add_void_array(struct void_array *ar, void *dataptr)
Add *dataptr to end of ar, re-allocating as necessary.
const struct flaglist all_flags[]
All flags i config file: Their name and mask.
const lirc_t * send_buffer_data(void)
lirc_t send_buffer_sum(void)
int send_buffer_length(void)
Do not document this function.
void free_config(struct ir_remote *remotes)
Free() an ir_remote instance obtained using read_config().
struct ir_remote * read_config(FILE *f, const char *name)
Parse a lircd.conf config file.
#define SHIFT_ENC
IR data is shift encoded (name obsolete)
#define RAW_CODES
for internal use only
#define RC6
IR data follows RC6 protocol.
#define REPEAT_HEADER
header is also sent before repeat code
#define GRUNDIG
encoding found on Grundig remote
#define BO
encoding found on Bang & Olufsen remote
uint64_t ir_code
Denotes an internal coded representation for an IR transmission.
#define COMPAT_REVERSE
compatibility mode for REVERSE flag
#define SPACE_FIRST
bits are encoded as space+pulse
#define SPACE_ENC
IR data is space encoded.
#define RC5
IR data follows RC5 protocol.
#define NO_FOOT_REP
no foot for key repeats
#define SERIAL
serial protocol
#define NO_HEAD_REP
no header for key repeats
#define CONST_LENGTH
signal length+gap is always constant
#define RCMM
IR data follows RC-MM protocol.
#define log_trace(fmt,...)
Log a trace message.
#define log_notice(fmt,...)
Log a notice message.
#define log_info(fmt,...)
Log an info message.
#define log_trace2(fmt,...)
Log a trace2 message.
#define log_error(fmt,...)
Log an error message.
#define log_trace1(fmt,...)
Log a trace1 message.
logchannel_t
Log channels used to filter messages.
#define log_warn(fmt,...)
Log a warning message.
Description of flag to print.
An ir_code for entering into (singly) linked lists, i.e.
IR Command, corresponding to one (command defining) line of the configuration file.
struct ir_code_node * next
Linked list of the subsequent ir_code's, after the first one.
ir_code code
The first code of the command.
lirc_t * signals
(private)
char * name
Name of command.
One remote as represented in the configuration file.
const char * driver
Name of driver for LIRCCODE cases.
uint32_t repeat_gap
time between two repeat codes if different from gap
lirc_t stwo
2 (only used for RC-MM)
unsigned int freq
modulation frequency
int suppress_repeat
suppress unwanted repeats
unsigned int aeps
detecting very short pulses is difficult with relative tolerance for some remotes,...
uint32_t gap2
time between signals in usecs
lirc_t min_total_signal_length
how long is the shortest signal including gap
unsigned int stop_bits
mapping: 1->2 1.5->3 2->4
unsigned int bits_in_byte
default: 8
struct ir_ncode dyncodes[2]
helper structs for unknown buttons
ir_code rc6_mask
RC-6 doubles signal length of some bits.
lirc_t ptrail
trailing pulse
unsigned int duty_cycle
0<duty cycle<=100 default: 50
lirc_t min_gap_length
how long is the shortest gap
ir_code repeat_mask
mask defines which bits are inverted for repeats
lirc_t srepeat
indicate repeating
ir_code pre_data
data which the remote sends before actual keycode
int bits
bits (length of code)
int post_data_bits
length of post_data
ir_code ignore_mask
mask defines which bits can be ignored when matching a code
lirc_t plead
leading pulse
lirc_t sthree
3 (only used for RC-MM)
ir_code post_data
data which the remote sends after actual keycode
ir_code toggle_mask
Sharp (?) error detection scheme.
unsigned int baud
can be overridden by [p|s]zero, [p|s]one
int min_repeat
code is repeated at least x times code sent once -> min_repeat=0
int manual_sort
If set in any remote, disables automatic sorting.
lirc_t post_s
signal between keycode and post_code
lirc_t pre_s
signal between pre_data and keycode
uint32_t gap
time between signals in usecs
int eps
eps (relative tolerance)
char * dyncodes_name
name for unknown buttons
struct ir_ncode * last_code
code received or sent last
unsigned int min_code_repeat
meaningful only if remote sends a repeat code: in this case this value indicates how often the real c...
const char * name
name of remote control
ir_code toggle_bit_mask
previously only one bit called toggle_bit
unsigned int parity
currently unsupported
int pre_data_bits
length of pre_data
lirc_t max_gap_length
how long is the longest gap
lirc_t max_total_signal_length
how long is the longest signal including gap