From 07884e12c9f03f79257518869266d039abf8b921 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 22 Jan 2018 23:17:34 +0100 Subject: [PATCH] try to fix rc over webif on hd51 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a21fb645acf1b113ae09f00cc430a23a37a58717 Author: Jacek Jendrzej Date: 2018-01-22 (Mon, 22 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index ce8c49fb3..0b1e7cc79 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -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 */