media: lirc: implement scancode sending
authorSean Young <sean@mess.org>
Sat, 25 Feb 2017 11:51:29 +0000 (06:51 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 14 Dec 2017 15:35:15 +0000 (10:35 -0500)
commit9b6192589be788dec73a0e99fe49b8f8ddaf825e
tree0f2482fc765d53e274c58c2d0000168eaa493559
parent4e3cd001fde13dfd4a91888f908b2a07fd0a4047
media: lirc: implement scancode sending

This introduces a new lirc mode: scancode. Any device which can send raw IR
can now also send scancodes.

int main()
{
int mode, fd = open("/dev/lirc0", O_RDWR);

        mode = LIRC_MODE_SCANCODE;
if (ioctl(fd, LIRC_SET_SEND_MODE, &mode)) {
// kernel too old or lirc does not support transmit
}
struct lirc_scancode scancode = {
.scancode = 0x1e3d,
.rc_proto = RC_PROTO_RC5,
};
write(fd, &scancode, sizeof(scancode));
close(fd);
}

The other fields of lirc_scancode must be set to 0.

Note that toggle (rc5, rc6) and repeats (nec) are not implemented. Nor is
there a method for holding down a key for a period.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/ir-lirc-codec.c
drivers/media/rc/rc-core-priv.h
include/media/rc-map.h
include/uapi/linux/lirc.h