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>
* 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>
- 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>
* 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>
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>
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>
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>
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>
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>
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>
Updated the ZFM20 class to use UART functionality provided through the
mraa::Uart class instead of using the UART directly.
* Switch to mraa::Uart
* Added raw uart string constructor, closes#621
* Updated examples
* Added a common.i to minimize interface duplication
* Removed pointers from C++ functions where references are
preferable
* Removed dependency on termios
* Added typedefs to handle pass-by-reference
* Removed flushes
* Removed code after throws
Signed-off-by: Noel Eck <noel.eck@intel.com>
Adding STMicro LIS3DH sensor support. This module is based on
the one for lis2ds12 (thanks, jontrulson!), but as sensors are
noticeably different, the contents underwent major rework.
Examples and basic API are left the same.
Tested on Intel Edison with Arduino board using both I2C and SPI.
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
This commit fixes issue 614. Updated the example to use pyupm_led as
the module name (and skip the local module rename).
Signed-off-by: Noel Eck <noel.eck@intel.com>
Cleanup of UPM C++ examples. Switched from heap allocation to
stack allocation when possible. This simplifies the samples since it
removes the need for explicit memory management. A script was used to
identify and replace pointer use. To simplify the replace script, I
re-formatted the C++ examples using the UPM .clang-format file.
Unfortuantely this changes the look of the UPM C++ examples to a large
degree. However, examples will now have a standard look/feel and
uniform formatting.
* Ran clang-format w/provided UPM .clang-format file
* Removed new's/delete's whenever possible (left those in interface
examples)
* Added IIO sensor library implementation of callback void* arg
* Converted all sleeps to upm defined delays (added header when
necessary)
* Scrubbed CXX example includes
Signed-off-by: Noel Eck <noel.eck@intel.com>
remove utf8 characters from:
* examples/c++/mcp9808.cxx
* examples/c++/tmp006.cxx
* src/bmp280/bmp280.c
* src/max30100/max30100.c
add -j8 options to make command in scripts/sonar-scan.sh
Signed-off-by: Nicolas Oliver <dario.n.oliver@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>
The IMS library will now change its I2C address after resetting the HW to a new
address. It will attempt to close the mraa context and re-init each
time.
Signed-off-by: Noel Eck <noel.eck@intel.com>
and example
LIDAR-Lite v3, a compact, high-performance optical distance measurement
sensor from Garmin™. It is the ideal solution for drone, robot or unmanned
vehicle applications.
The library provided is libupm-lidarlitev3.so
The example provided is lidarlitev3.cxx where it will print the distance
of object/obstacle from the sensor.
The image of the sensor is at docs/images/lidarlitev3.jpg
Signed-off-by: Saloni Jain <saloni.jain@tcs.com>
Signed-off-by: Niti Rohilla <niti.rohilla@tcs.com>
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit provides a basic driver for the Vishay VEML6070 UV
Sensor. Some functionality might be missing. Binding examples have
not been tested as of now.
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
The 00B7 unicode character in 4 of the Java examples can cause warnings
(and possible errors) when compiling. Removed to minimize this risk.
Signed-off-by: Noel Eck <noel.eck@intel.com>