summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Schmidt <Helmut.3.Schmidt@continental-corporation.com>2016-02-16 09:21:40 +0100
committerHelmut Schmidt <Helmut.3.Schmidt@continental-corporation.com>2016-02-16 09:21:40 +0100
commit5b6b120d836259afb57b3ad6bf2f6ba8107c4a3e (patch)
tree9f9c69edae6496a089ea5c241e428ff1999f6ff2
parent3d0c171238b824cb2a50b33c3d6c0a8b2f044d6f (diff)
downloadpositioning-5b6b120d836259afb57b3ad6bf2f6ba8107c4a3e.tar.gz
gnss-status.h: correct copy/paste error in doxygen comment
-rw-r--r--gnss-service/api/gnss-status.h20
-rw-r--r--sensors-service/src/i2ccomm.cpp44
2 files changed, 51 insertions, 13 deletions
diff --git a/gnss-service/api/gnss-status.h b/gnss-service/api/gnss-status.h
index a7318b5..c9b21e3 100644
--- a/gnss-service/api/gnss-status.h
+++ b/gnss-service/api/gnss-status.h
@@ -70,28 +70,28 @@ typedef struct {
} TGNSSStatus;
/**
-* Callback type for gnss status.
-* Use this type of callback if you want to register for gnss status updates data.
-* @param status the gnss status
+* Callback type for GNSS status.
+* Use this type of callback if you want to register for GNSS status updates data.
+* @param status the GNSS status
*/
typedef void (*GNSSStatusCallback)(const TGNSSStatus *status);
/**
-* Method to get the gyroscope status at a specific point in time.
-* @param status After calling the method the current gyroscope status is written into status
+* Method to get the GNSS status at a specific point in time.
+* @param status After calling the method the current GNSS status is written into status
* @return Is true if data can be provided and false otherwise, e.g. missing initialization
*/
bool gnssGetStatus(TGNSSStatus* status);
/**
-* Register gnss status callback.
-* This is the recommended method for continuously monitoring the gyroscope status.
-* The callback will be invoked when new gyroscope status data is available.
+* Register GNSS status callback.
+* This is the recommended method for continuously monitoring the GNSS status.
+* The callback will be invoked when new GNSS status data is available.
* @param callback The callback which should be registered.
* @return True if callback has been registered successfully.
*/
bool gnssRegisterStatusCallback(GNSSStatusCallback callback);
/**
-* Deregister gnss status callback.
-* After calling this method no new gnss status updates will be delivered to the client.
+* Deregister GNSS status callback.
+* After calling this method no new GNSS status updates will be delivered to the client.
* @param callback The callback which should be deregistered.
* @return True if callback has been deregistered successfully.
*/
diff --git a/sensors-service/src/i2ccomm.cpp b/sensors-service/src/i2ccomm.cpp
index 4a87bb8..6c057e4 100644
--- a/sensors-service/src/i2ccomm.cpp
+++ b/sensors-service/src/i2ccomm.cpp
@@ -22,12 +22,49 @@
//linux i2c access
#ifndef I2C_NOT_AVAILABLE
-#include <linux/i2c-dev.h> //RPi: located in /usr/include/linux/i2c-dev.h - all functions inline
+//RPi: located in /usr/include/linux/i2c-dev.h - all functions inline
+#include <linux/i2c-dev.h>
//Unfortunately, there are two files named "i2c-dev.h" out there
-//Only the one provided by packages libi2c-dev or i2c-tools provides all necessary definitions
+//Only the one provided by packages libi2c-dev or i2c-tools
+//provides all necessary definitions
// http://lxr.free-electrons.com/source/Documentation/i2c/dev-interface?v=3.7
// http://raspberrypi.stackexchange.com/questions/37689/how-do-i-use-the-i2c-bus
-//So we have to test explicitly and set #define I2C_NOT_AVAILABLE if the wrong header is available
+//The original header file is from the standard package linux-glibc-devel
+//which comes along with gcc and does neither define I2C_M_RD
+//nor provide the i2c_smbus_ functions
+//However I2C_M_RD is defined in /usr/include/linux/i2c.h,
+//also from linux-glibc-devel
+//
+//Some more details on this mess:
+//The i2c-dev.h comes originally from lm-sensors.org, the home of i2c-tools
+//Since a while they have fixed the problem that i2c-dev.h is overwritten
+//See https://web.archive.org/web/20150319191005/http://lm-sensors.org/wiki/I2CTools_4_Plan
+//See also http://www.lm-sensors.org/changeset/6054/
+//where the i2c_smbus_ function are moved to a new header file /us/include/i2c/smbus.h
+//Unfortunately
+//a) http://www.lm-sensors.org is down since late 2015
+//parts orf the content are still available at archive.org
+//e.g. https://web.archive.org/web/20150614020413/http://www.lm-sensors.org/browser/i2c-tools/trunk/include/linux/i2c-dev.h)
+//b) the fix has not been backported by many distributions
+//So the current situation is that
+//i) Debian/Raspbian Jessie still have the buggy solution where i2c-dev.h is overwritten
+//See https://packages.debian.org/jessie/libi2c-dev
+//Same is to be expected for Ubuntu
+//See http://packages.ubuntu.com/search?keywords=libi2c-dev
+//Same is for openSUSE 13.2
+//See https://build.opensuse.org/package/show?project=openSUSE%3A13.2&package=i2c-tools
+//ii) on openSUSE 42.1, i2c-dev.h is no longer overwritten, instead smbus.h is provided
+//See https://build.opensuse.org/package/show?project=openSUSE%3ALeap%3A42.1&package=i2c-tools
+//See https://build.opensuse.org/request/show/339965
+//See http://lists.opensuse.org/archive/opensuse-commit/2015-10/msg00918.html
+//Same is for Arch Linux
+//See https://aur.archlinux.org/packages/i2c-tools-svn/
+//
+//The final solution could be to get I2C_M_RD from /usr/include/linux/i2c.h
+//and avoid using the i2c_smbus_ functions
+//
+//For now we have to test explicitly and set #define I2C_NOT_AVAILABLE
+//if the wrong header is available
#ifndef I2C_M_RD
//seems that the wrong i2c-dev.h version has been included
#define I2C_NOT_AVAILABLE
@@ -35,6 +72,7 @@
#warning "Please install correct version, typically available in packages libi2c-dev or i2c-tools"
#endif
#endif
+
//standard c library functions
#include <unistd.h>
#include <fcntl.h>