Newer compilers when used with security hardening options such as
-Werror=maybe-uninitialized so iniitial the variables to 0.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
mraa_led_init API expects led number. So, replace it with
mraa_led_init_raw for initializing an LED based on label.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Fedora now ships upm 1.7.0 for Fedora 28 and later so include these
details to enable easier consumption by Fedora mraa/upm.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
In v8 API 6.5 the long deprecated IdleNotification has been removed so we
need to use IdleNotificationDeadline as nodejs 10.x uses newer v8.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
The memory mapped GPIO function calls have been deprecated and in turn removed from the UPM libraries. MRAA now provides the best/fastest GPIO access possible based on the selected platform/pin automatically.
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Fixes below issues:
tm1637.cxx:69:29: error: "%2d%02d" directive output may be truncated writing between 5 and 15 bytes into a destination of size 5 [-Werror=format-truncation=]
snprintf(myTime, 5, "%2d%02d", (hour + timezone + 24) % 24, min);
jhd1313m1.c:65:49: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Werror=format-truncation=]
snprintf(str, sizeof(str), "Hello World %d", ndx);
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This removes unnecessary uint8 types from C driver structs that prevented some sensors from being initialized when connected to a MRAA subplatform.
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
* Examples for C/C++/Python/Java/JavaScript
* Add Java example to CMakeLists
Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
* Main C implementation
* C++ wrapper on C implementation
Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
- Examples for C/C++/Python/Java/JavaScript
- Add build line for java BH1792_Example
Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
- Base C implementation, with all features and measurement modes (interrupts uses ISR)
- C++ wrapper around C implementation
Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Default to MONOTONIC clock for timer methods to avoid falling victim to
clock corrections. Changed signatures from accepting pointers since
this is not needed an complicates calls and Java/JS/Python bindings.
* Switched from nanosleep to clock_nanosleep to allow developers to
provide a clock for LINUX
* Default upm_clock_init to CLOCK_MONOTONIC
* Updated logic to calculating delay and elapsed to be more readable
* Added ns flavors for completeness
* Refactored all upm_* delay/timer methods
* Added #else for preprocessor cases w/o an #else
* Added test for AQI
* Added test fixture with logic to identify a minimum delay time
which is used as a metric for testing all delay methods
* Much more lenient unit testing of delays to minimize false CI
failures
Signed-off-by: Noel Eck <noel.eck@intel.com>
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>