summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-06-21 13:56:23 (UTC)
committer mickeyl <mickeyl>2005-06-21 13:56:23 (UTC)
commit65ea54f43ee7dcbd95ffb474c8dfbb8b076d43e5 (patch) (unidiff)
tree00439d8a397bfa4147e5fd26baec01f619f384c3
parenta1f2f34836103ef80b3e11f5183a96218f7ea215 (diff)
downloadopie-65ea54f43ee7dcbd95ffb474c8dfbb8b076d43e5.zip
opie-65ea54f43ee7dcbd95ffb474c8dfbb8b076d43e5.tar.gz
opie-65ea54f43ee7dcbd95ffb474c8dfbb8b076d43e5.tar.bz2
- repair broken headers (tss...)
- fix logical error in ODevice::sendSuspendmsg() - send qcop signal returnFromSuspend() after resuming from suspend - remove debug macro from opcmciasystem; better do this from the .pro file with DEFINES +=
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp48
-rw-r--r--libopie2/opiecore/device/odevice_abstractmobiledevice.cpp21
-rw-r--r--libopie2/opiecore/linux/linux.pro1
-rw-r--r--libopie2/opiecore/linux/opcmciasystem.cpp2
4 files changed, 36 insertions, 36 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index dd1e2f3..5e91d8b 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -1,36 +1,36 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3 =. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org>
4 Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org>
5 =.
6 .=l. 4 .=l.
7           .>+-= 5           .>+-=
8 _;:,     .>    :=|. This program is free software; you can 6 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; version 2 of the License.
13     ._= =}       : or (at your option) any later version. 11     ._= =}       :
14    .%`+i>       _;_. 12    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 13    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 18..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 19++=   -.     .`     .: details.
22:     =  ...= . :.=- 20 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 21 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 22  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 23    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 24 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 25 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27
29*/ 28*/
30 29
30
31#include "odevice_beagle.h" 31#include "odevice_beagle.h"
32#include "odevice_ipaq.h" 32#include "odevice_ipaq.h"
33#include "odevice_jornada.h" 33#include "odevice_jornada.h"
34#include "odevice_ramses.h" 34#include "odevice_ramses.h"
35#include "odevice_simpad.h" 35#include "odevice_simpad.h"
36#include "odevice_yopy.h" 36#include "odevice_yopy.h"
@@ -691,13 +691,13 @@ void ODevice::virtual_hook(int, void* ){
691 * Call this in your custom \sa suspend() Method 691 * Call this in your custom \sa suspend() Method
692 * before going to suspend. 692 * before going to suspend.
693 * 693 *
694 */ 694 */
695void ODevice::sendSuspendmsg() 695void ODevice::sendSuspendmsg()
696{ 696{
697 if ( isQWS() ) 697 if ( !isQWS() )
698 return; 698 return;
699 699
700 QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); 700 QCopEnvelope ( "QPE/System", "aboutToSuspend()" );
701} 701}
702 702
703/** 703/**
diff --git a/libopie2/opiecore/device/odevice_abstractmobiledevice.cpp b/libopie2/opiecore/device/odevice_abstractmobiledevice.cpp
index f3f6af5..fe5864b 100644
--- a/libopie2/opiecore/device/odevice_abstractmobiledevice.cpp
+++ b/libopie2/opiecore/device/odevice_abstractmobiledevice.cpp
@@ -1,22 +1,18 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3              Copyright (C) 2004, 2005 Holger Hans Peter Freyther <freyther@handhelds.org> 3 Copyright (C) 2004, 2005 Holger Hans Peter Freyther <freyther@handhelds.org>
4 Copyright (C) 2004, 2005 Michael 'mickey' Lauer <mickeyl@handhelds.org> 4 =. Copyright (C) 2004, 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
5 Copyright (C) 2002, 2003 Robert Griebl <sandman@handhelds.org> 5 .=l. Copyright (C) 2002, 2003 Robert Griebl <sandman@handhelds.org>
6
7
8 =.
9 .=l.
10           .>+-= 6           .>+-=
11 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
12.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
13:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
14.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
15 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; version 2 of the License.
16     ._= =}       : or (at your option) any later version. 12     ._= =}       :
17    .%`+i>       _;_. 13    .%`+i>       _;_.
18    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
19     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
20    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
21    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
22  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
@@ -30,12 +26,14 @@
30 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
31 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
32*/ 28*/
33 29
34#include "odevice_abstractmobiledevice.h" 30#include "odevice_abstractmobiledevice.h"
35 31
32#include <qpe/qcopenvelope_qws.h>
33
36#include <sys/time.h> 34#include <sys/time.h>
37#include <sys/ioctl.h> 35#include <sys/ioctl.h>
38 36
39#include <time.h> 37#include <time.h>
40#include <fcntl.h> 38#include <fcntl.h>
41#include <unistd.h> 39#include <unistd.h>
@@ -61,13 +59,14 @@ void OAbstractMobileDevice::setAPMTimeOut( int time ) {
61 59
62bool OAbstractMobileDevice::suspend() { 60bool OAbstractMobileDevice::suspend() {
63 if ( !isQWS( ) ) // only qwsserver is allowed to suspend 61 if ( !isQWS( ) ) // only qwsserver is allowed to suspend
64 return false; 62 return false;
65 63
66 bool res = false; 64 bool res = false;
67 ODevice::sendSuspendmsg(); 65
66 QCopEnvelope( "QPE/System", "aboutToSuspend()" );
68 67
69 struct timeval tvs, tvn; 68 struct timeval tvs, tvn;
70 ::gettimeofday ( &tvs, 0 ); 69 ::gettimeofday ( &tvs, 0 );
71 70
72 ::sync(); // flush fs caches 71 ::sync(); // flush fs caches
73 res = ( ::system ( "apm --suspend" ) == 0 ); 72 res = ( ::system ( "apm --suspend" ) == 0 );
@@ -81,12 +80,14 @@ bool OAbstractMobileDevice::suspend() {
81 ::usleep ( 200 * 1000 ); 80 ::usleep ( 200 * 1000 );
82 ::gettimeofday ( &tvn, 0 ); 81 ::gettimeofday ( &tvn, 0 );
83 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < m_timeOut ); 82 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < m_timeOut );
84 } 83 }
85 84
86 return res; 85 return res;
86
87 QCopEnvelope( "QPE/System", "returnFromSuspend()" );
87} 88}
88 89
89//#include <linux/fb.h> better not rely on kernel headers in userspace ... 90//#include <linux/fb.h> better not rely on kernel headers in userspace ...
90 91
91// _IO and friends are only defined in kernel headers ... 92// _IO and friends are only defined in kernel headers ...
92#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) 93#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 ))
diff --git a/libopie2/opiecore/linux/linux.pro b/libopie2/opiecore/linux/linux.pro
index c396e59..c0c4f7f 100644
--- a/libopie2/opiecore/linux/linux.pro
+++ b/libopie2/opiecore/linux/linux.pro
@@ -5,6 +5,7 @@ HEADERS += \
5 5
6SOURCES += \ 6SOURCES += \
7 linux/ofilenotify.cpp \ 7 linux/ofilenotify.cpp \
8 linux/oinputsystem.cpp \ 8 linux/oinputsystem.cpp \
9 linux/opcmciasystem.cpp 9 linux/opcmciasystem.cpp
10 10
11DEFINES += OPCMCIA_DEBUG=1
diff --git a/libopie2/opiecore/linux/opcmciasystem.cpp b/libopie2/opiecore/linux/opcmciasystem.cpp
index eae356e..445d903 100644
--- a/libopie2/opiecore/linux/opcmciasystem.cpp
+++ b/libopie2/opiecore/linux/opcmciasystem.cpp
@@ -46,14 +46,12 @@ using namespace Opie::Core;
46#include <sys/types.h> 46#include <sys/types.h>
47#include <sys/stat.h> 47#include <sys/stat.h>
48#include <unistd.h> 48#include <unistd.h>
49 49
50#define PROC_DEVICES "/proc/devices" 50#define PROC_DEVICES "/proc/devices"
51 51
52// #define OPCMCIA_DEBUG 1
53
54/*====================================================================================== 52/*======================================================================================
55 * OPcmciaSystem 53 * OPcmciaSystem
56 *======================================================================================*/ 54 *======================================================================================*/
57 55
58OPcmciaSystem* OPcmciaSystem::_instance = 0; 56OPcmciaSystem* OPcmciaSystem::_instance = 0;
59 57