cmake_minimum_required(VERSION 2.6)
-project(sensor-plugins-mfld-blackbay CXX)
+project(sensors_bb CXX)
# to install pkgconfig setup file.
SET(EXEC_PREFIX "\${prefix}")
-* Wed Jan 30 2013 Telle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com> submit/tizen_2.0/20130128.082005@ddba03f
-- Rename package to sensor-plugins-mfld-blackbay
-
-* Thu Jan 24 2013 Timo Toikkanen <timo.toikkanen@ixonos.com> accepted/tizen_2.0/20130111.182103@acd54f7
-- Fix for TZSP-4919
-- Updating changelog
-
* Fri Jan 10 2013 Telle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com> submit/trunk/20121023.061641@daf1aa1
- Adding LGPLv2.1 license information
-Name: sensor-plugins-mfld-blackbay
+Name: sf-plugins-bb
Summary: Plugins for sensor framework on blackbay device
-Version: 0.1.0
+Version: 0.0.1
Release: 1
Group: System/Sensor Framework
License: LGPLv2.1
-Source0: %{name}-%{version}.tar.gz
+Source0: sf-plugins-bb-%{version}.tar.gz
Requires: libsf-common
Requires: sensor
Requires: udev
if (!fill_values(struct_type, count, unit, accuracy)) {
DbgPrint("Fill values returned false");
- mValueMutex.unlock();
return -3;
}
void* BaseProcessor::started(void *ctx)
{
- DbgPrint("");
+ //DbgPrint("%p",(void *) ctx);
return ((BaseProcessor *) ctx)->started();
}
case EV_REL:
case EV_ABS:
DbgPrint("%s sensor got input code %d value %d\n",mName.c_str(), event.code, event.value);
- if (event.code < sizeof(mValues)/sizeof(float))
+ if (event.code >= 0 && event.code < sizeof(mValues)/sizeof(float))
mValues[event.code] = event.value;
break;
udev_enumerate *enumerator = NULL;
bool result = false;
struct udev_list_entry *devices = NULL, *dev_list_entry = NULL;
- const char *devicePath = "";
+ const char *devicePath = NULL;
DbgPrint("");
DbgPrint("Sysfs file entry opened");
int writeCount = write(fd,buffer,count);
if (writeCount == count) {
- close(fd);
return true;
}
- close(fd);
}
}
DbgPrint("There was error opening sysfs file %s",strerror(errno));
pollfd pollInfo;
pollInfo.fd = mFd;
pollInfo.events = POLLIN;
- if(poll(&pollInfo,1,2000)){
+ poll(&pollInfo,1,2000);
+
+ if (pollInfo.revents & POLLIN) {
DbgPrint("HAVE POLLIN");
int value;
int readCount = read(mFd,&value,sizeof(int));
pollfd pollInfo;
pollInfo.fd = mFd;
pollInfo.events = POLLIN;
- if (poll(&pollInfo,1,-1)){
- DbgPrint("Poll completed");
+ poll(&pollInfo,1,-1);
+ DbgPrint("Poll completed");
+
+ if (pollInfo.revents & POLLIN) {
int value;
int result = read(mFd,&value,sizeof(int));
if (result > 0) {