This commit moves common SWIG syntax to a ${libname}.i for sensor
libraries. Much of the swig content was originally duplicated for
each wrapper language which has lead to inconsistencies between wrappers
over time. This commit moves all swig syntax to a common file. Language
specific swig syntax can be added with #ifdef SWIG<LANGUAGE>.
The src/CMakeLists.txt will look first for a language-specific .i file,
then fall back to ${libname}.i. In this way, it's possible to override
the common ${libname}.i file. If a fallback .i file does NOT exist,
UPM CMake will generate a simple interface file for all languages.
Example:
If no src/abp/pyupm_abp.i and no src/abp/abp.i then
generate ${CMAKE_CURRENT_BINARY_DIR}/abp.i
When src/CMakeLists.txt uses a common ${libname}.i, it adds a -module
<language>upm_${libname} to the swig command line.
In the example below, a -module argument is provided for both Java and
Javascript, while the python module takes all syntax from pyupm_abp.i.
SWIG FILE Language CMake added SWIG args
--------------- ---------- ---------------------
src/abp/abp.i java -module javaupm_abp
src/abp/abp.i javascript -module jsupm_abp
src/abp/pyupm_abp.i python
This commit removes ~4500 redundant lines for the UPM repository and
helps promote uniformity for the SWIG'ed languages.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Touched on all library brief descriptions for better integration with ISS and fixed a few typos and connection tags in the process.
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Since UPM uses doxy2swig, there is no need for the swig interface
file autodoc for python.
Also, turned on the doxy2swig --quiet switch which cleans up the build
log a tiny bit.
This removes a redundant chunk of documentation from python modules
(per each function).
Old:
def pH(self, samples=15):
+-> """
| pH(DFRPH self, unsigned int samples=15) -> float
|
| Parameters
| ----------
swig| samples: unsigned int
|
| pH(DFRPH self) -> float
|
| Parameters
| ----------
+-> self: upm::DFRPH *
+-> float pH(unsigned int
| samples=15)
|
| Take a number of samples and return the detected pH value. The default
| number of samples is 15.
|
doxy2swig| Parameters:
| -----------
|
| samples: The number of samples to average over, default 15
|
| The pH value detected
| """
+-> return _pyupm_dfrph.DFRPH_pH(self, samples)
New:
def pH(self, samples=15):
+-> """
| float pH(unsigned int
| samples=15)
|
| Take a number of samples and return the detected pH value. The default
| number of samples is 15.
|
doxy2swig| Parameters:
| -----------
|
| samples: The number of samples to average over, default 15
|
| The pH value detected
+-> """
Signed-off-by: Noel Eck <noel.eck@intel.com>
Many of the UPM libraries allocate space on the heap but do not
explicitly handle copying and assignment. This commit uses C++11 delete
to forbit both the copy and assignment operator for these classes.
The C++ examples which used assignment operators to initialize class
instances were also updated since it did not appear necessary in those
cases to use the assignment operator.
Signed-off-by: Noel Eck <noel.eck@intel.com>
* Updated pom file generation: Generate pom files after all sensor
library targets have been created - allows for dependencies
* Changes for compiling on Android
* Check for mraa build options: Look at symbols in mraa library to
determine UPM build options (example: mraa_iio_init, mraa_firmata_init)
* Add per target summary for C/C++/java/nodejs/python
* Added hierarchy to fti include directory...
old: #include "upm_voltage.h"
new: #include "fti/upm_voltage.h"
* Removed unimplemented methods from mpu9150 library and java example
* Add utilities-c target for all c examples. Most of the C examples
rely on the upm_delay methods. Add a dependency on the utilities-c
target for all c examples.
* Updated the examples/CMakeLists.txt to add dependencies passed via
TARGETS to the target name parsed from the example name. Also updated
the interface example names to start with 'interfaces'.
* Updated src/examples/CMakeLists.txt to ALWAYS remove examples from the
example_src_list (moved this from end of function to beginning).
Signed-off-by: Noel Eck <noel.eck@intel.com>
Updated descriptions on four headers. One header needed a description.
Replaced 'driver' with 'library' on the other three.
Signed-off-by: Noel Eck <noel.eck@intel.com>
In an effort to clean-up and standardize UPM library
documentation, this commit updates (and in most cases,
unifies) the CMake description string AND CXX header
@comname string.
Strings were taken from datasheets when possible, spelling
mistakes were addressed, copy/paste errors where fixed,
Title Case was used, etc.
* Tested/updated/added @web tags
* Added/updated invalid sensor images
* Added/updated @man tags, added missing manufacturers
Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit attempts to use a more cmake-friendly approach when
handling inter-target dependencies. A combination of macros and
include_directories usage provided overzealous compile -I/blah
entries which equates to large catch-all build commands. For
example, the last CXX target contains include directories for nearly
all preceeding targets (~190). Library dependencies were also often
wrong or missing.
* Removed nearly all used of include_directories (swig cmake
commands still appear to need these for generating the swig
command line)
* Updated usage of target_link_libraries in upm_module_init,
also changed to using target_include_directories per target.
This greatly simplifies upm/mixed_module_init usage for libraries
which depend on other libraries (in this project).
example (src/tb7300/CMakeLists.txt)
old:
# upm-libbacnetmstp will bring in libbacnet, I hope
set (reqlibname "upm-bacnetmstp")
include_directories(${BACNET_INCLUDE_DIRS})
include_directories("../bacnetmstp")
upm_module_init()
upm_target_link_libraries(${libname} bacnetmstp)
new:
upm_module_init(bacnetmstp)
The reason here, is that tb7300 depends on bacnetmstp, which
depends on BACNET includes/libs, so tb7300 gets the headers and
libraries transitively via its dependency on bacnetmstp.
* Updated pkg-config .pc file generation flow to reflect changes
with dependencies.
* Create a real target for the interfaces (CXX abstract sensor
classes). Renamed the directory from 'upm/src/upm' to
'upm/src/interfaces' Also changed the install location of the
interface headers to include/upm/interfaces. Updated interface
header usage to reflect this.
* Updated a few sensor libs to use fwd declarations for mraa.
Ideally the UPM libs would do more of this which eases the
burden on anyone building on top of the sensor libraries since
they would not need to know about mraa headers.
* Fixed examples which use symbols not defined in local includes
Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit touches a subset of UPM sensors which contain C source.
Cleaned up the CMakeLists.txt DESCRIPTION field to better represent
the library.
Signed-off-by: Noel Eck <noel.eck@intel.com>
This driver implements support for the DFRobot MMA7361 analog
accelerometer. It supports 3 axes with a selectable 1.5G and 6G
sensitivity. It is not really meant for navigation, but rather for
uses such as orientation and freefall detection.
Signed-off-by: Jon Trulson <jtrulson@ics.com>