2156 Commits

Author SHA1 Message Date
Noel Eck
ef81a20140 gtest: Added headers to unit tests
Added missing headers for the C++ unit tests.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-07-18 13:51:01 -07:00
Khem Raj
8a617aa904 upm: musl and gcc8 fixes
gcc8 detects that strncpy is overwiritng the null terminating character
the source strings are already initialized to 0 so memcpy would do the same
job

Fixes
rn2903.c:153:5: error: 'strncpy' output may be truncated copying 16 bytes from a string of length 511 [-Werror=stringop-truncation]
     strncpy(dev->hardware_eui, dev->resp_data, RN2903_MAX_HEX_EUI64);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

include sys/types.h for uint definition

uint is defined in sys/types.h, therefore this
header needs to be included, it gets exposed with
musl where this header is not getting included indirectly
as it is happening when building on glibc

Fixes build errors on musl e.g.
upm/src/kx122/kx122.hpp:456:31: error: 'uint' has not been declared
|        void setBufferThreshold(uint samples);
|                                ^~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-07-13 13:36:39 -07:00
Noel Eck
a16d279b6f bma220: Added std_vector to SWIG interface file
Updated the bma220 SWIG interface file to use std_vector.i for JS and
Python.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-07-02 15:14:47 -07:00
Noel Eck
3e84b74bdf kxtj3: A few last-minute changes to the kxtj3 src
* Removed trailing whitespace
    * Fixed a few spelling errors
    * Switched to upm_delay_us for C source

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-21 10:33:38 -07:00
Assam Boudjelthia
186bbfab76 kxtj3: Add java/python/javascript examples
* Java/Python/Javascript examples
* change usleep to upm_delay_us in C++ example
* Add Java example to CMakeLists

Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-21 10:04:36 -07:00
Assam Boudjelthia
01cc3a0734 kxtj3: fixed requested issues
* Virtual destructor
* Add header guards
* Constructor default values
* Remove methods with pointer parameters in C++ code

Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-21 10:04:24 -07:00
Assam Boudjelthia
09e536b4ff kxtj3: C/C++ driver implementation with examples
Kionix tri-axis accelerometer sensor driver
* C implementation
* C++ wrapper
* C/C++ examples

Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-21 09:59:37 -07:00
Noel Eck
dc45cd7859 kx122: Adding missing header guards
Added pragma once to both headers.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-14 14:17:47 -07:00
Noel Eck
3790c0bbc1 rsc.py: Added snippet to test rsc_regs.h types
Since UPM Travis-CI runs ctests (one of which loads python examples),
the added lines would fail if the RSC_DATA_RATE and RSC_MODE have not
been included in the python rsc module.)

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-08 14:14:47 -07:00
Noel Eck
7a2332fa7d nrf8001: Updated to the mixed module init method
A few small changes to the nrf8001 which exposes a bit more via SWIG.
Also removed a method which had no implementation.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-08 14:14:47 -07:00
Noel Eck
330c94f1e2 CMake: Expose *_regs.h to SWIG wrappers
Some of the UPM libraries have a common C header with types used in both
the C and C++ source.  This commit adds these common header files to the
SWIG modules.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-08 14:14:47 -07:00
Noel Eck
9a959b578c nmea_gps: Added str method for coordinate struct
Provide a method to print out a coordinate structure which can be
dropped into online mapping pages.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-01 10:20:00 -07:00
Noel Eck
cdfb68c381 nmea_gps: Handle different GGA structure
Testing against ublox - handle null age of differential GPS.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-01 09:59:55 -07:00
Noel Eck
6228498147 nmea_gps: Added parsing TXT and bw calculations
Added code to parse GPTXT nmea sentences.  Added methods to calculate
sentences/second and raw bytes/second.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-25 15:51:13 -07:00
Noel Eck
8b4e1020f4 nmea_gps: Fix iterator
Small fixes for new nmea_gps code.  Fixed an iterator which could get
dereferenced incorrectly, and changed an auto to an explicit type.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-23 20:52:57 -07:00
Noel Eck
3a077df5f6 nmea_gps: Update to handle parsing into structures
NMEA GPS class now uses threads to handle parsing NMEA sentences.
Currently only handles GGA, GSV, and GLL types.  Added queues for
holding parsed data.

    * Parsing thread
    * Parse GPS Fix from GGA and GLL
    * Parse satellite info from GSV
    * Provide a queue for GPS fix data as well as raw sentences
      (for debugging)
    * Target structures and NMEAGPS class have a __str__() method
      which summarizes the objects into a std::string.  These are
      tied to the __str__ method in python
    * Added google unit test for the above functionality

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-23 08:30:22 -07:00
Noel Eck
1b5087105b docker-compose.yaml: Default to empty build type
Allow targets to specify a CMake build type but do not set a default
(removed 'Release').  The CXX flags for Release slow the builds down
significantly on Travis-CI (which can hit the time limit for jobs).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-14 14:30:49 -07:00
Noel Eck
ec9143e976 debug/release: Add minimal debug/release CI builds
This commit enables both a minimal DEBUG and minimal RELEASE build on
Travis-CI.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-14 10:08:22 -07:00
Mihai Tudor Panu
37642f3b01 bmx055: fix typo in cmakelists causing bmc150 header not to install
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-05-03 11:37:59 -07:00
Noel Eck
17110d41d0 mhz16: Remove post-throw returns + small fixes
Removed the 'return false;' lines after throws since these are not
needed and are generally flagged by static analysis tools.  Also removed
a EOL spaces and added initializers for member variables at declaration
(since more than one constructor exists).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-27 11:34:49 -07:00
g-vidal
dd73c4aa45 mhz16: Adding raw path constructor for UART
This commit adds an additional constructor to the MHZ16 which takes a
path (string reference) to a UART device on the filesystem.

    Example: MHZ16("/dev/ttyS0");

    * Added constructor for device path w/default
    * Removed unused global consts from header

Signed-off-by: g-vidal <gerard.vidal@ens-lyon.fr>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-27 11:17:47 -07:00
Noel Eck
8f63914d76 docs: Clarification for lib-level 'make-install'
While a 'make install' under a target library directory (build/src/lcd)
will build all dependencies required to make the target, it will NOT
install those dependencies.  This can cause confusion for developers.
Adding a note to the build docs to clarify this case.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-17 15:37:12 -07:00
Noel Eck
306872619a examples: Remove double-backslash from install path
This commit removes the double-backslash when installing the examples.

Before:
   .../upm//examples/...

Before:
   .../upm/examples/...

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-16 10:42:23 -07:00
Noel Eck
ad15b27cb1 kx122: Fix for uninitialized variable w/release
Fix so a release build doesn't flag reg_val as uninitialized.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-04-06 16:03:08 -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