summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index ed705a6..cf2061b 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -470,97 +470,97 @@ OLedState ODevice::ledState ( OLed /*which*/ ) const
/**
* Set the state for a LED
* @param which Which OLed to use
* @param st The state to set
* @return success or failure
*/
bool ODevice::setLedState ( OLed which, OLedState st )
{
Q_UNUSED( which )
Q_UNUSED( st )
return false;
}
/**
* @return if the device has a light sensor
*/
bool ODevice::hasLightSensor() const
{
return false;
}
/**
* @return a value from the light sensor
*/
int ODevice::readLightSensor()
{
return -1;
}
/**
* @return the light sensor resolution
*/
int ODevice::lightSensorResolution() const
{
return 0;
}
/**
* @return if the device has a hinge sensor
*/
bool ODevice::hasHingeSensor() const
{
return false;
}
/**
* @return a value from the hinge sensor
*/
-OHingeStatus ODevice::readHingeSensor()
+OHingeStatus ODevice::readHingeSensor()const
{
return CASE_UNKNOWN;
}
/**
* @return a list with CPU frequencies supported by the hardware
*/
const QStrList &ODevice::allowedCpuFrequencies() const
{
return *d->m_cpu_frequencies;
}
/**
* Set desired CPU frequency
*
* @param index index into d->m_cpu_frequencies of the frequency to be set
*/
bool ODevice::setCurrentCpuFrequency(uint index)
{
if (index >= d->m_cpu_frequencies->count())
return false;
char *freq = d->m_cpu_frequencies->at(index);
qWarning("set freq to %s", freq);
int fd;
if ((fd = ::open("/proc/sys/cpu/0/speed", O_WRONLY)) >= 0) {
char writeCommand[50];
const int count = sprintf(writeCommand, "%s\n", freq);
int res = (::write(fd, writeCommand, count) != -1);
::close(fd);
return res;
}
return false;
}
/**
* @return a list of hardware buttons
*/
const QValueList <ODeviceButton> &ODevice::buttons()
{
initButtons();
return *d->m_buttons;