The purpose of the templatesensor is to get contributors up and running
faster when adding a new sensor.
* Created library named 'sensortemplate'
* Added C++ source
* Added swig interface files for java, javascript, and python
* Added sensortemplate image file
* Added examples for c++, java, javascript, and python
* Updated contributions.md with steps to create a new sensor from
the sensortemplate library.
Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit translates C++ interfaces to Java interfaces, previously C++ Interfaces implemented java classes.
* Added java swig interface files for all C++ interfaces to simplify swig
javaupm_iADC.i
javaupm_iCO2Sensor.i
javaupm_iHumiditySensor.i
javaupm_iLightController.i
javaupm_iLightSensor.i
javaupm_iModuleStatus.i
javaupm_interfaces.i
javaupm_iPressureSensor.i
javaupm_iTemperatureSensor.i
<example Usage>
%include"../interfaces/javaupm_iADC.i"
* Modified swig interface files for few sensors that implements interfaces
ads1x15
bmp280
bmpx8x
ds1808lc
hlg150h
lp8860
max44009
ms5611
si1132
si7005
t6713
* Removed few methods that were mentioned Protected and made them public, so that menthods can be overridden
* Made IModuleStatus virtual to avoid ambiguity in multiple inheritance
For example
class A {};
class B : public A {};
class C : public A {};
class D : public B, public C {};
This can be solved as
class A {};
class B : virtual public A {};
class C : virtual public A {};
class D : public B, public C {};
* Modified java interface files to support multiple swig versions
* Modified javaupm interface file to support standard auto load library code
* Fixed autoloadlibrary tests for interfaces
* Created one interface example separately <BME280_InterfaceExample.java>,
<example Usage>
BME280_InterfaceExample.java
since we cann't define swig versions inside java example file.
So, instaed added swig versions in Cmake.
<example Usage>
if (SWIG_VERSION VERSION_GREATER 3.0.8)
add_example_with_path(BME280_InterfaceExample bmp280 bmp280)
endif()
Signed-off-by: sisinty sasmita patra <sisinty.s.patra@intel.com>
This commit attempts to use a more cmake-friendly approach when
handling inter-target dependencies. A combination of macros and
include_directories usage provided overzealous compile -I/blah
entries which equates to large catch-all build commands. For
example, the last CXX target contains include directories for nearly
all preceeding targets (~190). Library dependencies were also often
wrong or missing.
* Removed nearly all used of include_directories (swig cmake
commands still appear to need these for generating the swig
command line)
* Updated usage of target_link_libraries in upm_module_init,
also changed to using target_include_directories per target.
This greatly simplifies upm/mixed_module_init usage for libraries
which depend on other libraries (in this project).
example (src/tb7300/CMakeLists.txt)
old:
# upm-libbacnetmstp will bring in libbacnet, I hope
set (reqlibname "upm-bacnetmstp")
include_directories(${BACNET_INCLUDE_DIRS})
include_directories("../bacnetmstp")
upm_module_init()
upm_target_link_libraries(${libname} bacnetmstp)
new:
upm_module_init(bacnetmstp)
The reason here, is that tb7300 depends on bacnetmstp, which
depends on BACNET includes/libs, so tb7300 gets the headers and
libraries transitively via its dependency on bacnetmstp.
* Updated pkg-config .pc file generation flow to reflect changes
with dependencies.
* Create a real target for the interfaces (CXX abstract sensor
classes). Renamed the directory from 'upm/src/upm' to
'upm/src/interfaces' Also changed the install location of the
interface headers to include/upm/interfaces. Updated interface
header usage to reflect this.
* Updated a few sensor libs to use fwd declarations for mraa.
Ideally the UPM libs would do more of this which eases the
burden on anyone building on top of the sensor libraries since
they would not need to know about mraa headers.
* Fixed examples which use symbols not defined in local includes
Signed-off-by: Noel Eck <noel.eck@intel.com>
These changes add the ability to intialize a speaker instance to use a
PWM pin instead of a standard GPIO pin in order to emit sounds.
The current GPIO functionality is fairly constrained by the
implementation -- it only permits playing cerain hardcoded "notes".
The PWM support allows one to emit specific frequencies (currently
between 50-32Khz) using a PWM pin. Of course, you may still be
constrained by the limits of your PWM hardware in the end.
There are a few new functions provided to support this PWM mode. To
use the PWM mode of speaker, use the speaker_init_pwm() initialization
routine instead of speaker_init() (for C). For C++ and the SWIG
languages, pass "true" as the second argument to the constructor to
enable PWM mode. The default is "false", to match current default
behavior (GPIO).
Functions that are not related to a given mode (GPIO vs. PWM) will do
nothing if not usable in that mode.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
uartat is the underlying UART driver, specifically for use with
AT-style command driven devices like modems.
The le910 support is provided in the form of examples that make use
of the uartat driver to interact with the device.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Previously, the C++ and C versions of this driver were separate. Now
the C++ implementation wraps the C implementation.
In addition, the C++ init() function has been deprecated. It
currently does nothing, and examples have been modified to remove it's
calls. This function will be removed in a separate release.
The examples have been further modified to update all detected devices
and print their respective temperatures, instead of only reporting the
on the first device detected.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
* CMake option to enable -Werror as default
* Change to make sure all cxx examples have correct target name
* Added PUBLIC CXX compiler flags to ads1x15 and ozw targets to
work around compiler warnings
* Renamed cmake variable for compiler warnings
Signed-off-by: Noel Eck <noel.eck@intel.com>
Make these just a bit more interesting - continuously change color
and keep updating the lcd. Also, echo the write via printf.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Added C/CXX warning messages similar to MRAA (w/ -Werror).
* Added syslog warning for missing switch cases
* Cleaned up uint vs int usage
* Fixed redifinition errors for C structs
* Added virtual destructors for base classes
* Removed redundant CMAKE_CXX_FLAGS from COMPILE_FLAGS for all three
wrapper languages. The CMAKE_CXX_FLAGS were showing up twice in
the compile commands for the wrappers.
* Added CMake WERROR option to enable/disable warnings as errors for
all targets.
* Disable a handful of compiler warnings for the wrapper cxx files,
this minimizes the number of warnings from auto-generated code).
Signed-off-by: Noel Eck <noel.eck@intel.com>
* Grouped UPM python modules into upm directory, for example:
/usr/local/lib/python2.7/dist-packages/upm
* Updated UPM example import statements
* Removed unused RPATH statements from UPM src CMakeLists.txt,
currently build collateral contains an explicit RPATH which
is stripped from the install collateral.
* Converted python examples to work on both python2 AND python3
* Added ctest for loading examples w/python3
* Removed returns from swig macros
* UPM python module use will change...
Before:
import pyupm_dfrph
After:
from upm import pyupm_dfrph
or
import upm.pyupm_dfrph
etc...
* This commit fixes#468
Signed-off-by: Noel Eck <noel.eck@intel.com>
* Moved body of each python example to main. This allows for basic
load module testing for CI
* General cleanup of python modules (crlf/tabs/prints/etc)
* Chmod'ed to 755 to allow running examples without specifying the
python interpreter
* Added ctest for loading python2/3 modules
* Added jniclasscode pragma for java swig interface files.
* Updated check_examplenames.py module to check all languages vs. a
cxx example name
* Added tests for checking python module and test loading
* Added 'make test' to travis-ci run (run ctests)
* Print a more meaningful message when not building cxx docs into
python modules
* Updated check_clean.py to only check java wrapper files
* ENABLED ctests for UPM
* Deleted using_carrays.py python example - this is covered by other
examples
Signed-off-by: Noel Eck <noel.eck@intel.com>
This adds SPI support to the BMI160, as well as a C driver and a C
example. In addition, some changes were made to more properly detect
and handle errors.
Functions supplied by the bosch_bmi160 driver source code is also
exported and made available to callers who want more than what the
basic driver support. Bus access methods (I2C and SPI) are also now
exposed to both C and C++.
Signed-off-by: Jon Trulson <jtrulson@ics.com>