16 Commits

Author SHA1 Message Date
Noel Eck
601d25cebc llvm: Fixed remaining warnings for llvm
This commit addresses warnings emitted from the llvm
compilers which were not encountered with gnu.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-11-03 14:14:37 -07:00
Jon Trulson
d33e7e532e bacnetmstp: fix -Wreturn-type
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-03 12:14:26 -06:00
Noel Eck
6be7012987 Werror: Enable warnings as errors
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>
2016-10-25 13:25:32 -07:00
Jon Trulson
1a7fbe37b1 bacnetmstp: C11 conformance; needs XOPEN for timezone
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-21 15:24:46 -06:00
Noel Eck
b5a33f6ee3 cmake: Cleanup of src CMakeLists.txt description field
Removed 'upm' string, capitalized first character, added descriptions
where necessary.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-20 16:19:59 -07:00
Jon Trulson
7e64848146 bacnetmstp: fix compiler warnings when building python wrappers
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-07 16:04:44 -06:00
Noel Eck
62718daf0b python: Build both python2 and python3 modules
Updated UPM cmake to build both python2/3 modules if the necessary
python libs are available.

    * Removed BUILDPYTHON3 cmake option in favor of building both
      versions
    * Added cmake module to find both python2 and python3
    * Added macro which can be called from per-sensor cmake files
      to add dependency libraries via target_link_libraries as well
      as swig_link_libraries (for java, nodejs, and python)
    * Python2 is required for python documentation builds
    * Cleanup of python usage throughout UPM cmakelists.
    * Make find_package for Node required.  Removed check for NODE_FOUND
      (which should have been NODEJS_FOUND) in favor of REQUIRED.
    * The cxx and .py wrapper files get generated in python2/3 (instead
      of the same directory).  It appears these files are identical,
      however since the targets can be built in parallel it's safer to split
      them out.
    * Updated all cmake dependencies related to building documentation.
    * Removed unused classname from cmake files

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-09-30 17:01:41 -07:00
Noel Eck
c3a5b8dd3c cmake: Updated pkg_check_modules usage for TPV libraries
* Moved CMAKE_MODULE_PATH append hier in top-level CMakeLists file
      so that it's before all calls to find_package.
    * Added pkg_check_modules for BACNET, MODBUS, JPEG, and OPENZWAVE
      to top-level CMakeLists file.
    * Removed pkg_check_modules from individual sensor libraries.
    * Simplified SWIG find_package call - require 3.0.5 for all SWIG
      wrappers.
    * Moved options to beginning of top-level CMakeLists.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-09-28 11:50:42 -07:00
Mihai Tudor Panu
e4d470ad2c bacnetmstp: moved helper library documentation under module page
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-09-19 17:43:29 -07:00
Jon Trulson
49e04593d8 build: remove unnecessary BUILDSWIG option
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-08-03 11:54:36 -06:00
Jon Trulson
b7f038de3d bacnetmstp: add new bacnetutil class to bacnetmstp UPM library
There is some functionality that will always be needed for BACnet
drivers.  Here we create a new bacnetutil class, built as part of the
bacnetmstp library that can handle much of the data handling and setup
a BACnet driver will need.

The idea is that any BACnet functionality needed, that is not
device-specific, should be added to this class for all drivers to use.

The intent is that all BACnet drivers will inherit from this class.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-06-14 16:53:17 -06:00
Jon Trulson
f03696b7a5 bacnetmstp: Add array support and the ability to create BACnet enums
This reworks the data handling portion of bacnetmstp.  Instead of just
handling a single data element returned from a device, we can handle
more, as in the case of BACnet arrays.

Added the ability to create BACnet enum data elements.  This is needed
in order to set binary value objects.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-06-14 16:53:17 -06:00
Noel Eck
a5e3cc89f3 cmake: Change from search to check for TPV modules.
Switch the calls from pkg_search_module to pkg_check_modules
for ozw, bacnet, and modbus.  Check prints out the version when
found.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-05-12 16:24:40 -07:00
Jon Trulson
7d64a67670 bacnetmstp: remove extraneous libraries from swig_link_libraries() calls
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-05-09 13:24:52 -07:00
Noel Eck
922e0cc26b cpp_headers: Renamed C++ headers from .h -> .hpp
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>
2016-04-28 14:00:54 -07:00
Jon Trulson
c7b5204fe4 bacnetmstp: initial BACnet MS/TP implementation
This driver is implemented as a singleton due to it's reliance on the
bacnet-stack implementation.  This implementation does not currently
support multiple BACnet networks at the same time, though in the
future it might, depending on the future of bacnet-stack development.
The version of bacnet-stack used in developing this driver was 0.8.3.

This driver is not intended to be used directly by end users, rather
it is intended for UPM drivers supporting specific BACnet devices,
such as the Veris E50H5 Energy Meter.

Unfortunately, this means that a process can only support a single
RS-485 BACnet network, though you can support multiple devices on that
network.

No examples are provided.  Please look at the E50HX driver for an
example of how to use this class in a BACnet MS/TP device driver if
you want to write one.

When initialized, the bacnet-stack library will attach to your RS-485
based BACnet network, and start a Master Finite State Machine (FSM) in
a separate thread.  This thread will handle the details of token
passing and locating other Masters in the network (Poll For Master).

This driver will appear as a BACnet Master device on the BACnet
network, which supports only the required Device Object and any
required services (readProp) and Device Object properties.

When initializing the driver, it is important to select a Device
Object Instance ID that is unique on your BACnet network.  This is the
unique identifier that will be used to identify your Master to the
rest of the BACnet network.

In addition, it may take some time after initialization before you
will be able to communicate on the network, as the first thing that
has to happen is that all Masters on the network need to be identified
(handled by the Master FSM) and a token needs to be received before
your Master can begin transmitting (making requests).  This may take a
couple of minutes on a large network.

You can speed this process up by specifying a maxMaster (to
initMaster()) that is smaller than the default (127) -- but only if
you are CERTAIN that there are no masters with a MAC address higher
than the value you choose.  If you fail to follow this rule, you may
introduce hard to identify token passing problems on the network for
yourself and other BACnet Masters.

Currently, this driver only supports the readProperty and
writeProperty requests to other BACnet devices.  In addition, array
property reading and writing is not currently supported.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-04-15 09:58:36 -07:00