summaryrefslogtreecommitdiff
path: root/noncore/tools/remote/lirchandler.cpp
Unidiff
Diffstat (limited to 'noncore/tools/remote/lirchandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/remote/lirchandler.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/noncore/tools/remote/lirchandler.cpp b/noncore/tools/remote/lirchandler.cpp
index 263b740..ec1e275 100644
--- a/noncore/tools/remote/lirchandler.cpp
+++ b/noncore/tools/remote/lirchandler.cpp
@@ -10,32 +10,32 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include <stdio.h> 17#include <stdio.h>
18#include <stdlib.h> 18#include <stdlib.h>
19#include <string.h> 19#include <string.h>
20#include <sys/socket.h> 20#include <sys/socket.h>
21#include <sys/types.h> 21#include <sys/types.h>
22#include <sys/un.h>
23#include <unistd.h> 22#include <unistd.h>
24#include <errno.h> 23#include <errno.h>
25 24
26#include <qstring.h> 25#include <qstring.h>
27#include <qmessagebox.h> 26#include <qmessagebox.h>
28#include <qobject.h> 27#include <qobject.h>
29#include <opie2/oprocess.h> 28#include <opie2/oprocess.h>
29#include <qpe/qcopenvelope_qws.h>
30 30
31#include "lirchandler.h" 31#include "lirchandler.h"
32 32
33#define PACKET_SIZE 256 33#define PACKET_SIZE 256
34#define TIMEOUT 3 34#define TIMEOUT 3
35#define LIRCD_SOCKET "/dev/lircd" 35#define LIRCD_SOCKET "/dev/lircd"
36#define LIRCD_SERVICECMD "/etc/init.d/lircd" 36#define LIRCD_SERVICECMD "/etc/init.d/lircd"
37 37
38using namespace Opie::Core; 38using namespace Opie::Core;
39 39
40LircHandler::LircHandler(void) 40LircHandler::LircHandler(void)
41{ 41{
@@ -259,12 +259,35 @@ bool LircHandler::startLircd(void)
259 return (system(LIRCD_SERVICECMD " start") == 0); 259 return (system(LIRCD_SERVICECMD " start") == 0);
260} 260}
261 261
262bool LircHandler::stopLircd(void) 262bool LircHandler::stopLircd(void)
263{ 263{
264 return (system(LIRCD_SERVICECMD " stop") == 0); 264 return (system(LIRCD_SERVICECMD " stop") == 0);
265} 265}
266 266
267bool LircHandler::isLircdRunning(void) 267bool LircHandler::isLircdRunning(void)
268{ 268{
269 return (OProcess::processPID("lircd") != 0); 269 return (OProcess::processPID("lircd") != 0);
270} 270}
271
272bool LircHandler::setupModules(void)
273{
274 // Remove IrDA modules which get in the way
275 system("rmmod ircomm-tty ircomm");
276 // Load LIRC device driver
277 system("modprobe lirc_sir");
278 return true;
279}
280
281bool LircHandler::cleanupModules(void)
282{
283 // Unload LIRC device driver
284 system("rmmod lirc_sir");
285 // Load IrDA drivers back in
286 system("modprobe ircomm-tty");
287 return true;
288}
289
290void LircHandler::disableIrDA(void)
291{
292 QCopEnvelope e("QPE/IrDaApplet", "disableIrda()");
293}