linux/drivers/media
Sean Young de142c3241 media: lirc: implement reading scancode
This implements LIRC_MODE_SCANCODE reading from the lirc device. The
scancode can be read from the input device too, but with this interface
you get the rc protocol, keycode, toggle and repeat status in addition
to just the scancode.

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

	mode = LIRC_MODE_SCANCODE;
	if (ioctl(fd, LIRC_SET_REC_MODE, &mode)) {
		// kernel too old or lirc does not support transmit
	}
	struct lirc_scancode scancode;
	while (read(fd, &scancode, sizeof(scancode)) == sizeof(scancode)) {
		printf("protocol:%d scancode:0x%x toggle:%d repeat:%d\n",
			scancode.rc_proto, scancode.scancode,
			!!(scancode.flags & LIRC_SCANCODE_FLAG_TOGGLE),
			!!(scancode.flags & LIRC_SCANCODE_FLAG_REPEAT));
	}
	close(fd);
}

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-14 10:35:20 -05:00
..
cec media: cec: disable the hardware when unregistered 2017-12-08 11:11:25 -05:00
common media: siano: fix a potential integer overflow 2017-12-14 09:50:12 -05:00
dvb-core media: dvb_ca_en50221: sanity check slot number from userspace 2017-12-14 09:51:17 -05:00
dvb-frontends media: dvb-frontends/stv0910: remove unneeded dvb_math.h include 2017-12-13 08:37:58 -05:00
firewire
i2c media: i2c: enable i2c IR for hardware which isn't HD-PVR 2017-12-14 09:58:20 -05:00
mmc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci media: merge ir_tx_z8f0811_haup and ir_rx_z8f0811_haup i2c devices 2017-12-14 09:58:20 -05:00
platform media: xilinx-video: fix bad of_node_put() on endpoint error 2017-12-14 09:54:25 -05:00
radio media: radio-si476x: fix behavior when seek->range* are defined 2017-12-11 13:04:51 -05:00
rc media: lirc: implement reading scancode 2017-12-14 10:35:20 -05:00
spi
tuners media: tda18250: support for new silicon tuner 2017-12-13 08:12:47 -05:00
usb media: merge ir_tx_z8f0811_haup and ir_rx_z8f0811_haup i2c devices 2017-12-14 09:58:20 -05:00
v4l2-core media: drivers: media: remove duplicate includes 2017-12-13 09:58:39 -05:00
Kconfig media: rc-core: do not depend on MEDIA_SUPPORT 2017-08-20 09:39:36 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
media-device.c media: drop use of MEDIA_API_VERSION 2017-08-08 06:03:15 -04:00
media-devnode.c media: utilize new cdev_device_add helper function 2017-03-21 06:44:33 +01:00
media-entity.c [media] media: Check for active and has_no_links overrun 2017-10-04 17:16:14 -03:00