author | harlekin <harlekin> | 2002-05-12 08:39:15 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-05-12 08:39:15 (UTC) |
commit | 8362e586d0fd9a0ad6cea3f26d624a05196a60f8 (patch) (unidiff) | |
tree | 82bd5b113cd9f526c6555888cffbfdd907406eb9 /noncore/tools/remote/remote.cpp | |
parent | 28e86f19c9da68dca417b531e63e534c4545916b (diff) | |
download | opie-8362e586d0fd9a0ad6cea3f26d624a05196a60f8.zip opie-8362e586d0fd9a0ad6cea3f26d624a05196a60f8.tar.gz opie-8362e586d0fd9a0ad6cea3f26d624a05196a60f8.tar.bz2 |
opie remote control
Diffstat (limited to 'noncore/tools/remote/remote.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/tools/remote/remote.cpp | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/noncore/tools/remote/remote.cpp b/noncore/tools/remote/remote.cpp new file mode 100644 index 0000000..7972def --- a/dev/null +++ b/noncore/tools/remote/remote.cpp | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | ||
3 | Copyright (C) 2002 Thomas Stephens | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | ||
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | ||
7 | version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | ||
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
11 | Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | ||
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
15 | */ | ||
16 | |||
17 | #include <qpe/qpeapplication.h> | ||
18 | #include <qpe/resource.h> | ||
19 | #include <qpe/config.h> | ||
20 | #include <qpushbutton.h> | ||
21 | #include <qtabwidget.h> | ||
22 | #include <qlayout.h> | ||
23 | #include <qmessagebox.h> | ||
24 | #include <qpaintdevice.h> | ||
25 | #include <qobject.h> | ||
26 | #include <sys/socket.h> | ||
27 | #include <sys/types.h> | ||
28 | #include <sys/un.h> | ||
29 | #include <unistd.h> | ||
30 | #include <stdio.h> | ||
31 | #include <signal.h> | ||
32 | |||
33 | #include "mainview.h" | ||
34 | |||
35 | /*void reconnect(int &fd) | ||
36 | { | ||
37 | //struct sockaddr_un addr; | ||
38 | |||
39 | addr.sun_family=AF_UNIX; | ||
40 | strcpy(addr.sun_path,"/dev/lircd"); | ||
41 | fd = socket(AF_UNIX, SOCK_STREAM, 0); | ||
42 | |||
43 | if(connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) | ||
44 | { | ||
45 | QMessageBox *mb = new QMessageBox("error", | ||
46 | "couldnt connect to socket", | ||
47 | QMessageBox::NoIcon, | ||
48 | QMessageBox::Ok, | ||
49 | QMessageBox::NoButton, | ||
50 | QMessageBox::NoButton); | ||
51 | mb->exec(); | ||
52 | } | ||
53 | } | ||
54 | */ | ||
55 | |||
56 | int main( int argc, char **argv ) | ||
57 | { | ||
58 | QPEApplication a( argc, argv ); | ||
59 | MainView w; | ||
60 | |||
61 | int fd; | ||
62 | //struct sockaddr_un addr; | ||
63 | //char read_buffer[BUFFERSIZE+1]; | ||
64 | //char write_buffer[] = "LIST\n"; | ||
65 | |||
66 | //addr.sun_family=AF_UNIX; | ||
67 | //strcpy(addr.sun_path,"/dev/lircd"); | ||
68 | //fd = socket(AF_UNIX, SOCK_STREAM, 0); | ||
69 | |||
70 | //printf("fd1: %d\n", fd); | ||
71 | /* | ||
72 | if(connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) | ||
73 | { | ||
74 | QMessageBox *mb = new QMessageBox("error", | ||
75 | "couldnt connect to socket", | ||
76 | QMessageBox::NoIcon, | ||
77 | QMessageBox::Ok, | ||
78 | QMessageBox::NoButton, | ||
79 | QMessageBox::NoButton); | ||
80 | mb->exec(); | ||
81 | } | ||
82 | */ | ||
83 | |||
84 | //printf("%d\n", write(fd, write_buffer, sizeof(write_buffer) ) ); | ||
85 | |||
86 | //printf("%d\n", read(fd, read_buffer, BUFFERSIZE ) ); | ||
87 | |||
88 | //QMessageBox *mbtest = new QMessageBox("lirc test", | ||
89 | // *new QString((const char *) read_buffer), | ||
90 | // QMessageBox::NoIcon, | ||
91 | // QMessageBox::Ok, | ||
92 | // QMessageBox::NoButton, | ||
93 | // QMessageBox::NoButton); | ||
94 | //mbtest->exec(); | ||
95 | |||
96 | a.setMainWidget( &w ); | ||
97 | w.setIRSocket(fd); | ||
98 | w.showMaximized(); | ||
99 | return a.exec(); | ||
100 | } | ||