1983 Commits

Author SHA1 Message Date
Noel Eck
0223cd2b85 C++ Core: Add base class per sensor/actuator type
Adding base classes for UPM sensors and actuators.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-02 11:01:18 -07:00
Antoine W. Campagna
b55501e327 kx122: Note return method change in apichanges.md
Updated the API documentation with changes to the kx122.  Removed a few
extra EOL spaces.

Signed-off-by: Antoine W. Campagna <AntoineW@Campagna.org>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-02 10:38:03 -07:00
Antoine W. Campagna
e99f1d73fd kx122: Return values instead of receiving pointers
For better compatibility with Python

Signed-off-by: Antoine W. Campagna <AntoineW@Campagna.org>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-02 09:56:27 -07:00
Noel Eck
fc56e56048 SWIGPYTHON: Apply unsigned int to uints for python
To handle uint data types in python bindings, apply unsigned int
globally.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-02 09:56:27 -07:00
Noel Eck
757683b2ca Cordova: Renamed cmake Find module for bindings
Renamed find module from FindCordova to FindUpmCordovaGenerator to be
more descriptive with the intent of the find module.  Updated the find
module to use find_package_handle_standard_args so a version can be
specified and handle REQUIRED keyword.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-02 09:45:48 -07:00
Noel Eck
b09944f4b8 Cordova: Added cordova job to travis matrix
The UPM Travis-CI will now attempt to build the Cordova bindings for
UPM as a separate target.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-02 09:45:24 -07:00
Lin Sun
f45429e1f0 cordova: Add UPM cordova binding via Java packages
The UPM Cordova binding generator creates Cordova plugs for each Java
package when BUILDCORDOVA=ON and BUILDSWIGJAVA=ON.  This requires an NPM
install of the UPM Cordova plugin generator.  Cordova bindings are built
under <build-dir>/cordova.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-02 09:42:12 -07:00
Antoine W. Campagna
54c6d294af kx122: Allow faster SPI bus frequency
The hardcoded frequency of 10kHz was much slower than the capacity of the device

Signed-off-by: Antoine W. Campagna <AntoineW@Campagna.org>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-30 09:58:06 -07:00
Noel Eck
83f541a5db Tsl2561_Example: Removed duplicate Tsl2561_Example
It appears that an additional tsl2561 Java example existed.
Removed the *newer* Tsl2561_Example.java in favor of the original
example.  Updated all corresponding collateral which references the
Tsl2561_Example.java file (CMake and library descriptor file).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-19 10:39:26 -07:00
Noel Eck
090ce2040e ctest: Add module path to sys path
Updated the pythonloader test module to always append the module's path
to the system path.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-15 11:10:00 -07:00
Noel Eck
76dd42a47d utilities_tests: Update us range for gtest
Be a bit more lenient with the acceptable range for the microsecond
flavor of upm_delay (+/- 150us instead of +/- 100us).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 15:25:24 -07:00
Noel Eck
63c3b4bc69 travis-ci: Added minimal travis job
Added an additional job to the CI matrix which does a minimal UPM
build (only C, C++, and unit tests) which can run and pass/fail quickly.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 15:08:51 -07:00
Noel Eck
7254d5f75e gtest: Added custom target for all unit tests
Create a target which depends on all unit test executables for ease of
building/running.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 15:08:15 -07:00
Noel Eck
f907ebcf2e mraa: Temporarily turn off deprecated warnings
MRAA deprecated mraa_gpio_use_mmaped which gets flagged as a warning
in UPM and then fails since -Werror is set.

For now, don't flag deprecations as warnings.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 14:48:53 -07:00
Alex Tereschenko
334f7365f0 sonar-scan.sh: correct SonarCloud URL
According to SonarCloud's email notification,
they're dropping sonarqube.com in favor of sonarcloud.io.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-05 11:37:50 -08:00
Noel Eck
41e80d611e json: Added nlohmann's JSON C++ header
Adding JSON header for serializing/deserializing library descriptor JSON
files.

    * Added header
    * Added simple unit test to verify functionality

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-02 16:19:04 -08:00
Noel Eck
92b0919f56 gtest: Added Google Test
Added Google Test for unit testing.  Currently NOT required by UPM
CMake.

    * Added a test fixture for the utilities library.
    * Fixed bug in delay methods provided by utilities library.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-02 12:03:24 -08:00
