try to fix rc over webif on hd51

Origin commit data
------------------
Branch: ni/coolstream
Commit: a21fb645ac
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2018-01-22 (Mon, 22 Jan 2018)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2018-01-22 23:17:34 +01:00
committed by vanhofen
parent ac6c382a7c
commit 07884e12c9

View File

@@ -890,6 +890,17 @@ void CControlAPI::RebootCGI(CyhookHandler *hh)
}
//-----------------------------------------------------------------------------
void dev_uinput_sync(int fd) {
struct input_event ev;
gettimeofday(&ev.time, NULL);
ev.type = EV_SYN;
ev.code = SYN_REPORT;
ev.value = 0;
write(fd, &ev, sizeof(ev));
}
int CControlAPI::rc_send(int ev, unsigned int code, unsigned int value)
{
struct input_event iev;
@@ -943,12 +954,14 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh)
close(evd);
return;
}
dev_uinput_sync(evd);
if (rc_send(evd, sendcode, KEY_RELEASED) < 0) {
perror("writing 'KEY_RELEASED' event failed");
hh->SendError();
close(evd);
return;
}
dev_uinput_sync(evd);
close(evd);
#else
/* 0 == KEY_PRESSED in rcinput.cpp */