|
From: Roland M. <rm...@gm...> - 2007-04-08 20:24:16
|
On Sun, 2007-04-08 at 21:46 +0200, Christoph Bartelmus wrote: > Hi! > > Roland Mieslinger "rm...@gm..." wrote: > [...] > > to solve the problem described below, I suggest to create a new ioctl > > LIRC_NOTIFY_DECODE. The idea in principle is to give feedback to the > > user about if an IR signal was decoded an put to the queue successfully. > > I don't belive that the provided patch breaks anything. > > There might be drivers (havn't checked) that generate some log message > if an unsupported ioctl is called. > Before doing the ioctl you should check that the driver actually > supports it. > > Christoph > Hi, that's a good point. I've added a the constant LIRC_SHOULD_NOTIFY_DECODE. Only drivers with this set in the features will get the notification. diff -cr lirc-0.8.1.org/daemons/lircd.c lirc-0.8.1/daemons/lircd.c *** lirc-0.8.1.org/daemons/lircd.c 2006-10-08 12:42:05.000000000 +0200 --- lirc-0.8.1/daemons/lircd.c 2007-04-08 22:06:55.000000000 +0200 *************** *** 1816,1821 **** --- 1816,1824 ---- if(message!=NULL) { + if(hw.ioctl_func && (hw.features & LIRC_SHOULD_NOTIFY_DECODE)) + hw.ioctl_func(LIRC_NOTIFY_DECODE, 0); + len=strlen(message); for (i=0; i<clin; i++) diff -cr lirc-0.8.1.org/drivers/lirc.h lirc-0.8.1/drivers/lirc.h *** lirc-0.8.1.org/drivers/lirc.h 2005-07-10 10:34:12.000000000 +0200 --- lirc-0.8.1/drivers/lirc.h 2007-04-08 22:00:56.000000000 +0200 *************** *** 62,67 **** --- 62,68 ---- #define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE 0x40000000 #define LIRC_CAN_SET_REC_CARRIER_RANGE 0x80000000 + #define LIRC_SHOULD_NOTIFY_DECODE 0x01000000 #define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK) #define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK) *************** *** 100,103 **** --- 101,106 ---- #define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32) #define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32) + #define LIRC_NOTIFY_DECODE _IOW('i', 0x00000020, __u32) + #endif Roland |