Noel Eck
c54d6de054 JAVA: Unified Java Example names
Unified all Java examples to *match* <LIBRARY>[_otherstuf]_Example.java.
Note, a handful of the examples have a pseudo-random string for the
first component (see FlexSensor_Example.java, ideally this would be
Flex_Example.java).

This commit allows for quick development on a single sensor library
since a -DMODULE_LIST=mysensorlib now works with Java examples
(previously Java examples would fail generation when using
MODULE_LIST).

    * Renamed examples
    * Updated class names
    * Updated library descriptor .json files
    * Updated sample mapping file

TODO: Make this work like the C/C++ examples - grab the target library
name from the filename and grab all dependencies from that target
library.  Fix the handful of example names which don't conform.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-27 15:28:48 -08:00
Noel Eck
86e8471cad kx122: Disable implicit copy/assignment operators
Don't let a KX122 instance be copied since copies would share the C
device pointer.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-27 09:42:09 -08:00
Noel Eck
2c17998ac9 android: Fix for java file check
Skip library build directories which don't have any java files.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-26 15:20:31 -08:00
Noel Eck
a43bcfe8d2 kx122: Add Java/Javascript/Python examples
Implemented a swig interface file for the kx122 and added corresponding
swig language examples.  Also added an STL vector flavor for getting
acceleration values from the kx122.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-26 14:36:06 -08:00
Noel Eck
1be36ec1df kx122: Small fix-ups for kx122 addition
A few small changes for the kx122 library.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-26 10:34:35 -08:00
Samuli Rissanen
e4dd6457bb kx122: Added missing function implementation
Signed-off-by: Samuli Rissanen samuli.rissanen@hotmail.com
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-23 20:21:43 +02:00
Samuli Rissanen
ad36f83857 kx122: Moved definitions, documentation tweaks
Signed-off-by: Samuli Rissanen <samuli.rissanen@hotmail.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-23 13:17:37 +02:00
Samuli Rissanen
2a17fe094e kx122: Added C and C++ examples
Signed-off-by: Samuli Rissanen <samuli.rissanen@hotmail.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-22 13:21:01 +02:00
Samuli Rissanen
8f99289a48 kx122: Added driver files to src
Signed-off-by: Samuli Rissanen <samuli.rissanen@hotmail.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-22 13:04:31 +02:00
Noel Eck
829da899fc docs: Updated doc dependencies for all languages
This commit changes how the UPM doc targets build.  The doc targets no
longer rebuild each time.

    * doc (doxygen) target depends only on C/C++ source
    * jsdoc (yuidoc) depends on doc and a stamp file
    * pydoc (sphinx) depends on the output index.xml from doc
    * pyupm_doxy2swig depends on python2 python extensions

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-21 15:08:03 -08:00
Noel Eck
20aa4962f0 SWIG: Moved common SWIG syntax to ${libname}.i
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>
2018-02-21 10:51:44 -08:00
Noel Eck
3d674efb51 CTest: Removed failing JSON lint test
Currently failing since a dependency has been deprecated.  Will enable
once a solution is in place.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-20 14:58:05 -08:00
Mihai Tudor Panu
cc7fec9ae0 upm: version 1.6.0
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
v1.6.0
2018-02-20 07:45:15 -08:00
Mihai Tudor Panu
4a1eb99d6d doxygen: updated library brief description tags
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>
2018-02-14 11:33:09 -08:00
Mihai Tudor Panu
a12baf379f doxygen: updated descriptions to clean up @con tags for xml generation
This ensures the generated xml paragraphs for the connection field won't have nested children and hence should be readable by the ISS parser properly

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-02-13 11:37:08 -08:00
Noel Eck
38817b72dc pydoc: Fixed mix of python2/3 modules with pydoc
The pydoc target copies python binaries and modules to pyupm.  Since the
find command didn't make a distinction between python2/3 modules, a mix
of each could end up in pyupm.  If sphinx runs under a mismatching
interpreter (mismatching against the python binaries) the build would
fail with load errors

    * Only copy python2 modules (and binaries) to pyupm directory
    * Explicitly run the sphinx tools w/python2
    * Removed doc dependency to each library target (not needed).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-12 16:15:59 -08:00
