aboutsummaryrefslogtreecommitdiffstats
path: root/utils/keytable/keytable.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-07-30 20:04:28 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-07-30 20:04:28 (GMT)
commit6c09cc89441f9f38ecaee69e69cfde7a2663c9a4 (patch)
tree772d906cd8da28398eb9ae62ad439fb414e3a7f4 /utils/keytable/keytable.c
parentcc713ab7fb620c98b80e2f3f0aef8f01faf35ac3 (diff)
keytable: Add support to enable/disable LIRC protocol
Maybe the better would be to have a separate option for LIRC, but, for now, let's handle it as just one additional protocol, since it make the changes easier. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'utils/keytable/keytable.c')
-rw-r--r--utils/keytable/keytable.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index 7b2f0db..5e3f968 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -68,6 +68,7 @@ enum ir_protocols {
NEC = 1 << 2,
JVC = 1 << 3,
SONY = 1 << 4,
+ LIRC = 1 << 5,
OTHER = 1 << 31,
};
@@ -411,6 +412,8 @@ static error_t parse_opt(int k, char *arg, struct argp_state *state)
ch_proto |= JVC;
else if (!strcasecmp(p,"sony"))
ch_proto |= SONY;
+ else if (!strcasecmp(p,"lirc"))
+ ch_proto |= LIRC;
else
goto err_inval;
p = strtok(NULL, ",;");
@@ -840,6 +843,8 @@ static enum ir_protocols v2_get_protocols(struct rc_device *rc_dev, char *name)
proto = JVC;
else if (!strcmp(p, "sony"))
proto = SONY;
+ else if (!strcmp(p, "lirc")) /* Only V2 has LIRC support */
+ proto = LIRC;
else
proto = OTHER;
@@ -887,6 +892,9 @@ static int v2_set_protocols(struct rc_device *rc_dev)
if (rc_dev->current & SONY)
fprintf(fp, "+sony\n");
+ if (rc_dev->current & LIRC)
+ fprintf(fp, "+lirc\n");
+
if (rc_dev->current & OTHER)
fprintf(fp, "+unknown\n");
@@ -910,6 +918,8 @@ static void show_proto( enum ir_protocols proto)
fprintf (stderr, "JVC ");
if (proto & SONY)
fprintf (stderr, "SONY ");
+ if (proto & LIRC)
+ fprintf (stderr, "LIRC ");
if (proto & OTHER)
fprintf (stderr, "other ");
}

Privacy Policy