summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-29 15:50:21 (UTC)
committer sandman <sandman>2002-10-29 15:50:21 (UTC)
commitbad66a2ea2aea8bec1c7895b0e1a461e2f4859c2 (patch) (unidiff)
tree6a39587f58ff01456fff0a6d17d5564d28bb4f4f
parent6224d462ef211b3b4cffa42d4a7f261caa92834b (diff)
downloadopie-bad66a2ea2aea8bec1c7895b0e1a461e2f4859c2.zip
opie-bad66a2ea2aea8bec1c7895b0e1a461e2f4859c2.tar.gz
opie-bad66a2ea2aea8bec1c7895b0e1a461e2f4859c2.tar.bz2
added lightSensorResolution() to get the hardware resolution of the light
sensor
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp12
-rw-r--r--libopie/odevice.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 9f64fc0..4c49c4f 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -86,6 +86,7 @@ public:
86 86
87 virtual bool hasLightSensor ( ) const; 87 virtual bool hasLightSensor ( ) const;
88 virtual int readLightSensor ( ); 88 virtual int readLightSensor ( );
89 virtual int lightSensorResolution ( ) const;
89 90
90 //virtual QValueList <int> keyList ( ) const; 91 //virtual QValueList <int> keyList ( ) const;
91 92
@@ -369,6 +370,10 @@ int ODevice::readLightSensor ( )
369 return -1; 370 return -1;
370} 371}
371 372
373int ODevice::lightSensorResolution ( ) const
374{
375 return 0;
376}
372 377
373//QValueList <int> ODevice::keyList ( ) const 378//QValueList <int> ODevice::keyList ( ) const
374//{ 379//{
@@ -682,8 +687,7 @@ bool iPAQ::hasLightSensor ( ) const
682{ 687{
683 return true; 688 return true;
684} 689}
685#include <errno.h> 690
686#include <string.h>
687int iPAQ::readLightSensor ( ) 691int iPAQ::readLightSensor ( )
688{ 692{
689 int fd; 693 int fd;
@@ -707,6 +711,10 @@ int iPAQ::readLightSensor ( )
707 return val; 711 return val;
708} 712}
709 713
714int iPAQ::lightSensorResolution ( ) const
715{
716 return 256;
717}
710 718
711/************************************************** 719/**************************************************
712 * 720 *
diff --git a/libopie/odevice.h b/libopie/odevice.h
index be2a9c7..e07b91c 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -135,6 +135,7 @@ public:
135 135
136 virtual bool hasLightSensor ( ) const; 136 virtual bool hasLightSensor ( ) const;
137 virtual int readLightSensor ( ); 137 virtual int readLightSensor ( );
138 virtual int lightSensorResolution ( ) const;
138 139
139 //virtual QValueList <int> keyList ( ) const; 140 //virtual QValueList <int> keyList ( ) const;
140}; 141};