mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
rcinput: fix set_rc_hw() after dynamic devices patch
...this could use some tests... :-)
This commit is contained in:
committed by
M. Liebmann
parent
0df5a8df7f
commit
41958cc029
@@ -1846,8 +1846,18 @@ void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address)
|
||||
printf("[rcinput:%s] indev is empty!\n", __func__);
|
||||
return;
|
||||
}
|
||||
//fixme?: for now fd_rc[] is hardcoded to 0 since only fd_rc[0] is used at the moment
|
||||
ioctl_ret = ::ioctl(indev[0].fd, IOC_IR_SET_PRI_PROTOCOL, ir_protocol);
|
||||
int fd = -1;
|
||||
for (std::vector<in_dev>::iterator it = indev.begin(); it != indev.end(); ++it) {
|
||||
if ((*it).path == "/dev/input/nevis_ir") {
|
||||
fd = (*it).fd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (fd == -1) {
|
||||
printf("[rcinput:%s] no nevis_ir input device found??\n", __func__);
|
||||
return;
|
||||
}
|
||||
ioctl_ret = ::ioctl(fd, IOC_IR_SET_PRI_PROTOCOL, ir_protocol);
|
||||
if(ioctl_ret < 0)
|
||||
perror("IOC_IR_SET_PRI_PROTOCOL");
|
||||
else
|
||||
@@ -1857,7 +1867,7 @@ void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address)
|
||||
if(ir_address > 0)
|
||||
{
|
||||
//fixme?: for now fd_rc[] is hardcoded to 0 since only fd_rc[0] is used at the moment
|
||||
ioctl_ret = ::ioctl(indev[0].fd, IOC_IR_SET_PRI_ADDRESS, ir_address);
|
||||
ioctl_ret = ::ioctl(fd, IOC_IR_SET_PRI_ADDRESS, ir_address);
|
||||
if(ioctl_ret < 0)
|
||||
perror("IOC_IR_SET_PRI_ADDRESS");
|
||||
else
|
||||
|
Reference in New Issue
Block a user