merge with master
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:03:27 +0000 (01:03 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:03:27 +0000 (01:03 +0900)
CMakeLists.txt
packaging/sf-plugins-bb.changes [moved from packaging/sensor-plugins-mfld-blackbay.changes with 79% similarity]
packaging/sf-plugins-bb.spec [moved from packaging/sensor-plugins-mfld-blackbay.spec with 86% similarity]
src/baseprocessor.cpp
src/lightprocessor.cpp
src/proxiprocessor.cpp

index eede785..31a8780 100644 (file)
@@ -1,5 +1,5 @@
 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}")
similarity index 79%
rename from packaging/sensor-plugins-mfld-blackbay.changes
rename to packaging/sf-plugins-bb.changes
index 17f381a..41863fe 100644 (file)
@@ -1,10 +1,3 @@
-* 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
 
similarity index 86%
rename from packaging/sensor-plugins-mfld-blackbay.spec
rename to packaging/sf-plugins-bb.spec
index d730ba4..8fab54e 100644 (file)
@@ -1,10 +1,10 @@
-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
index faf8c51..8b905a8 100644 (file)
@@ -209,7 +209,6 @@ int BaseProcessor::get_struct_value(unsigned int struct_type , void *struct_valu
 
      if (!fill_values(struct_type, count, unit, accuracy)) {
           DbgPrint("Fill values returned false");
-          mValueMutex.unlock();
           return -3;
      }
 
@@ -232,7 +231,7 @@ int BaseProcessor::get_struct_value(unsigned int struct_type , void *struct_valu
 
 void* BaseProcessor::started(void *ctx)
 {
-     DbgPrint("");
+     //DbgPrint("%p",(void *) ctx);
      return ((BaseProcessor *) ctx)->started();
 }
 
@@ -273,7 +272,7 @@ void BaseProcessor::process_input_events(const std::vector<input_event*> &events
           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;
 
@@ -391,7 +390,7 @@ const char *BaseProcessor::find_device_from_udev(const char *driver)
      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("");
 
@@ -468,10 +467,8 @@ bool BaseProcessor::writeToSysfs(const char *filename, const char *buffer, int c
                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));
index 2cec8d7..58b09b8 100644 (file)
@@ -132,7 +132,9 @@ void* LightProcessor::started()
      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));
index 42b8a97..cb2f8b2 100644 (file)
@@ -99,8 +99,10 @@ void* ProxiProcessor::started()
      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) {