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>
This commit moves common SWIG syntax to a ${libname}.i for sensor
libraries. Much of the swig content was originally duplicated for
each wrapper language which has lead to inconsistencies between wrappers
over time. This commit moves all swig syntax to a common file. Language
specific swig syntax can be added with #ifdef SWIG<LANGUAGE>.
The src/CMakeLists.txt will look first for a language-specific .i file,
then fall back to ${libname}.i. In this way, it's possible to override
the common ${libname}.i file. If a fallback .i file does NOT exist,
UPM CMake will generate a simple interface file for all languages.
Example:
If no src/abp/pyupm_abp.i and no src/abp/abp.i then
generate ${CMAKE_CURRENT_BINARY_DIR}/abp.i
When src/CMakeLists.txt uses a common ${libname}.i, it adds a -module
<language>upm_${libname} to the swig command line.
In the example below, a -module argument is provided for both Java and
Javascript, while the python module takes all syntax from pyupm_abp.i.
SWIG FILE Language CMake added SWIG args
--------------- ---------- ---------------------
src/abp/abp.i java -module javaupm_abp
src/abp/abp.i javascript -module jsupm_abp
src/abp/pyupm_abp.i python
This commit removes ~4500 redundant lines for the UPM repository and
helps promote uniformity for the SWIG'ed languages.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Touched on all library brief descriptions for better integration with ISS and fixed a few typos and connection tags in the process.
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Since UPM uses doxy2swig, there is no need for the swig interface
file autodoc for python.
Also, turned on the doxy2swig --quiet switch which cleans up the build
log a tiny bit.
This removes a redundant chunk of documentation from python modules
(per each function).
Old:
def pH(self, samples=15):
+-> """
| pH(DFRPH self, unsigned int samples=15) -> float
|
| Parameters
| ----------
swig| samples: unsigned int
|
| pH(DFRPH self) -> float
|
| Parameters
| ----------
+-> self: upm::DFRPH *
+-> float pH(unsigned int
| samples=15)
|
| Take a number of samples and return the detected pH value. The default
| number of samples is 15.
|
doxy2swig| Parameters:
| -----------
|
| samples: The number of samples to average over, default 15
|
| The pH value detected
| """
+-> return _pyupm_dfrph.DFRPH_pH(self, samples)
New:
def pH(self, samples=15):
+-> """
| float pH(unsigned int
| samples=15)
|
| Take a number of samples and return the detected pH value. The default
| number of samples is 15.
|
doxy2swig| Parameters:
| -----------
|
| samples: The number of samples to average over, default 15
|
| The pH value detected
+-> """
Signed-off-by: Noel Eck <noel.eck@intel.com>
Ensure all src C++ headers which have corresponding C++ examples have
doxygen tags which point to those examples. Some were missing, some
were invalid, some needed to be updated to match the new example names.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Moved the SWIG version check from each sensor library .i file to
the base SWIG .i file (per interface). This cleans up the number
of #if SWIG_VERSION's across the code base, and will make cleanup
of these easier at a later date.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Documentation script was failing when parsing swig file. Added
a space in the ads1x15 java swig file to make the doc parser happy.
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>
In an effort to clean-up and standardize UPM library
documentation, this commit updates (and in most cases,
unifies) the CMake description string AND CXX header
@comname string.
Strings were taken from datasheets when possible, spelling
mistakes were addressed, copy/paste errors where fixed,
Title Case was used, etc.
* Tested/updated/added @web tags
* Added/updated invalid sensor images
* Added/updated @man tags, added missing manufacturers
Signed-off-by: Noel Eck <noel.eck@intel.com>
A handful of modules do not require mraa. Captured this in
src/CMakeLists.txt - only add mraa dependency for targets which
use:
upm_module_init(mraa ... )
or
upm_mixed_module_init(... REQUIRES mraa)
All sensors which use UPM interfaces (src/interfaces) now
explicitly add the interfaces target:
upm_module_init(interfaces ... )
or
upm_mixed_module_init(... REQUIRES interfaces)
Signed-off-by: Noel Eck <noel.eck@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>
* 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>
To make room for UPM C and C++ sensor code to coexist, all UPM
C++ headers have been renamed from h -> hpp. This commit contains
updates to documentation, includes, cmake collateral, examples, and
swig interface files.
* Renamed all cxx/cpp header files which contain the string
'copyright intel' from .h -> .hpp (if not already hpp).
* Replaced all references to .h with .hpp in documentation,
source files, cmake collateral, example code, and swig interface
files.
* Replaced cmake variable module_h with module_hpp.
* Intentionally left upm.h since this file currently does not
contain code (documentation only).
Signed-off-by: Noel Eck <noel.eck@intel.com>
An ADS1015 implementation existed in the inferface fork before the ADS1x15
moulde was added to upstream repo. This retrofits the IADC interface onto
an implementation derived from ads1x15
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
Initial commit of ADS1x15 adc converter. Support for both ADS1015 12 bit
and ADS1115 16 bit adc.
--signoff
Signed-off-by: Marc Graham <marc@m2ag.net>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>