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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>