Noel Eck
fe7bd75c91 C: Fixes for sign compares in C libraries
Added explicit error for sign compares to CMake.  Updated a handful of C
source which compared unsigned vs signed.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-07 14:29:35 -08:00
Noel Eck
460fdc2eb5 Travis-ci: Switch from curl to wget for automation
Currently ~2/5 UPM travis-ci jobs are failing with an SSL error from curl
when grabbing the 1.9.0 version of docker-compose.  This commit is a
brute-force attempt to make this go away.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-07 14:11:10 -08:00
Mihai Tudor Panu
9d51454290 FindNodejs: extend search path to detect ubuntu provided nodejs
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-02-07 10:36:42 -05:00
Noel Eck
6f72c52a44 CMake: Update FindNpm module and usage
FindNpm REQUIRE functionality was not provided by FindNpm.cmake.
UpdatedUpdated FindNpm to extract version, global node_modules
directory, and to fail if REQUIRE was set and npm was not found.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-06 14:11:28 -08:00
Noel Eck
7d83e8c569 FindNodejs: Updated to find node<version>
Updates to the FindNodejs.cmake module to find newer installs of nodejs
across other distros.  For example openSUSE: /usr/include/node6/node.h

    * Added PATH_SUFFIX to find_path for node.h.
    * Standardized usage of message() (added STATUS)
    * Call find_package_handle_standard_args with version
    * Reformatted to look uniform.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-06 09:35:57 -08:00
Alex Tereschenko
96bcfc9128 lis2ds12: remove surplus accFactor coefficient
As we've established in PR #623 (adding lis3dh support), this coefficient
is not needed and actually is cancelled out in calculations, so remove it.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2018-01-28 11:00:27 +01:00
Noel Eck
6be656d5b0 Java: Added loadLibrary macro for packages
These four libaries were previously blacklisted for building Java
packages.  Updating to include loadLibrary macro.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 14:55:44 -08:00
Noel Eck
3cfea676e2 lcd: Renamed 'i2clcd' library to 'lcd'
All other upm library directories match their corresponding library
name, the i2clcd was an outlier which caused problems for CMake and
testing.

    * Replaced usage of i2clcd with lcd
    * Renamed source files and examples
    * Updated examples to use correct class
    * Updated documentation where necessary (left changelog sections)

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 13:00:53 -08:00
Noel Eck
f64060b9d2 pydoc: Removed include for sensor specific _doc.i files
There is a single monolithic .i file which provides documentation for
the python methods.  The per-sensor flow is not used.  Removing for now,
may investigate implementing a per-sensor doc.i file again in the future.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 11:55:54 -08:00
Noel Eck
36ebd15abc java_blacklist: Enable Java blacklisted modules
Enable building java wrappers for a few that were previously
blacklisted.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 11:55:54 -08:00
Noel Eck
23a57b8c90 nrf24l01: Initialize member variable
Initialize a member variable pointer to NULL.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 10:42:05 -08:00
Noel Eck
666452e873 SWIGJAVA: Remove the last JAVA ifdefs from src
Removed all references to #ifdef SWIGJAVA and JAVACALLBACK from the
library source.  All java-specific source code has been moved to the
corresponding library's .i file for java.

    * Update library source
    * Update examples where necessary
    * The function pointer methodology has been remove from libraries
      which provided callbacks as both a class and a function pointer
      implementation.  Examples were updated to use the class version
      of callbacks.
    * Updated documentation for SWIGJAVA

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 09:31:05 -08:00
Noel Eck
d49ab2ac95 SWIG: Added documentation to _upm.i
Includes documentation on the macros provided as well as a top-level
description of the file.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 09:31:05 -08:00
Noel Eck
d06e632f3b SWIG: Move from include->import
Do no expose _upm.i in the wrapper code.  Also updated syntax to use a
relative path to _upm.i.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 09:31:05 -08:00
Serban Waltter
e192a125f3 Added new macros for installISR and applied where possible. 2018-01-24 09:31:05 -08:00
Serban Waltter
63b2b33df7 Moved SWIG code from C++ files (hpp and cxx) to SWIG interface files (.i). Added getter/setter methods for classes with protected or private vars. 2018-01-24 09:31:05 -08:00
Serban Waltter
2551596309 Added the JAVA_JNI_LOADLIBRARY macro for the jniclasscode pragma included in _upm.i for all java SWIG interface files. 2018-01-24 09:31:05 -08:00