mirror of
https://github.com/eclipse/upm.git
synced 2025-07-07 12:21:11 +03:00
Compare commits
53 Commits
Author | SHA1 | Date | |
---|---|---|---|
d866b25f85 | |||
2583d0852d | |||
2de319c254 | |||
77fbf49f93 | |||
372d3e980f | |||
dd014c718f | |||
5304192813 | |||
8d524b8744 | |||
deff852839 | |||
2d2ee8d1f0 | |||
9a83bb7530 | |||
2b642ab7a4 | |||
bde7259ee8 | |||
dc93fb11ff | |||
19d1af6a48 | |||
e689dc175c | |||
06ecae7212 | |||
4faa71d239 | |||
5265bada9c | |||
84067826eb | |||
98e3621c93 | |||
d79799bab9 | |||
49e04593d8 | |||
bda66a3d06 | |||
84a77730be | |||
b08fc8d48d | |||
e64f192fb7 | |||
40fe6654eb | |||
e740335701 | |||
b257d91702 | |||
e7394217b1 | |||
baec9966f0 | |||
0fb56356fb | |||
e0ef6eea64 | |||
743730550c | |||
9ab9e2c403 | |||
8da6095c35 | |||
1849e22154 | |||
dec9b2096e | |||
e1df8b5bf6 | |||
634208e3dc | |||
05ca452831 | |||
19b0b0c2f1 | |||
9a74a3b4f5 | |||
25c0f8ebb1 | |||
33e2c03b48 | |||
3c5d498ae5 | |||
93fea877e3 | |||
b7f038de3d | |||
f03696b7a5 | |||
8fb7907a4e | |||
66bd4ee8c8 | |||
fd707242a9 |
@ -17,9 +17,9 @@ compiler:
|
|||||||
- clang
|
- clang
|
||||||
- gcc
|
- gcc
|
||||||
install:
|
install:
|
||||||
- sudo add-apt-repository --yes ppa:fenics-packages/fenics-exp/swig
|
- sudo add-apt-repository --yes ppa:fenics-packages/fenics-dev/swig
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
- sudo apt-get install -y -qq swig3.0 git
|
- sudo apt-get install -y --force-yes -qq swig3.0 git
|
||||||
- sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
|
- sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
|
||||||
- sudo update-java-alternatives -s java-8-oracle
|
- sudo update-java-alternatives -s java-8-oracle
|
||||||
before_script:
|
before_script:
|
||||||
|
@ -10,7 +10,7 @@ find_package (PkgConfig REQUIRED)
|
|||||||
|
|
||||||
# Force a libmraa search and minimum required version every time a config is generated
|
# Force a libmraa search and minimum required version every time a config is generated
|
||||||
unset(MRAA_FOUND CACHE)
|
unset(MRAA_FOUND CACHE)
|
||||||
pkg_check_modules (MRAA REQUIRED mraa>=1.0.0)
|
pkg_check_modules (MRAA REQUIRED mraa>=1.1.1)
|
||||||
message (INFO " found mraa version: ${MRAA_VERSION}")
|
message (INFO " found mraa version: ${MRAA_VERSION}")
|
||||||
|
|
||||||
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.
|
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.
|
||||||
@ -25,7 +25,7 @@ include (GetGitRevisionDescription)
|
|||||||
git_describe (VERSION "--tags")
|
git_describe (VERSION "--tags")
|
||||||
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
|
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
|
||||||
message (WARNING " - Install git to compile a production UPM!")
|
message (WARNING " - Install git to compile a production UPM!")
|
||||||
set (VERSION "v0.7.0-dirty")
|
set (VERSION "v0.8.0-dirty")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
message (INFO " - UPM Version ${VERSION}")
|
message (INFO " - UPM Version ${VERSION}")
|
||||||
@ -49,20 +49,19 @@ set (upm_VERSION_STRING ${upm_VERSION_MAJOR}.${upm_VERSION_MINOR}.${upm_VERSION_
|
|||||||
set (CMAKE_SWIG_FLAGS "")
|
set (CMAKE_SWIG_FLAGS "")
|
||||||
|
|
||||||
option (BUILDDOC "Build all doc." OFF)
|
option (BUILDDOC "Build all doc." OFF)
|
||||||
option (BUILDSWIG "Build swig modules." ON)
|
|
||||||
option (BUILDSWIGPYTHON "Build swig python modules." ON)
|
option (BUILDSWIGPYTHON "Build swig python modules." ON)
|
||||||
option (BUILDPYTHON3 "Use python3 for building/installing/testing" OFF)
|
|
||||||
option (BUILDSWIGNODE "Build swig node modules." ON)
|
option (BUILDSWIGNODE "Build swig node modules." ON)
|
||||||
|
option (BUILDSWIGJAVA "Build swig java modules" OFF)
|
||||||
|
option (BUILDPYTHON3 "Use python3 for building/installing/testing" OFF)
|
||||||
option (BUILDEXAMPLES "Build C++ example binaries" OFF)
|
option (BUILDEXAMPLES "Build C++ example binaries" OFF)
|
||||||
option (BUILDJAVAEXAMPLES "Build java example jars" OFF)
|
option (BUILDJAVAEXAMPLES "Build java example jars" OFF)
|
||||||
option (BUILDSWIGJAVA "Build swig java modules" OFF)
|
|
||||||
option (IPK "Generate IPK using CPack" OFF)
|
option (IPK "Generate IPK using CPack" OFF)
|
||||||
option (RPM "Generate RPM using CPack" OFF)
|
option (RPM "Generate RPM using CPack" OFF)
|
||||||
option (BUILDTESTS "Generate check-ups for upm" ON)
|
option (BUILDTESTS "Generate check-ups for upm" ON)
|
||||||
option (ENABLECXX11 "Enable C++11 standards support" ON)
|
option (ENABLECXX11 "Enable C++11 standards support" ON)
|
||||||
|
|
||||||
# Find swig
|
# Find swig
|
||||||
if (BUILDSWIG)
|
if (BUILDSWIGPYTHON OR BUILDSWIGNODE OR BUILDSWIGJAVA)
|
||||||
if (BUILDSWIGNODE)
|
if (BUILDSWIGNODE)
|
||||||
find_package (SWIG 3.0.5 REQUIRED)
|
find_package (SWIG 3.0.5 REQUIRED)
|
||||||
else ()
|
else ()
|
||||||
@ -125,7 +124,7 @@ if (BUILDDOC)
|
|||||||
endif (DOXYGEN_FOUND)
|
endif (DOXYGEN_FOUND)
|
||||||
# Check if Sphinx is installed and add target to generate API documentation
|
# Check if Sphinx is installed and add target to generate API documentation
|
||||||
find_package (Sphinx)
|
find_package (Sphinx)
|
||||||
if(SPHINX_FOUND AND BUILDSWIG AND BUILDSWIGPYTHON)
|
if(SPHINX_FOUND AND BUILDSWIGPYTHON)
|
||||||
# Python required for Sphinx build
|
# Python required for Sphinx build
|
||||||
find_package (PythonLibs ${PYTHONBUILD_VERSION} REQUIRED)
|
find_package (PythonLibs ${PYTHONBUILD_VERSION} REQUIRED)
|
||||||
string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
|
string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
|
||||||
@ -231,16 +230,6 @@ if (RPM)
|
|||||||
include(CPack)
|
include(CPack)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory (src)
|
|
||||||
|
|
||||||
if(BUILDEXAMPLES)
|
|
||||||
add_subdirectory (examples/c++)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(BUILDJAVAEXAMPLES)
|
|
||||||
add_subdirectory (examples/java)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (BUILDSWIGPYTHON OR BUILDTESTS)
|
if (BUILDSWIGPYTHON OR BUILDTESTS)
|
||||||
if (BUILDPYTHON3)
|
if (BUILDPYTHON3)
|
||||||
set (PYTHONBUILD_VERSION 3)
|
set (PYTHONBUILD_VERSION 3)
|
||||||
@ -249,6 +238,16 @@ if (BUILDSWIGPYTHON OR BUILDTESTS)
|
|||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
add_subdirectory (src)
|
||||||
|
if(BUILDEXAMPLES)
|
||||||
|
add_subdirectory (examples/c++)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILDJAVAEXAMPLES)
|
||||||
|
add_subdirectory (examples/java)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if (BUILDTESTS)
|
if (BUILDTESTS)
|
||||||
find_package (PythonInterp ${PYTHONBUILD_VERSION} REQUIRED)
|
find_package (PythonInterp ${PYTHONBUILD_VERSION} REQUIRED)
|
||||||
enable_testing ()
|
enable_testing ()
|
||||||
|
@ -4,7 +4,7 @@ UPM (Useful Packages & Modules) Sensor/Actuator repository for MRAA
|
|||||||
The UPM repository provides software drivers for a wide variety of commonly
|
The UPM repository provides software drivers for a wide variety of commonly
|
||||||
used sensors and actuators. These software drivers interact with the
|
used sensors and actuators. These software drivers interact with the
|
||||||
underlying hardware platform (or microcontroller), as well as with the attached
|
underlying hardware platform (or microcontroller), as well as with the attached
|
||||||
sensors, through calls to [MRAA](github.com/intel-iot-devkit/mraa) APIs.
|
sensors, through calls to [MRAA](https://github.com/intel-iot-devkit/mraa) APIs.
|
||||||
|
|
||||||
Programmers can access the interfaces for each sensor by including the sensor’s
|
Programmers can access the interfaces for each sensor by including the sensor’s
|
||||||
corresponding header file and instantiating the associated sensor class. In the
|
corresponding header file and instantiating the associated sensor class. In the
|
||||||
@ -86,6 +86,8 @@ please refer to the Intel Developer Zone IDE page.
|
|||||||
|
|
||||||
See building documentation [here](docs/building.md).
|
See building documentation [here](docs/building.md).
|
||||||
|
|
||||||
|
[](https://travis-ci.org/intel-iot-devkit/upm)
|
||||||
|
|
||||||
### Making your own UPM module
|
### Making your own UPM module
|
||||||
|
|
||||||
Porting [link](docs/porting.md) has more information on making new UPM modules.
|
Porting [link](docs/porting.md) has more information on making new UPM modules.
|
||||||
|
@ -4,6 +4,10 @@ API Changes {#apichanges}
|
|||||||
Here's a list of other API changes made to the library that break source/binary
|
Here's a list of other API changes made to the library that break source/binary
|
||||||
compatibility between releases:
|
compatibility between releases:
|
||||||
|
|
||||||
|
* There were frequent misspellings of the word *Celsius* in the UPM
|
||||||
|
code. In some cases, these were in method names, which will cause
|
||||||
|
some API compatibility issues. These have all been corrected for UPM
|
||||||
|
versions after v.0.7.2.
|
||||||
* Our **C++ header files** changed their extension from *.h* to *.hpp* in
|
* Our **C++ header files** changed their extension from *.h* to *.hpp* in
|
||||||
version 0.7.0, Intel provided examples and code samples also reflect this
|
version 0.7.0, Intel provided examples and code samples also reflect this
|
||||||
change but you will need to modify your `#include` directives in existing code
|
change but you will need to modify your `#include` directives in existing code
|
||||||
@ -12,4 +16,3 @@ compatibility between releases:
|
|||||||
* **stepmotor** driver API was changed significantly from v.0.4.1 to v.0.5.0
|
* **stepmotor** driver API was changed significantly from v.0.4.1 to v.0.5.0
|
||||||
* **eboled** library was greatly improved in version 0.4.0 and the `draw()`
|
* **eboled** library was greatly improved in version 0.4.0 and the `draw()`
|
||||||
function was removed in favor of a more complete GFX library implementation
|
function was removed in favor of a more complete GFX library implementation
|
||||||
|
|
@ -5,10 +5,21 @@ UPM uses cmake in order to make compilation relatively painless. Cmake runs
|
|||||||
build out of tree so the recommended way is to clone from git and make a build/
|
build out of tree so the recommended way is to clone from git and make a build/
|
||||||
directory.
|
directory.
|
||||||
|
|
||||||
|
**Dependencies**
|
||||||
|
* basic: libmraa, cmake, swig, pkgconfig, pthreads, librt
|
||||||
|
* bindings: python-dev, nodejs-dev, openjdk
|
||||||
|
* documentation: doxygen, graphviz, sphinx, yuidoc
|
||||||
|
* sensor specific: bacnet-mstp, modbus, openzwave, jpeg
|
||||||
|
|
||||||
This project depends on libmraa, so that needs to be installed first. Append
|
This project depends on libmraa, so that needs to be installed first. Append
|
||||||
the install location of mraa pkgconfig to the following environment variable:
|
the install location of mraa pkgconfig to the following environment variable:
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~
|
||||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:.../mraa/build/lib/pkgconfig
|
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:.../mraa/build/lib/pkgconfig
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
If you are building the Java or Node.js bindings make sure you set the
|
||||||
|
`JAVA_HOME` and `NODE_PATH` environment variables respectively.
|
||||||
|
|
||||||
UPM will attempt to build all directories inside src/ and they must contain
|
UPM will attempt to build all directories inside src/ and they must contain
|
||||||
individual CMakeLists.txt files.
|
individual CMakeLists.txt files.
|
||||||
@ -45,10 +56,18 @@ Cross-compiling on a different system:
|
|||||||
-DCMAKE_CXX_FLAGS:STRING=-m32 -march=i586
|
-DCMAKE_CXX_FLAGS:STRING=-m32 -march=i586
|
||||||
-DCMAKE_C_FLAGS:STRING=-m32 -march=i586
|
-DCMAKE_C_FLAGS:STRING=-m32 -march=i586
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
Enabling Java module building
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
-DBUILDSWIGJAVA=ON
|
||||||
|
~~~~~~~~~~~~~
|
||||||
Building with an older version of swig (swig 2.0+) requires the disabling of javascript:
|
Building with an older version of swig (swig 2.0+) requires the disabling of javascript:
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
-DBUILDSWIGNODE=OFF
|
-DBUILDSWIGNODE=OFF
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
Generating python3 modules instead of python2.7
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
-DBUILDPYTHON3=ON
|
||||||
|
~~~~~~~~~~~~~
|
||||||
Disabling python module building
|
Disabling python module building
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
-DBUILDSWIGPYTHON=OFF
|
-DBUILDSWIGPYTHON=OFF
|
||||||
@ -57,7 +76,7 @@ Setting the python library to use:
|
|||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.so.1.0
|
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.so.1.0
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
Building doxygen doc
|
Building documentation
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
-DBUILDDOC=ON
|
-DBUILDDOC=ON
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
@ -65,12 +84,16 @@ Build C++ example binaries
|
|||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
-DBUILDEXAMPLES=ON
|
-DBUILDEXAMPLES=ON
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
Build Java examples
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
-DBUILDJAVAEXAMPLES=ON
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you intend to turn on all the options and build everything at once (C++,
|
If you intend to turn on all the options and build everything at once
|
||||||
Node, Python and Documentation) you will have to edit the src/doxy2swig.py file
|
(C++, Java, Node, Python and Documentation) you will have to edit the
|
||||||
and change the line endings from Windows style to Linux format. This has to be
|
src/doxy2swig.py file and change the line endings from Windows style to Linux
|
||||||
repeated every time to sync with the master branch since our Github repository
|
format. This has to be repeated every time to sync with the master branch since
|
||||||
stores files using CR LF line breaks.
|
our Github repository stores files using CR LF line breaks.
|
||||||
|
|
||||||
You can also generate the include and lib directories containing all the sensor
|
You can also generate the include and lib directories containing all the sensor
|
||||||
headers and library files respectively with *make install*. Further, you may
|
headers and library files respectively with *make install*. Further, you may
|
||||||
|
@ -4,6 +4,40 @@ Changelog {#changelog}
|
|||||||
Here's a list summarizing some of the key undergoing changes to our library
|
Here's a list summarizing some of the key undergoing changes to our library
|
||||||
from earlier versions:
|
from earlier versions:
|
||||||
|
|
||||||
|
### v0.8.0
|
||||||
|
|
||||||
|
* Extended l3gd20 driver to support I2C connections in addition to IIO
|
||||||
|
* Updated ads1x15, mcp9808 and ssd1306 I2C drivers to not throw a fatal
|
||||||
|
exception if they fail to set a different I2C speed
|
||||||
|
* Added extra functionality to apa102 driver, backlight control to jhd1313m1
|
||||||
|
LCDs and fixed htu21d
|
||||||
|
* Improved documentation with build dependencies, refreshed the list of known
|
||||||
|
limitations and simplified the component name for a few sensors
|
||||||
|
|
||||||
|
### v0.7.3
|
||||||
|
|
||||||
|
* Fixed several existing drivers and updated Grove Temperature sensor to use
|
||||||
|
new formula for v1.1+ by default
|
||||||
|
* Separated codebase for upm_grove module that bundles some of the starter kit
|
||||||
|
sensors into individual source files
|
||||||
|
* Documentation and doxygen tag updates with correct spelling for Celsius in
|
||||||
|
several places, this also affects API compatibility
|
||||||
|
* Removed superfluous BUILDSWIG option, some build recipes might be impacted
|
||||||
|
* New sensor: ms5611
|
||||||
|
|
||||||
|
### v0.7.2
|
||||||
|
|
||||||
|
* Mraa 1.1.1 required changes to UPM drivers and examples for IIO core
|
||||||
|
kernel support
|
||||||
|
* Rev'ed libmraa requirement to 1.1.1
|
||||||
|
|
||||||
|
### v0.7.1
|
||||||
|
|
||||||
|
* Fix for building python2 vs python3 bindings
|
||||||
|
* Fixes for jhd1313m1 row/font size and reset
|
||||||
|
* Added bacnet utility class
|
||||||
|
* New sensors: bmx055, bmi055, bmc160, bma250e, bmg150, bmm150, t8100, tb7300
|
||||||
|
|
||||||
### v0.7.0
|
### v0.7.0
|
||||||
|
|
||||||
* C++ header files have been renamed from *.h to *.hpp along with all Intel
|
* C++ header files have been renamed from *.h to *.hpp along with all Intel
|
||||||
|
@ -12,6 +12,10 @@ such sensors and known workarounds if they exist.
|
|||||||
some high powered USB ports might be enough, in most cases you will encounter
|
some high powered USB ports might be enough, in most cases you will encounter
|
||||||
dropped characters, washed out text and/or failed I2C writes while using USB
|
dropped characters, washed out text and/or failed I2C writes while using USB
|
||||||
power alone.
|
power alone.
|
||||||
|
* **Grove Servo** (ES08A) requires an external power supply connected to the
|
||||||
|
board to work. We highly recommend using a separate circuit when powering any
|
||||||
|
sort of motor. Trying to use this servo off USB power alone can lead to damage
|
||||||
|
to the servo and/or board!
|
||||||
* **Grove I2C Touch Sensor** (MPR121) v1.3 is incompatible with the Intel
|
* **Grove I2C Touch Sensor** (MPR121) v1.3 is incompatible with the Intel
|
||||||
Edison using the Arduino board, but will work with the Mini-breakout if
|
Edison using the Arduino board, but will work with the Mini-breakout if
|
||||||
supplied with at least 4V. Revision v1.2 works well on all Intel boards.
|
supplied with at least 4V. Revision v1.2 works well on all Intel boards.
|
||||||
@ -49,6 +53,8 @@ such sensors and known workarounds if they exist.
|
|||||||
it will trigger continous callbacks when the sensor is not reading anything.
|
it will trigger continous callbacks when the sensor is not reading anything.
|
||||||
* **Grove RTC** (DS1307) is not compatible with the Intel Edison Arduino board
|
* **Grove RTC** (DS1307) is not compatible with the Intel Edison Arduino board
|
||||||
but will work with the Mini-breakout.
|
but will work with the Mini-breakout.
|
||||||
|
* **Grove Tempture & Humidity (High-Accuracy & Mini) Sensor** (TH02) only works
|
||||||
|
with the Intel Edison Arduino board when powered from the 3.3V rail.
|
||||||
|
|
||||||
#### Adafruit Sensors
|
#### Adafruit Sensors
|
||||||
|
|
||||||
@ -57,12 +63,15 @@ such sensors and known workarounds if they exist.
|
|||||||
|
|
||||||
#### Other Sensors
|
#### Other Sensors
|
||||||
|
|
||||||
* **NRF24L01** corrupted data packets are sent to the device due to the Intel
|
* **MLX90614** is not compatible with the Intel Galileo due to the inability
|
||||||
Edison SPI bus limitation. Sensor works as expected with the Intel Galileo
|
to change the I2C bus speed to 100 KHz.
|
||||||
boards.
|
* **MICSV89** is not compatible with the Intel Galileo due to the inability to
|
||||||
* **NRF8001** based devices do not initialize properly with provided examples
|
change the I2C bus speed to 100 KHz.
|
||||||
on Intel Edison boards also due to SPI bus limitation and data corruption.
|
* **MPL3115A2** uses repeated starts for I2C communication and may not work as
|
||||||
Works on Intel Galileo.
|
expected especially when other I2C sensors are present on the same bus.
|
||||||
|
* **InvenSense MPU9150 & MPU9250** will be unable to report magnetometer data
|
||||||
|
when used on the Intel Edison Arduino board because the integrated compass
|
||||||
|
chips are not detected on the I2C bus.
|
||||||
|
|
||||||
#### General
|
#### General
|
||||||
|
|
||||||
@ -74,10 +83,8 @@ Edison Mini-breakout. When this board is not an option, the sensor can be
|
|||||||
sometimes replaced with the same model from a different vendor.
|
sometimes replaced with the same model from a different vendor.
|
||||||
|
|
||||||
The Intel Edison *SPI* bus can corrupt data being sent across when certain
|
The Intel Edison *SPI* bus can corrupt data being sent across when certain
|
||||||
sensors are connected to it. Based on the sensor, this can affect functionality
|
sensors are connected to it, if using an old image. This has been resolved with
|
||||||
slightly or make the sensor entirely unusable. Unlike the I2C bus limitation,
|
the latest releases.
|
||||||
different boards are not likely to resolve this. A kernel update on the other
|
|
||||||
hand might help alleviate this.
|
|
||||||
|
|
||||||
On the Intel Galileo boards, the *UART* bus might drop data if several bytes
|
On the Intel Galileo boards, the *UART* bus might drop data if several bytes
|
||||||
are read at once.
|
are read at once.
|
||||||
|
@ -224,10 +224,6 @@ add_example (groveultrasonic)
|
|||||||
add_example (sx1276-lora)
|
add_example (sx1276-lora)
|
||||||
add_example (sx1276-fsk)
|
add_example (sx1276-fsk)
|
||||||
add_example (ili9341)
|
add_example (ili9341)
|
||||||
if (OPENZWAVE_FOUND)
|
|
||||||
include_directories(${OPENZWAVE_INCLUDE_DIRS})
|
|
||||||
add_example (ozw)
|
|
||||||
endif()
|
|
||||||
add_example (nlgpio16)
|
add_example (nlgpio16)
|
||||||
add_example (ads1x15)
|
add_example (ads1x15)
|
||||||
if (MODBUS_FOUND)
|
if (MODBUS_FOUND)
|
||||||
@ -262,6 +258,8 @@ if (BACNET_FOUND)
|
|||||||
# we need access to bacnetmstp headers too
|
# we need access to bacnetmstp headers too
|
||||||
include_directories(${PROJECT_SOURCE_DIR}/src/bacnetmstp)
|
include_directories(${PROJECT_SOURCE_DIR}/src/bacnetmstp)
|
||||||
add_example (e50hx)
|
add_example (e50hx)
|
||||||
|
add_example (t8100)
|
||||||
|
add_example (tb7300)
|
||||||
endif()
|
endif()
|
||||||
add_example (vcap)
|
add_example (vcap)
|
||||||
add_example (ds2413)
|
add_example (ds2413)
|
||||||
@ -269,6 +267,9 @@ add_example (ds18b20)
|
|||||||
add_example (bmp280)
|
add_example (bmp280)
|
||||||
add_example (bno055)
|
add_example (bno055)
|
||||||
add_example (l3gd20)
|
add_example (l3gd20)
|
||||||
|
add_example (l3gd20-i2c)
|
||||||
|
add_example (bmx055)
|
||||||
|
add_example (ms5611)
|
||||||
|
|
||||||
# These are special cases where you specify example binary, source file and module(s)
|
# These are special cases where you specify example binary, source file and module(s)
|
||||||
include_directories (${PROJECT_SOURCE_DIR}/src)
|
include_directories (${PROJECT_SOURCE_DIR}/src)
|
||||||
@ -287,11 +288,26 @@ add_custom_example (ak8975-example ak8975.cxx mpu9150)
|
|||||||
add_custom_example (mpu9250-example mpu9250.cxx mpu9150)
|
add_custom_example (mpu9250-example mpu9250.cxx mpu9150)
|
||||||
add_custom_example (groveledbar-example groveledbar.cxx my9221)
|
add_custom_example (groveledbar-example groveledbar.cxx my9221)
|
||||||
add_custom_example (grovecircularled-example grovecircularled.cxx my9221)
|
add_custom_example (grovecircularled-example grovecircularled.cxx my9221)
|
||||||
add_custom_example (temperature-sensor-example temperature-sensor.cxx "si7005;bmpx8x;bme280")
|
add_custom_example (temperature-sensor-example temperature-sensor.cxx "si7005;bmpx8x;bmp280")
|
||||||
add_custom_example (humidity-sensor-example humidity-sensor.cxx "si7005;bme280")
|
add_custom_example (humidity-sensor-example humidity-sensor.cxx "si7005;bmp280")
|
||||||
add_custom_example (pressure-sensor-example pressure-sensor.cxx "bmpx8x;bme280")
|
add_custom_example (pressure-sensor-example pressure-sensor.cxx "bmpx8x;bmp280")
|
||||||
add_custom_example (co2-sensor-example co2-sensor.cxx "t6713")
|
add_custom_example (co2-sensor-example co2-sensor.cxx "t6713")
|
||||||
add_custom_example (adc-example adc-sensor.cxx "ads1x15")
|
add_custom_example (adc-example adc-sensor.cxx "ads1x15")
|
||||||
add_custom_example (light-sensor-example light-sensor.cxx "si1132;max44009")
|
add_custom_example (light-sensor-example light-sensor.cxx "si1132;max44009")
|
||||||
add_custom_example (light-controller-example light-controller.cxx "lp8860;ds1808lc;hlg150h")
|
add_custom_example (light-controller-example light-controller.cxx "lp8860;ds1808lc;hlg150h")
|
||||||
add_custom_example (bme280-example bme280.cxx bmp280)
|
add_custom_example (bme280-example bme280.cxx bmp280)
|
||||||
|
add_custom_example (bma250e-example bma250e.cxx bmx055)
|
||||||
|
add_custom_example (bmg160-example bmg160.cxx bmx055)
|
||||||
|
add_custom_example (bmm150-example bmm150.cxx bmx055)
|
||||||
|
add_custom_example (bmc150-example bmc150.cxx bmx055)
|
||||||
|
add_custom_example (bmi055-example bmi055.cxx bmx055)
|
||||||
|
if (OPENZWAVE_FOUND)
|
||||||
|
include_directories(${OPENZWAVE_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
add_custom_example (ozwdump-example ozwdump.cxx ozw)
|
||||||
|
add_custom_example (aeotecss6-example aeotecss6.cxx ozw)
|
||||||
|
add_custom_example (aeotecsdg2-example aeotecsdg2.cxx ozw)
|
||||||
|
add_custom_example (aeotecdw2e-example aeotecdw2e.cxx ozw)
|
||||||
|
add_custom_example (aeotecdsb09104-example aeotecdsb09104.cxx ozw)
|
||||||
|
add_custom_example (tzemt400-example tzemt400.cxx ozw)
|
||||||
|
endif()
|
||||||
|
123
examples/c++/aeotecdsb09104.cxx
Normal file
123
examples/c++/aeotecdsb09104.cxx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "aeotecdsb09104.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
bool shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
string defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (argc > 1)
|
||||||
|
defaultDev = string(argv[1]);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec DSB09104 instance, on device node 12. You
|
||||||
|
// will almost certainly need to change this to reflect your own
|
||||||
|
// network. Use the ozwdump example to see what nodes are
|
||||||
|
// available.
|
||||||
|
upm::AeotecDSB09104 *sensor = new upm::AeotecDSB09104(12);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor->optionsCreate();
|
||||||
|
sensor->optionsLock();
|
||||||
|
|
||||||
|
// Next, initialize it.
|
||||||
|
cout << "Initializing, this may take awhile depending on your ZWave network"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sensor->init(defaultDev);
|
||||||
|
cout << "Initialization complete" << endl;
|
||||||
|
|
||||||
|
cout << "Querying data..." << endl;
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
cout << "Watts, Channel 1: "
|
||||||
|
<< sensor->getWattsC1()
|
||||||
|
<< " W"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Watts, Channel 2: "
|
||||||
|
<< sensor->getWattsC2()
|
||||||
|
<< " W"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Watts, Channel 3: "
|
||||||
|
<< sensor->getWattsC3()
|
||||||
|
<< " W"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Energy, Channel 1: "
|
||||||
|
<< sensor->getEnergyC1()
|
||||||
|
<< " kWh"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Energy, Channel 2: "
|
||||||
|
<< sensor->getEnergyC2()
|
||||||
|
<< " kWh"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Energy, Channel 3: "
|
||||||
|
<< sensor->getEnergyC3()
|
||||||
|
<< " kWh"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Battery Level: "
|
||||||
|
<< sensor->getBatteryLevel()
|
||||||
|
<< "%"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
sleep(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// sensor->dumpNodes(true);
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
109
examples/c++/aeotecdw2e.cxx
Normal file
109
examples/c++/aeotecdw2e.cxx
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "aeotecdw2e.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
bool shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
string defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (argc > 1)
|
||||||
|
defaultDev = string(argv[1]);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec Door/Window 2nd Edition sensor instance, on
|
||||||
|
// device node 10. You will almost certainly need to change this to
|
||||||
|
// reflect your own network. Use the ozwdump example to see what
|
||||||
|
// nodes are available.
|
||||||
|
upm::AeotecDW2E *sensor = new upm::AeotecDW2E(10);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor->optionsCreate();
|
||||||
|
sensor->optionsLock();
|
||||||
|
|
||||||
|
// Next, initialize it.
|
||||||
|
cout << "Initializing, this may take awhile depending on your ZWave network"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sensor->init(defaultDev);
|
||||||
|
cout << "Initialization complete" << endl;
|
||||||
|
|
||||||
|
cout << "Querying data..." << endl;
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
if (sensor->isDeviceAvailable())
|
||||||
|
{
|
||||||
|
cout << "Alarm status: "
|
||||||
|
<< sensor->isAlarmTripped()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Tamper Switch status: "
|
||||||
|
<< sensor->isTamperTripped()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Battery Level: "
|
||||||
|
<< sensor->getBatteryLevel()
|
||||||
|
<< "%"
|
||||||
|
<< endl;
|
||||||
|
cout << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cout << "Device has not yet responded to probe."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Try waking it, or wait until it wakes itself if configured"
|
||||||
|
<< " to do so."
|
||||||
|
<< endl;
|
||||||
|
cout << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
sleep(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
127
examples/c++/aeotecsdg2.cxx
Normal file
127
examples/c++/aeotecsdg2.cxx
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "aeotecsdg2.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
bool shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
string defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (argc > 1)
|
||||||
|
defaultDev = string(argv[1]);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec Smart Dimmer Gen2 instance, on device node
|
||||||
|
// 9. You will almost certainly need to change this to reflect your
|
||||||
|
// own network. Use the ozwdump example to see what nodes are
|
||||||
|
// available.
|
||||||
|
upm::AeotecSDG2 *sensor = new upm::AeotecSDG2(9);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor->optionsCreate();
|
||||||
|
sensor->optionsLock();
|
||||||
|
|
||||||
|
// Next, initialize it.
|
||||||
|
cout << "Initializing, this may take awhile depending on your ZWave network"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sensor->init(defaultDev);
|
||||||
|
cout << "Initialization complete" << endl;
|
||||||
|
|
||||||
|
// turn light on
|
||||||
|
cout << "Turning switch on, then sleeping for 5 secs" << endl;
|
||||||
|
sensor->on();
|
||||||
|
sleep(5);
|
||||||
|
|
||||||
|
cout << "Querying data..." << endl;
|
||||||
|
bool dim = false;
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
// put on a light show...
|
||||||
|
if (dim)
|
||||||
|
sensor->setLevel(25);
|
||||||
|
else
|
||||||
|
sensor->on();
|
||||||
|
|
||||||
|
dim = !dim;
|
||||||
|
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
cout << "Current Level: "
|
||||||
|
<< sensor->getLevel()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Volts: "
|
||||||
|
<< sensor->getVolts()
|
||||||
|
<< " volts"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Energy Consumption: "
|
||||||
|
<< sensor->getEnergy()
|
||||||
|
<< " kWh"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Watts: "
|
||||||
|
<< sensor->getWatts()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Current: "
|
||||||
|
<< sensor->getCurrent()
|
||||||
|
<< " amps"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
sleep(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Turning switch off and sleeping for 5 seconds..." << endl;
|
||||||
|
sensor->off();
|
||||||
|
sleep(5);
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
117
examples/c++/aeotecss6.cxx
Normal file
117
examples/c++/aeotecss6.cxx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "aeotecss6.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
bool shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
string defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (argc > 1)
|
||||||
|
defaultDev = string(argv[1]);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec SS6 instance, on device node 11. You will
|
||||||
|
// almost certainly need to change this to reflect your own network.
|
||||||
|
// Use the ozwdump example to see what nodes are available.
|
||||||
|
upm::AeotecSS6 *sensor = new upm::AeotecSS6(11);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor->optionsCreate();
|
||||||
|
sensor->optionsLock();
|
||||||
|
|
||||||
|
// Next, initialize it.
|
||||||
|
cout << "Initializing, this may take awhile depending on your ZWave network"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sensor->init(defaultDev);
|
||||||
|
cout << "Initialization complete" << endl;
|
||||||
|
|
||||||
|
// turn light on
|
||||||
|
cout << "Turning switch on, then sleeping for 5 secs" << endl;
|
||||||
|
sensor->on();
|
||||||
|
sleep(5);
|
||||||
|
|
||||||
|
cout << "Querying data..." << endl;
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
cout << "Switch status: "
|
||||||
|
<< sensor->isOn()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Volts: "
|
||||||
|
<< sensor->getVolts()
|
||||||
|
<< " volts"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Energy Consumption: "
|
||||||
|
<< sensor->getEnergy()
|
||||||
|
<< " kWh"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Watts: "
|
||||||
|
<< sensor->getWatts()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Current: "
|
||||||
|
<< sensor->getCurrent()
|
||||||
|
<< " amps"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
sleep(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Turning switch off and sleeping for 5 seconds..." << endl;
|
||||||
|
sensor->off();
|
||||||
|
sleep(5);
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Lay, Kuan Loon <kuan.loon.lay@intel.com>
|
* Author: Lay, Kuan Loon <kuan.loon.lay@intel.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@ -46,6 +46,15 @@ main()
|
|||||||
// Instantiate a Digital Proximity and Ambient Light sensor on iio device 4
|
// Instantiate a Digital Proximity and Ambient Light sensor on iio device 4
|
||||||
upm::APDS9930* light_proximity = new upm::APDS9930(4);
|
upm::APDS9930* light_proximity = new upm::APDS9930(4);
|
||||||
|
|
||||||
|
// Kernel driver implement sleep 5000-5100us after enable illuminance sensor
|
||||||
|
light_proximity->enableIlluminance(true);
|
||||||
|
|
||||||
|
// Kernel driver implement sleep 5000-5100us after enable proximity sensor
|
||||||
|
light_proximity->enableProximity(true);
|
||||||
|
|
||||||
|
// Tested this value works. Please change it on your platform
|
||||||
|
usleep(120000);
|
||||||
|
|
||||||
while (shouldRun) {
|
while (shouldRun) {
|
||||||
float lux = light_proximity->getAmbient();
|
float lux = light_proximity->getAmbient();
|
||||||
cout << "Luminance value is " << lux << endl;
|
cout << "Luminance value is " << lux << endl;
|
||||||
@ -53,6 +62,8 @@ main()
|
|||||||
cout << "Proximity value is " << proximity << endl;
|
cout << "Proximity value is " << proximity << endl;
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
light_proximity->enableProximity(false);
|
||||||
|
light_proximity->enableIlluminance(false);
|
||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
|
|
||||||
cout << "Exiting" << endl;
|
cout << "Exiting" << endl;
|
||||||
|
83
examples/c++/bma250e.cxx
Normal file
83
examples/c++/bma250e.cxx
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
#include "bma250e.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate an BMA250E using default I2C parameters
|
||||||
|
upm::BMA250E *sensor = new upm::BMA250E();
|
||||||
|
|
||||||
|
// For SPI, bus 0, you would pass -1 as the address, and a valid pin
|
||||||
|
// for CS: BMA250E(0, -1, 10);
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
float x, y, z;
|
||||||
|
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
sensor->getAccelerometer(&x, &y, &z);
|
||||||
|
cout << "Accelerometer x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " g"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
// we show both C and F for temperature
|
||||||
|
cout << "Compensation Temperature: " << sensor->getTemperature()
|
||||||
|
<< " C / " << sensor->getTemperature(true) << " F"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
usleep(250000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
82
examples/c++/bmc150.cxx
Normal file
82
examples/c++/bmc150.cxx
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
#include "bmc150.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate an BMC150 using default I2C parameters
|
||||||
|
upm::BMC150 *sensor = new upm::BMC150();
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
float x, y, z;
|
||||||
|
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
sensor->getAccelerometer(&x, &y, &z);
|
||||||
|
cout << "Accelerometer x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " g"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sensor->getMagnetometer(&x, &y, &z);
|
||||||
|
cout << "Magnetometer x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " uT"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
usleep(250000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
83
examples/c++/bmg160.cxx
Normal file
83
examples/c++/bmg160.cxx
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
#include "bmg160.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate an BMG160 using default I2C parameters
|
||||||
|
upm::BMG160 *sensor = new upm::BMG160();
|
||||||
|
|
||||||
|
// For SPI, bus 0, you would pass -1 as the address, and a valid pin
|
||||||
|
// for CS: BMG160(0, -1, 10);
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
float x, y, z;
|
||||||
|
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
sensor->getGyroscope(&x, &y, &z);
|
||||||
|
cout << "Gyroscope x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " degrees/s"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
// we show both C and F for temperature
|
||||||
|
cout << "Compensation Temperature: " << sensor->getTemperature()
|
||||||
|
<< " C / " << sensor->getTemperature(true) << " F"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
usleep(250000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
82
examples/c++/bmi055.cxx
Normal file
82
examples/c++/bmi055.cxx
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
#include "bmi055.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate an BMI055 using default I2C parameters
|
||||||
|
upm::BMI055 *sensor = new upm::BMI055();
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
float x, y, z;
|
||||||
|
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
sensor->getAccelerometer(&x, &y, &z);
|
||||||
|
cout << "Accelerometer x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " g"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sensor->getGyroscope(&x, &y, &z);
|
||||||
|
cout << "Gyroscope x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " degrees/s"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
usleep(250000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
78
examples/c++/bmm150.cxx
Normal file
78
examples/c++/bmm150.cxx
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
#include "bmm150.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate an BMM150 using default I2C parameters
|
||||||
|
upm::BMM150 *sensor = new upm::BMM150();
|
||||||
|
|
||||||
|
// For SPI, bus 0, you would pass -1 as the address, and a valid pin
|
||||||
|
// for CS: BMM150(0, -1, 10);
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
float x, y, z;
|
||||||
|
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
sensor->getMagnetometer(&x, &y, &z);
|
||||||
|
cout << "Magnetometer x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " uT"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
usleep(250000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
89
examples/c++/bmx055.cxx
Normal file
89
examples/c++/bmx055.cxx
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
#include "bmx055.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate an BMX055 using default I2C parameters
|
||||||
|
upm::BMX055 *sensor = new upm::BMX055();
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
float x, y, z;
|
||||||
|
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
sensor->getAccelerometer(&x, &y, &z);
|
||||||
|
cout << "Accelerometer x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " g"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sensor->getGyroscope(&x, &y, &z);
|
||||||
|
cout << "Gyroscope x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " degrees/s"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sensor->getMagnetometer(&x, &y, &z);
|
||||||
|
cout << "Magnetometer x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " uT"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
usleep(250000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -74,8 +74,8 @@ int main(int argc, char **argv)
|
|||||||
// sensor->setDebug(true);
|
// sensor->setDebug(true);
|
||||||
|
|
||||||
cout << endl;
|
cout << endl;
|
||||||
cout << "Device Description: " << sensor->getDescription() << endl;
|
cout << "Device Description: " << sensor->getDeviceDescription() << endl;
|
||||||
cout << "Device Location: " << sensor->getLocation() << endl;
|
cout << "Device Location: " << sensor->getDeviceLocation() << endl;
|
||||||
cout << endl;
|
cout << endl;
|
||||||
|
|
||||||
// update and print a few values every 5 seconds
|
// update and print a few values every 5 seconds
|
||||||
|
@ -53,7 +53,7 @@ int main(int argc, char **argv)
|
|||||||
// Output data every second until interrupted
|
// Output data every second until interrupted
|
||||||
while (shouldRun)
|
while (shouldRun)
|
||||||
{
|
{
|
||||||
printf("Temperature: %f Celcius\n", bar->getTemperature());
|
printf("Temperature: %f Celsius\n", bar->getTemperature());
|
||||||
printf("Pressure: %f Millibars\n", bar->getPressure());
|
printf("Pressure: %f Millibars\n", bar->getPressure());
|
||||||
printf("Altitude: %f Meters\n", bar->getAltitude());
|
printf("Altitude: %f Meters\n", bar->getAltitude());
|
||||||
|
|
||||||
|
11
examples/c++/kxcjk1013.cxx
Executable file → Normal file
11
examples/c++/kxcjk1013.cxx
Executable file → Normal file
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Lay, Kuan Loon <kuan.loon.lay@intel.com>
|
* Author: Lay, Kuan Loon <kuan.loon.lay@intel.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@ -22,8 +22,9 @@
|
|||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "kxcjk1013.hpp"
|
#include "kxcjk1013.hpp"
|
||||||
|
|
||||||
@ -44,7 +45,8 @@ data_callback(char* data)
|
|||||||
{
|
{
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
accelerometer->extract3Axis(data, &x, &y, &z);
|
accelerometer->extract3Axis(data, &x, &y, &z);
|
||||||
printf("% .1f % .1f % .1f\n", x, y, z);
|
cout << fixed << setprecision(1);
|
||||||
|
cout << x << '\t' << y << '\t' << z << "[m/s^2]" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -54,7 +56,10 @@ main()
|
|||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
// Instantiate a KXCJK1013 Accelerometer Sensor on iio device 0
|
// Instantiate a KXCJK1013 Accelerometer Sensor on iio device 0
|
||||||
accelerometer = new upm::KXCJK1013(0);
|
accelerometer = new upm::KXCJK1013(0);
|
||||||
|
// Available scales are 0.009582(2g), 0.019163(4g), and 0.038326(8g)
|
||||||
accelerometer->setScale(0.019163);
|
accelerometer->setScale(0.019163);
|
||||||
|
// Available sampling frequency are 0.781000, 1.563000, 3.125000, 6.250000, 12.500000, 25, 50,
|
||||||
|
// 100, 200, 400, 800, and 1600
|
||||||
accelerometer->setSamplingFrequency(25.0);
|
accelerometer->setSamplingFrequency(25.0);
|
||||||
accelerometer->enable3AxisChannel();
|
accelerometer->enable3AxisChannel();
|
||||||
accelerometer->installISR(data_callback, NULL);
|
accelerometer->installISR(data_callback, NULL);
|
||||||
|
123
examples/c++/l3gd20-i2c.cxx
Normal file
123
examples/c++/l3gd20-i2c.cxx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <math.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include "l3gd20.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
float rad2deg(float x)
|
||||||
|
{
|
||||||
|
return x * (180.0 / M_PI);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate an L3GD20 using default parameters
|
||||||
|
upm::L3GD20 *sensor = new upm::L3GD20(L3GD20_DEFAULT_I2C_BUS,
|
||||||
|
L3GD20_DEFAULT_I2C_ADDR);
|
||||||
|
|
||||||
|
// set some parameters (these are already the defaults, but are
|
||||||
|
// provided here as an example)
|
||||||
|
|
||||||
|
// 250 deg/s sensitivity
|
||||||
|
sensor->setRange(sensor->FS_250);
|
||||||
|
|
||||||
|
// Set ODR to 95Hz, 25Hz cut-off
|
||||||
|
sensor->setODR(sensor->ODR_CUTOFF_95_25);
|
||||||
|
|
||||||
|
// If you already have calibration data, you can specify it here
|
||||||
|
// sensor->loadCalibratedData(-0.0296269637, -0.0080939643, -0.0077121737);
|
||||||
|
|
||||||
|
// now output data every 100 milliseconds
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
float x, y, z;
|
||||||
|
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
cout << "Calibrated: " << sensor->getCalibratedStatus() << endl;
|
||||||
|
|
||||||
|
// output is in radians/s
|
||||||
|
sensor->getGyroscope(&x, &y, &z);
|
||||||
|
cout << fixed << setprecision(1)
|
||||||
|
<< "Gyroscope x: " << x
|
||||||
|
<< " y: " << y
|
||||||
|
<< " z: " << z
|
||||||
|
<< " radians"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
// same data converted to degrees/s
|
||||||
|
cout << "Gyroscope x: " << rad2deg(x)
|
||||||
|
<< " y: " << rad2deg(y)
|
||||||
|
<< " z: " << rad2deg(z)
|
||||||
|
<< " degrees"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
// we show both C and F for temperature
|
||||||
|
cout << "Compensation Temperature: " << sensor->getTemperature(false)
|
||||||
|
<< " C / " << sensor->getTemperature(true) << " F"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
usleep(100000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// dump the calibration values if we managed to calibrate
|
||||||
|
if (sensor->getCalibratedStatus())
|
||||||
|
{
|
||||||
|
float calX, calY, calZ;
|
||||||
|
sensor->getCalibratedData(&calX, &calY, &calZ);
|
||||||
|
|
||||||
|
cout << setprecision(10)
|
||||||
|
<< "Calibration values x: " << calX
|
||||||
|
<< " y: " << calY
|
||||||
|
<< " z: " << calZ
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Lay, Kuan Loon <kuan.loon.lay@intel.com>
|
* Author: Lay, Kuan Loon <kuan.loon.lay@intel.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@ -22,8 +22,9 @@
|
|||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "l3gd20.hpp"
|
#include "l3gd20.hpp"
|
||||||
|
|
||||||
@ -43,8 +44,10 @@ void
|
|||||||
data_callback(char* data)
|
data_callback(char* data)
|
||||||
{
|
{
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
if (gyroscope->extract3Axis(data, &x, &y, &z))
|
if (gyroscope->extract3Axis(data, &x, &y, &z)) {
|
||||||
printf("% .2f % .2f % .2f\n", x, y, z);
|
cout << fixed << setprecision(1);
|
||||||
|
cout << x << '\t' << y << '\t' << z << "[rad/sec]" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -54,7 +57,9 @@ main()
|
|||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
// Instantiate a L3GD20 Gyroscope Sensor on iio device 3
|
// Instantiate a L3GD20 Gyroscope Sensor on iio device 3
|
||||||
gyroscope = new upm::L3GD20(3);
|
gyroscope = new upm::L3GD20(3);
|
||||||
|
// Available scales are 0.000153(250dps), 0.000305(500dps), and 0.001222(2000dps)
|
||||||
gyroscope->setScale(0.001222);
|
gyroscope->setScale(0.001222);
|
||||||
|
// Available sampling frequency are 95, 190, 380, and 760
|
||||||
gyroscope->setSamplingFrequency(95.0);
|
gyroscope->setSamplingFrequency(95.0);
|
||||||
gyroscope->enable3AxisChannel();
|
gyroscope->enable3AxisChannel();
|
||||||
gyroscope->installISR(data_callback, NULL);
|
gyroscope->installISR(data_callback, NULL);
|
||||||
|
@ -18,7 +18,7 @@ int main()
|
|||||||
cout << "1 - read temp \t" ;
|
cout << "1 - read temp \t" ;
|
||||||
cout << "2 - sleep mode \t";
|
cout << "2 - sleep mode \t";
|
||||||
cout << "3 - wake up" << endl;
|
cout << "3 - wake up" << endl;
|
||||||
cout << "4 - set mode to " << (temp->isCelsius() == true ? "Fahrenheit" : "Celcius") << endl;
|
cout << "4 - set mode to " << (temp->isCelsius() == true ? "Fahrenheit" : "Celsius") << endl;
|
||||||
cout << "5 - show status bits" << endl;
|
cout << "5 - show status bits" << endl;
|
||||||
cout << "6 - Set Tcrit \t" ;
|
cout << "6 - Set Tcrit \t" ;
|
||||||
cout << "7 - Set Tupper \t" ;
|
cout << "7 - Set Tupper \t" ;
|
||||||
@ -53,7 +53,7 @@ int main()
|
|||||||
temp->shutDown(false);
|
temp->shutDown(false);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
cout << "set mode to " << (temp->isCelsius() ? "Fahrenheit" : "Celcius") << endl;
|
cout << "set mode to " << (temp->isCelsius() ? "Fahrenheit" : "Celsius") << endl;
|
||||||
temp->setMode(!temp->isCelsius());
|
temp->setMode(!temp->isCelsius());
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
63
examples/c++/ms5611.cxx
Normal file
63
examples/c++/ms5611.cxx
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Author: Henry Bruce <henry.bruce@intel.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
#include "ms5611.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
static int is_running = 0;
|
||||||
|
|
||||||
|
void
|
||||||
|
sig_handler(int signo)
|
||||||
|
{
|
||||||
|
printf("got signal\n");
|
||||||
|
if (signo == SIGINT) {
|
||||||
|
is_running = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
upm::MS5611* sensor = new upm::MS5611(0);
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
|
while (!is_running) {
|
||||||
|
int value = sensor->getTemperatureCelsius();
|
||||||
|
std::cout << "Temperature = " << value << "C" << std::endl;
|
||||||
|
value = sensor->getPressurePa();
|
||||||
|
std::cout << "Pressure = " << value << "Pa" << std::endl;
|
||||||
|
sleep(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "exiting application" << std::endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
//! [Interesting]
|
@ -25,6 +25,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <stdexcept>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "otp538u.hpp"
|
#include "otp538u.hpp"
|
||||||
|
|
||||||
@ -52,14 +53,24 @@ int main()
|
|||||||
// Object temperature.
|
// Object temperature.
|
||||||
upm::OTP538U *temps = new upm::OTP538U(0, 1, OTP538U_AREF);
|
upm::OTP538U *temps = new upm::OTP538U(0, 1, OTP538U_AREF);
|
||||||
|
|
||||||
|
// enable debugging if you would like
|
||||||
|
// temps->setDebug(true);
|
||||||
|
|
||||||
// Output ambient and object temperatures
|
// Output ambient and object temperatures
|
||||||
while (shouldRun)
|
while (shouldRun)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
cout << "Ambient temp: " << std::fixed << setprecision(2)
|
cout << "Ambient temp: " << std::fixed << setprecision(2)
|
||||||
<< temps->ambientTemperature()
|
<< temps->ambientTemperature()
|
||||||
<< " C, Object temp: " << temps->objectTemperature()
|
<< " C, Object temp: " << temps->objectTemperature()
|
||||||
<< " C" << endl;
|
<< " C" << endl;
|
||||||
|
}
|
||||||
|
catch (std::out_of_range& e) {
|
||||||
|
cerr << "Temperature(s) are out of range: " << e.what()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015-2016 Intel Corporation.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@ -25,7 +25,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "ozw.hpp"
|
#include "ozwdump.hpp"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -39,8 +39,8 @@ int main(int argc, char **argv)
|
|||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
defaultDev = string(argv[1]);
|
defaultDev = string(argv[1]);
|
||||||
|
|
||||||
// Instantiate an OZW instance
|
// Instantiate an OZWDUMP instance
|
||||||
upm::OZW *sensor = new upm::OZW();
|
upm::OZWDUMP *sensor = new upm::OZWDUMP();
|
||||||
|
|
||||||
// The first thing to do is create options, then lock them when done.
|
// The first thing to do is create options, then lock them when done.
|
||||||
sensor->optionsCreate();
|
sensor->optionsCreate();
|
||||||
@ -50,16 +50,12 @@ int main(int argc, char **argv)
|
|||||||
cout << "Initializing, this may take awhile depending on your ZWave network"
|
cout << "Initializing, this may take awhile depending on your ZWave network"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
if (!sensor->init(defaultDev))
|
sensor->init(defaultDev);
|
||||||
{
|
|
||||||
cerr << "Init failed." << endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cout << "Initialization complete" << endl;
|
cout << "Initialization complete" << endl;
|
||||||
|
|
||||||
cout << "Dumping nodes..." << endl;
|
cout << "Dumping nodes..." << endl;
|
||||||
|
|
||||||
sensor->dumpNodes();
|
sensor->dumpNodes(true);
|
||||||
|
|
||||||
// The following is example output of dumpNodes:
|
// The following is example output of dumpNodes:
|
||||||
//
|
//
|
||||||
@ -105,34 +101,9 @@ int main(int argc, char **argv)
|
|||||||
// Index: 8, Type: int32, Label: Interval, Value: 1521 seconds
|
// Index: 8, Type: int32, Label: Interval, Value: 1521 seconds
|
||||||
// Index: 9, Type: bool, Label: Exporting, Value: False
|
// Index: 9, Type: bool, Label: Exporting, Value: False
|
||||||
//
|
//
|
||||||
// So, with the above in mind:
|
|
||||||
//
|
|
||||||
// 1. Query the temperature on node 3 and print it out (as a
|
|
||||||
// string), along with the units of measure:
|
|
||||||
//
|
|
||||||
// cout << "Temperature: " << sensor->getValueAsString(3, 1)
|
|
||||||
// << " " << sensor->getValueUnits(3, 1) << endl;
|
|
||||||
//
|
|
||||||
// 2. query the same temperature as a float:
|
|
||||||
//
|
|
||||||
// float temperature = sensor->getValueAsFloat(3, 1);
|
|
||||||
//
|
|
||||||
// 3. Turn on the light plugged into the switch on Node 7, wait 5
|
|
||||||
// seconds, then turn it back off again:
|
|
||||||
//
|
|
||||||
// cout << "Turning ON node 7" << endl;
|
|
||||||
// sensor->setValueAsBool(7, 0, true);
|
|
||||||
//
|
|
||||||
// cout << "Sleeping for 5 seconds" << endl;
|
|
||||||
// sleep(5);
|
|
||||||
//
|
|
||||||
// cout << "Turning OFF node 7" << endl;
|
|
||||||
// sensor->setValueAsBool(7, 0, false);
|
|
||||||
|
|
||||||
|
|
||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
|
|
||||||
|
|
||||||
cout << "Exiting..." << endl;
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
delete sensor;
|
delete sensor;
|
@ -35,7 +35,7 @@ int main ()
|
|||||||
try {
|
try {
|
||||||
upm::SI7005* sensor = new upm::SI7005(EDISON_I2C_BUS, EDISON_GPIO_SI7005_CS);
|
upm::SI7005* sensor = new upm::SI7005(EDISON_I2C_BUS, EDISON_GPIO_SI7005_CS);
|
||||||
while (true) {
|
while (true) {
|
||||||
int temperature = sensor->getTemperatureCelcius();
|
int temperature = sensor->getTemperatureCelsius();
|
||||||
int humidity = sensor->getHumidityRelative();
|
int humidity = sensor->getHumidityRelative();
|
||||||
std::cout << "Temperature = " << temperature << "C" << std::endl;
|
std::cout << "Temperature = " << temperature << "C" << std::endl;
|
||||||
std::cout << "Humidity = " << humidity << "%" << std::endl;
|
std::cout << "Humidity = " << humidity << "%" << std::endl;
|
||||||
|
117
examples/c++/t8100.cxx
Normal file
117
examples/c++/t8100.cxx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "t8100.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace upm;
|
||||||
|
|
||||||
|
bool shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
// You will need to edit this example to conform to your site and your
|
||||||
|
// devices, specifically the Device Object Instance ID passed to the
|
||||||
|
// constructor, and the arguments to initMaster() that are
|
||||||
|
// appropriate for your BACnet network.
|
||||||
|
|
||||||
|
string defaultDev = "/dev/ttyUSB0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (argc > 1)
|
||||||
|
defaultDev = string(argv[1]);
|
||||||
|
|
||||||
|
cout << "Using device " << defaultDev << endl;
|
||||||
|
cout << "Initializing..." << endl;
|
||||||
|
|
||||||
|
// Instantiate an T8100 object for an T8100 device that has 568000
|
||||||
|
// as it's unique Device Object Instance ID. NOTE: You will
|
||||||
|
// certainly want to change this to the correct value for your
|
||||||
|
// device(s).
|
||||||
|
T8100 *sensor = new T8100(568000);
|
||||||
|
|
||||||
|
// Initialize our BACnet master, if it has not already been
|
||||||
|
// initialized, with the device and baudrate, choosing 1000001 as
|
||||||
|
// our unique Device Object Instance ID, 2 as our MAC address and
|
||||||
|
// using default values for maxMaster and maxInfoFrames
|
||||||
|
sensor->initMaster(defaultDev, 38400, 1000001, 2);
|
||||||
|
|
||||||
|
// Uncomment to enable debugging output
|
||||||
|
// sensor->setDebug(true);
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
cout << "Device Description: " << sensor->getDeviceDescription() << endl;
|
||||||
|
cout << "Device Location: " << sensor->getDeviceLocation() << endl;
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
// update and print a few values every 5 seconds
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
// update our values
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
cout << "CO2 Concentration: "
|
||||||
|
<< sensor->getCO2()
|
||||||
|
<< " ppm"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
// we show both C and F for temperature
|
||||||
|
cout << "Temperature: " << sensor->getTemperature()
|
||||||
|
<< " C / "
|
||||||
|
<< sensor->getTemperature(true)
|
||||||
|
<< " F"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Humidity: " << sensor->getHumidity()
|
||||||
|
<< " %RH"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Relay State: " << sensor->getRelayState()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
sleep(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
124
examples/c++/tb7300.cxx
Normal file
124
examples/c++/tb7300.cxx
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "tb7300.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace upm;
|
||||||
|
|
||||||
|
bool shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
// You will need to edit this example to conform to your site and your
|
||||||
|
// devices, specifically the Device Object Instance ID passed to the
|
||||||
|
// constructor, and the arguments to initMaster() that are
|
||||||
|
// appropriate for your BACnet network.
|
||||||
|
|
||||||
|
string defaultDev = "/dev/ttyUSB0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (argc > 1)
|
||||||
|
defaultDev = string(argv[1]);
|
||||||
|
|
||||||
|
cout << "Using device " << defaultDev << endl;
|
||||||
|
cout << "Initializing..." << endl;
|
||||||
|
|
||||||
|
// Instantiate an TB7300 object for an TB7300 device that has 73001
|
||||||
|
// as it's unique Device Object Instance ID. NOTE: You will
|
||||||
|
// certainly want to change this to the correct value for your
|
||||||
|
// device(s).
|
||||||
|
TB7300 *sensor = new TB7300(73001);
|
||||||
|
|
||||||
|
// Initialize our BACnet master, if it has not already been
|
||||||
|
// initialized, with the device and baudrate, choosing 1000001 as
|
||||||
|
// our unique Device Object Instance ID, 2 as our MAC address and
|
||||||
|
// using default values for maxMaster and maxInfoFrames
|
||||||
|
sensor->initMaster(defaultDev, 38400, 1000001, 2);
|
||||||
|
|
||||||
|
// Uncomment to enable debugging output
|
||||||
|
// sensor->setDebug(true);
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
cout << "Device Name: " << sensor->getDeviceName() << endl;
|
||||||
|
cout << "Device Description: " << sensor->getDeviceDescription() << endl;
|
||||||
|
cout << "Device Location: " << sensor->getDeviceLocation() << endl;
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
cout << "Fan Mode: "
|
||||||
|
<< sensor->getMultiStateValueText(TB7300::MV_Fan_Mode)
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Fan Status: "
|
||||||
|
<< sensor->getMultiStateValueText(TB7300::MV_Fan_Status)
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "System Mode: "
|
||||||
|
<< sensor->getMultiStateValueText(TB7300::MV_System_Mode)
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Service Alarm: "
|
||||||
|
<< sensor->getBinaryInputText(TB7300::BI_Service_Alarm)
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
// update and print the room temperature every 5 seconds
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
// update our values
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
// we show both C and F for temperature
|
||||||
|
cout << "Temperature: " << sensor->getTemperature()
|
||||||
|
<< " C / "
|
||||||
|
<< sensor->getTemperature(true)
|
||||||
|
<< " F"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
sleep(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -76,7 +76,7 @@ int main ()
|
|||||||
std::cout << "Temperature sensor " << temperatureSensor->getModuleName() << " detected" << std::endl;
|
std::cout << "Temperature sensor " << temperatureSensor->getModuleName() << " detected" << std::endl;
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
int value = temperatureSensor->getTemperatureCelcius();
|
int value = temperatureSensor->getTemperatureCelsius();
|
||||||
std::cout << "Temperature = " << value << "C" << std::endl;
|
std::cout << "Temperature = " << value << "C" << std::endl;
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
std::cerr << e.what() << std::endl;
|
std::cerr << e.what() << std::endl;
|
||||||
|
114
examples/c++/tzemt400.cxx
Normal file
114
examples/c++/tzemt400.cxx
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "tzemt400.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
bool shouldRun = true;
|
||||||
|
|
||||||
|
void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
if (signo == SIGINT)
|
||||||
|
shouldRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
|
string defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (argc > 1)
|
||||||
|
defaultDev = string(argv[1]);
|
||||||
|
|
||||||
|
// Instantiate a TZEMT400 instance, on device node 13. You will
|
||||||
|
// almost certainly need to change this to reflect your own network.
|
||||||
|
// Use the ozwdump example to see what nodes are available.
|
||||||
|
upm::TZEMT400 *sensor = new upm::TZEMT400(13);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor->optionsCreate();
|
||||||
|
sensor->optionsLock();
|
||||||
|
|
||||||
|
// Next, initialize it.
|
||||||
|
cout << "Initializing, this may take awhile depending on your ZWave network"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sensor->init(defaultDev);
|
||||||
|
cout << "Initialization complete" << endl;
|
||||||
|
|
||||||
|
cout << "Querying data..." << endl;
|
||||||
|
while (shouldRun)
|
||||||
|
{
|
||||||
|
sensor->update();
|
||||||
|
|
||||||
|
// we show both C and F for temperatures
|
||||||
|
cout << "Temperature: " << sensor->getTemperature()
|
||||||
|
<< " C / " << sensor->getTemperature(true) << " F"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Mode: "
|
||||||
|
<< sensor->getMode()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Operating State: "
|
||||||
|
<< sensor->getOperatingState()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Heating Point: " << sensor->getHeatingPointTemperature()
|
||||||
|
<< " C / " << sensor->getHeatingPointTemperature(true) << " F"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Cooling Point: " << sensor->getCoolingPointTemperature()
|
||||||
|
<< " C / " << sensor->getCoolingPointTemperature(true) << " F"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Fan Mode: "
|
||||||
|
<< sensor->getFanMode()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << "Fan State: "
|
||||||
|
<< sensor->getFanState()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
sleep(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Exiting..." << endl;
|
||||||
|
|
||||||
|
delete sensor;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
96
examples/java/AeotecDSB09104_Example.java
Normal file
96
examples/java/AeotecDSB09104_Example.java
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_ozw.AeotecDSB09104;
|
||||||
|
|
||||||
|
public class AeotecDSB09104_Example
|
||||||
|
{
|
||||||
|
private static String defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
if (args.length > 0)
|
||||||
|
defaultDev = args[0];
|
||||||
|
System.out.println("Using device " + defaultDev);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec DSB09104 instance, on device node 12.
|
||||||
|
// You will almost certainly need to change this to reflect
|
||||||
|
// your own network. Use the ozwdump example to see what
|
||||||
|
// nodes are available.
|
||||||
|
AeotecDSB09104 sensor = new AeotecDSB09104(12);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor.optionsCreate();
|
||||||
|
sensor.optionsLock();
|
||||||
|
|
||||||
|
System.out.println("Initializing, this may take awhile depending "
|
||||||
|
+ "on your ZWave network");
|
||||||
|
|
||||||
|
sensor.init(defaultDev);
|
||||||
|
System.out.println("Initialization complete");
|
||||||
|
|
||||||
|
System.out.println("Querying data...");
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
System.out.println("Watts, Channel 1: "
|
||||||
|
+ sensor.getWattsC1()
|
||||||
|
+ " W");
|
||||||
|
|
||||||
|
System.out.println("Watts, Channel 2: "
|
||||||
|
+ sensor.getWattsC2()
|
||||||
|
+ " W");
|
||||||
|
|
||||||
|
System.out.println("Watts, Channel 3: "
|
||||||
|
+ sensor.getWattsC3()
|
||||||
|
+ " W");
|
||||||
|
|
||||||
|
System.out.println("Energy, Channel 1: "
|
||||||
|
+ sensor.getEnergyC1()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
System.out.println("Energy, Channel 2: "
|
||||||
|
+ sensor.getEnergyC2()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
System.out.println("Energy, Channel 3: "
|
||||||
|
+ sensor.getEnergyC3()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
System.out.println("Battery Level: "
|
||||||
|
+ sensor.getBatteryLevel()
|
||||||
|
+ "%");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
Thread.sleep(3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
89
examples/java/AeotecDW2E_Example.java
Normal file
89
examples/java/AeotecDW2E_Example.java
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_ozw.AeotecDW2E;
|
||||||
|
|
||||||
|
public class AeotecDW2E_Example
|
||||||
|
{
|
||||||
|
private static String defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
if (args.length > 0)
|
||||||
|
defaultDev = args[0];
|
||||||
|
System.out.println("Using device " + defaultDev);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec Door/Window 2nd Edition sensor
|
||||||
|
// instance, on device node 10. You will almost certainly
|
||||||
|
// need to change this to reflect your own network. Use the
|
||||||
|
// ozwdump example to see what nodes are available.
|
||||||
|
AeotecDW2E sensor = new AeotecDW2E(10);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor.optionsCreate();
|
||||||
|
sensor.optionsLock();
|
||||||
|
|
||||||
|
System.out.println("Initializing, this may take awhile depending "
|
||||||
|
+ "on your ZWave network");
|
||||||
|
|
||||||
|
sensor.init(defaultDev);
|
||||||
|
System.out.println("Initialization complete");
|
||||||
|
|
||||||
|
System.out.println("Querying data...");
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (sensor.isDeviceAvailable())
|
||||||
|
{
|
||||||
|
System.out.println("Alarm status: "
|
||||||
|
+ sensor.isAlarmTripped());
|
||||||
|
|
||||||
|
System.out.println("Tamper Switch status: "
|
||||||
|
+ sensor.isTamperTripped());
|
||||||
|
|
||||||
|
System.out.println("Battery Level: "
|
||||||
|
+ sensor.getBatteryLevel()
|
||||||
|
+ "%");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
System.out.println("Device has not yet responded "
|
||||||
|
+ "to probe.");
|
||||||
|
System.out.println("Try waking it, or wait until "
|
||||||
|
+ "it wakes itself if "
|
||||||
|
+ "configured to do so.");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread.sleep(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
100
examples/java/AeotecSDG2_Example.java
Normal file
100
examples/java/AeotecSDG2_Example.java
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_ozw.AeotecSDG2;
|
||||||
|
|
||||||
|
public class AeotecSDG2_Example
|
||||||
|
{
|
||||||
|
private static String defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
if (args.length > 0)
|
||||||
|
defaultDev = args[0];
|
||||||
|
System.out.println("Using device " + defaultDev);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec Smart Dimmer Gen2 instance, on device node
|
||||||
|
// 9. You will almost certainly need to change this to reflect your
|
||||||
|
// own network. Use the ozwdump example to see what nodes are
|
||||||
|
// available.
|
||||||
|
AeotecSDG2 sensor = new AeotecSDG2(9);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor.optionsCreate();
|
||||||
|
sensor.optionsLock();
|
||||||
|
|
||||||
|
System.out.println("Initializing, this may take awhile depending "
|
||||||
|
+ "on your ZWave network");
|
||||||
|
|
||||||
|
sensor.init(defaultDev);
|
||||||
|
System.out.println("Initialization complete");
|
||||||
|
|
||||||
|
// turn light on
|
||||||
|
System.out.println("Turning switch on, then sleeping for 5 secs");
|
||||||
|
sensor.on();
|
||||||
|
Thread.sleep(5000);
|
||||||
|
|
||||||
|
System.out.println("Querying data...");
|
||||||
|
|
||||||
|
boolean dim = false;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// put on a light show...
|
||||||
|
if (dim)
|
||||||
|
sensor.setLevel(25);
|
||||||
|
else
|
||||||
|
sensor.on();
|
||||||
|
|
||||||
|
dim = !dim;
|
||||||
|
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
System.out.println("Switch status: "
|
||||||
|
+ sensor.isOn());
|
||||||
|
|
||||||
|
System.out.println("Volts: "
|
||||||
|
+ sensor.getVolts()
|
||||||
|
+ " volts");
|
||||||
|
|
||||||
|
System.out.println("Energy Consumption: "
|
||||||
|
+ sensor.getEnergy()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
System.out.println("Watts: "
|
||||||
|
+ sensor.getWatts());
|
||||||
|
|
||||||
|
System.out.println("Current: "
|
||||||
|
+ sensor.getCurrent()
|
||||||
|
+ " amps");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
Thread.sleep(5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
91
examples/java/AeotecSS6_Example.java
Normal file
91
examples/java/AeotecSS6_Example.java
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_ozw.AeotecSS6;
|
||||||
|
|
||||||
|
public class AeotecSS6_Example
|
||||||
|
{
|
||||||
|
private static String defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
if (args.length > 0)
|
||||||
|
defaultDev = args[0];
|
||||||
|
System.out.println("Using device " + defaultDev);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec Smart Switch 6 instance, on device
|
||||||
|
// node 11. You will almost certainly need to change this to
|
||||||
|
// reflect your own network. Use the ozwdump example to see
|
||||||
|
// what nodes are available.
|
||||||
|
AeotecSS6 sensor = new AeotecSS6(11);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor.optionsCreate();
|
||||||
|
sensor.optionsLock();
|
||||||
|
|
||||||
|
System.out.println("Initializing, this may take awhile depending "
|
||||||
|
+ "on your ZWave network");
|
||||||
|
|
||||||
|
sensor.init(defaultDev);
|
||||||
|
System.out.println("Initialization complete");
|
||||||
|
|
||||||
|
// turn light on
|
||||||
|
System.out.println("Turning switch on, then sleeping for 5 secs");
|
||||||
|
sensor.on();
|
||||||
|
Thread.sleep(5000);
|
||||||
|
|
||||||
|
System.out.println("Querying data...");
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
System.out.println("Switch status: "
|
||||||
|
+ sensor.isOn());
|
||||||
|
|
||||||
|
System.out.println("Volts: "
|
||||||
|
+ sensor.getVolts()
|
||||||
|
+ " volts");
|
||||||
|
|
||||||
|
System.out.println("Energy Consumption: "
|
||||||
|
+ sensor.getEnergy()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
System.out.println("Watts: "
|
||||||
|
+ sensor.getWatts());
|
||||||
|
|
||||||
|
System.out.println("Current: "
|
||||||
|
+ sensor.getCurrent()
|
||||||
|
+ " amps");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
Thread.sleep(3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
64
examples/java/BMA250E_Example.java
Normal file
64
examples/java/BMA250E_Example.java
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_bmx055.BMA250E;
|
||||||
|
|
||||||
|
public class BMA250E_Example
|
||||||
|
{
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate a BMA250E instance using default i2c bus and address
|
||||||
|
BMA250E sensor = new BMA250E();
|
||||||
|
|
||||||
|
// For SPI, bus 0, you would pass -1 as the address, and a
|
||||||
|
// valid pin for CS:
|
||||||
|
// BMA250E(0, -1, 10);
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
float dataA[] = sensor.getAccelerometer();
|
||||||
|
|
||||||
|
System.out.println("Accelerometer x: " + dataA[0]
|
||||||
|
+ " y: " + dataA[1]
|
||||||
|
+ " z: " + dataA[2]
|
||||||
|
+ " g");
|
||||||
|
|
||||||
|
System.out.println("Compensation Temperature: "
|
||||||
|
+ sensor.getTemperature()
|
||||||
|
+ " C / "
|
||||||
|
+ sensor.getTemperature(true)
|
||||||
|
+ " F");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
Thread.sleep(250);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
61
examples/java/BMC150_Example.java
Normal file
61
examples/java/BMC150_Example.java
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_bmx055.BMC150;
|
||||||
|
|
||||||
|
public class BMC150_Example
|
||||||
|
{
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate a BMC150 instance using default i2c bus and address
|
||||||
|
BMC150 sensor = new BMC150();
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
float data[] = sensor.getAccelerometer();
|
||||||
|
|
||||||
|
System.out.println("Accelerometer x: " + data[0]
|
||||||
|
+ " y: " + data[1]
|
||||||
|
+ " z: " + data[2]
|
||||||
|
+ " g");
|
||||||
|
|
||||||
|
data = sensor.getMagnetometer();
|
||||||
|
|
||||||
|
System.out.println("Magnetometer x: " + data[0]
|
||||||
|
+ " y: " + data[1]
|
||||||
|
+ " z: " + data[2]
|
||||||
|
+ " uT");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
Thread.sleep(250);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
64
examples/java/BMG160_Example.java
Normal file
64
examples/java/BMG160_Example.java
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_bmx055.BMG160;
|
||||||
|
|
||||||
|
public class BMG160_Example
|
||||||
|
{
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate a BMG160 instance using default i2c bus and address
|
||||||
|
BMG160 sensor = new BMG160();
|
||||||
|
|
||||||
|
// For SPI, bus 0, you would pass -1 as the address, and a
|
||||||
|
// valid pin for CS:
|
||||||
|
// BMG160(0, -1, 10);
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
float dataA[] = sensor.getGyroscope();
|
||||||
|
|
||||||
|
System.out.println("Gyroscope x: " + dataA[0]
|
||||||
|
+ " y: " + dataA[1]
|
||||||
|
+ " z: " + dataA[2]
|
||||||
|
+ " degrees/s");
|
||||||
|
|
||||||
|
System.out.println("Compensation Temperature: "
|
||||||
|
+ sensor.getTemperature()
|
||||||
|
+ " C / "
|
||||||
|
+ sensor.getTemperature(true)
|
||||||
|
+ " F");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
Thread.sleep(250);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
61
examples/java/BMI055_Example.java
Normal file
61
examples/java/BMI055_Example.java
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_bmx055.BMI055;
|
||||||
|
|
||||||
|
public class BMI055_Example
|
||||||
|
{
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate a BMI055 instance using default i2c bus and address
|
||||||
|
BMI055 sensor = new BMI055();
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
float data[] = sensor.getAccelerometer();
|
||||||
|
|
||||||
|
System.out.println("Accelerometer x: " + data[0]
|
||||||
|
+ " y: " + data[1]
|
||||||
|
+ " z: " + data[2]
|
||||||
|
+ " g");
|
||||||
|
|
||||||
|
data = sensor.getGyroscope();
|
||||||
|
|
||||||
|
System.out.println("Gyroscope x: " + data[0]
|
||||||
|
+ " y: " + data[1]
|
||||||
|
+ " z: " + data[2]
|
||||||
|
+ " degrees/s");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
Thread.sleep(250);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
58
examples/java/BMM150_Example.java
Normal file
58
examples/java/BMM150_Example.java
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_bmx055.BMM150;
|
||||||
|
|
||||||
|
public class BMM150_Example
|
||||||
|
{
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate a BMM150 instance using default i2c bus and address
|
||||||
|
BMM150 sensor = new BMM150();
|
||||||
|
|
||||||
|
// For SPI, bus 0, you would pass -1 as the address, and a
|
||||||
|
// valid pin for CS:
|
||||||
|
// BMM150(0, -1, 10);
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
float dataA[] = sensor.getMagnetometer();
|
||||||
|
|
||||||
|
System.out.println("Magnetometer x: " + dataA[0]
|
||||||
|
+ " y: " + dataA[1]
|
||||||
|
+ " z: " + dataA[2]
|
||||||
|
+ " uT");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
Thread.sleep(250);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
69
examples/java/BMX055_Example.java
Normal file
69
examples/java/BMX055_Example.java
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_bmx055.BMX055;
|
||||||
|
|
||||||
|
public class BMX055_Example
|
||||||
|
{
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
// Instantiate a BMX055 instance using default i2c bus and address
|
||||||
|
BMX055 sensor = new BMX055();
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
float data[] = sensor.getAccelerometer();
|
||||||
|
|
||||||
|
System.out.println("Accelerometer x: " + data[0]
|
||||||
|
+ " y: " + data[1]
|
||||||
|
+ " z: " + data[2]
|
||||||
|
+ " g");
|
||||||
|
|
||||||
|
data = sensor.getGyroscope();
|
||||||
|
|
||||||
|
System.out.println("Gyroscope x: " + data[0]
|
||||||
|
+ " y: " + data[1]
|
||||||
|
+ " z: " + data[2]
|
||||||
|
+ " degrees/s");
|
||||||
|
|
||||||
|
|
||||||
|
data = sensor.getMagnetometer();
|
||||||
|
|
||||||
|
System.out.println("Magnetometer x: " + data[0]
|
||||||
|
+ " y: " + data[1]
|
||||||
|
+ " z: " + data[2]
|
||||||
|
+ " uT");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
Thread.sleep(250);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
@ -124,10 +124,13 @@ if (MODBUS_FOUND)
|
|||||||
endif()
|
endif()
|
||||||
if (BACNET_FOUND)
|
if (BACNET_FOUND)
|
||||||
add_example(E50HX_Example e50hx)
|
add_example(E50HX_Example e50hx)
|
||||||
|
add_example(T8100_Example t8100)
|
||||||
|
add_example(TB7300_Example tb7300)
|
||||||
endif()
|
endif()
|
||||||
add_example(VCAP_Example vcap)
|
add_example(VCAP_Example vcap)
|
||||||
add_example(BMP280_Example bmp280)
|
add_example(BMP280_Example bmp280)
|
||||||
add_example(BNO055_Example bno055)
|
add_example(BNO055_Example bno055)
|
||||||
|
add_example(BMX055_Example bmx055)
|
||||||
|
|
||||||
add_example_with_path(Jhd1313m1_lcdSample lcd i2clcd)
|
add_example_with_path(Jhd1313m1_lcdSample lcd i2clcd)
|
||||||
add_example_with_path(Jhd1313m1Sample lcd i2clcd)
|
add_example_with_path(Jhd1313m1Sample lcd i2clcd)
|
||||||
@ -136,4 +139,16 @@ add_example_with_path(Lcm1602_parallelSample lcd i2clcd)
|
|||||||
add_example_with_path(SSD1308_oledSample lcd i2clcd)
|
add_example_with_path(SSD1308_oledSample lcd i2clcd)
|
||||||
add_example_with_path(SSD1327_oledSample lcd i2clcd)
|
add_example_with_path(SSD1327_oledSample lcd i2clcd)
|
||||||
add_example_with_path(BME280_Example bmp280 bmp280)
|
add_example_with_path(BME280_Example bmp280 bmp280)
|
||||||
|
add_example_with_path(BMA250E_Example bmx055 bmx055)
|
||||||
|
add_example_with_path(BMG160_Example bmx055 bmx055)
|
||||||
|
add_example_with_path(BMM150_Example bmx055 bmx055)
|
||||||
|
add_example_with_path(BMC150_Example bmx055 bmx055)
|
||||||
|
add_example_with_path(BMI055_Example bmx055 bmx055)
|
||||||
|
if (OPENZWAVE_FOUND)
|
||||||
|
add_example_with_path(AeotecSS6_Example ozw ozw)
|
||||||
|
add_example_with_path(AeotecSDG2_Example ozw ozw)
|
||||||
|
add_example_with_path(AeotecDW2E_Example ozw ozw)
|
||||||
|
add_example_with_path(AeotecDSB09104_Example ozw ozw)
|
||||||
|
add_example_with_path(TZEMT400_Example ozw ozw)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
@ -58,8 +58,10 @@ public class E50HX_Example
|
|||||||
// sensor.setDebug(true);
|
// sensor.setDebug(true);
|
||||||
|
|
||||||
System.out.println();
|
System.out.println();
|
||||||
System.out.println("Device Description: " + sensor.getDescription());
|
System.out.println("Device Description: "
|
||||||
System.out.println("Device Location: " + sensor.getLocation());
|
+ sensor.getDeviceDescription());
|
||||||
|
System.out.println("Device Location: "
|
||||||
|
+ sensor.getDeviceLocation());
|
||||||
System.out.println();
|
System.out.println();
|
||||||
|
|
||||||
// update and print a few values every 5 seconds
|
// update and print a few values every 5 seconds
|
||||||
@ -84,7 +86,6 @@ public class E50HX_Example
|
|||||||
System.out.println();
|
System.out.println();
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ! [Interesting]
|
// ! [Interesting]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
97
examples/java/T8100_Example.java
Normal file
97
examples/java/T8100_Example.java
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_t8100.T8100;
|
||||||
|
|
||||||
|
public class T8100_Example
|
||||||
|
{
|
||||||
|
private static String defaultDev = "/dev/ttyUSB0";
|
||||||
|
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
// You will need to edit this example to conform to your site
|
||||||
|
// and your devices, specifically the Device Object Instance
|
||||||
|
// ID passed to the constructor, and the arguments to
|
||||||
|
// initMaster() that are appropriate for your BACnet network.
|
||||||
|
|
||||||
|
if (args.length > 0)
|
||||||
|
defaultDev = args[0];
|
||||||
|
System.out.println("Using device " + defaultDev);
|
||||||
|
System.out.println("Initializing...");
|
||||||
|
|
||||||
|
// Instantiate an T8100 object for an T8100 device that has
|
||||||
|
// 568000 as it's unique Device Object Instance ID. NOTE: You
|
||||||
|
// will certainly want to change this to the correct value for
|
||||||
|
// your device(s).
|
||||||
|
T8100 sensor = new T8100(568000);
|
||||||
|
|
||||||
|
// Initialize our BACnet master, if it has not already been
|
||||||
|
// initialized, with the device and baudrate, choosing 1000001
|
||||||
|
// as our unique Device Object Instance ID, 2 as our MAC
|
||||||
|
// address and using default values for maxMaster and
|
||||||
|
// maxInfoFrames
|
||||||
|
sensor.initMaster(defaultDev, 38400, 1000001, 2);
|
||||||
|
|
||||||
|
// Uncomment to enable debugging output
|
||||||
|
// sensor.setDebug(true);
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
System.out.println("Device Description: "
|
||||||
|
+ sensor.getDeviceDescription());
|
||||||
|
System.out.println("Device Location: " + sensor.getDeviceLocation());
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
// update and print a few values every 5 seconds
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// update our values
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
System.out.println("CO2 Concentration: "
|
||||||
|
+ sensor.getCO2()
|
||||||
|
+ " ppm");
|
||||||
|
|
||||||
|
// we show both C and F for temperature
|
||||||
|
System.out.println("Temperature: "
|
||||||
|
+ sensor.getTemperature()
|
||||||
|
+ " C / "
|
||||||
|
+ sensor.getTemperature(true)
|
||||||
|
+ " F");
|
||||||
|
|
||||||
|
System.out.println("Humidity: "
|
||||||
|
+ sensor.getHumidity()
|
||||||
|
+ " %RH");
|
||||||
|
|
||||||
|
System.out.println("Relay State: "
|
||||||
|
+ sensor.getRelayState());
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
Thread.sleep(5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
99
examples/java/TB7300_Example.java
Normal file
99
examples/java/TB7300_Example.java
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_tb7300.TB7300;
|
||||||
|
|
||||||
|
public class TB7300_Example
|
||||||
|
{
|
||||||
|
private static String defaultDev = "/dev/ttyUSB0";
|
||||||
|
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
// You will need to edit this example to conform to your site
|
||||||
|
// and your devices, specifically the Device Object Instance
|
||||||
|
// ID passed to the constructor, and the arguments to
|
||||||
|
// initMaster() that are appropriate for your BACnet network.
|
||||||
|
|
||||||
|
if (args.length > 0)
|
||||||
|
defaultDev = args[0];
|
||||||
|
System.out.println("Using device " + defaultDev);
|
||||||
|
System.out.println("Initializing...");
|
||||||
|
|
||||||
|
// Instantiate an TB7300 object for an TB7300 device that has
|
||||||
|
// 73001 as it's unique Device Object Instance ID. NOTE: You
|
||||||
|
// will certainly want to change this to the correct value for
|
||||||
|
// your device(s).
|
||||||
|
TB7300 sensor = new TB7300(73001);
|
||||||
|
|
||||||
|
// Initialize our BACnet master, if it has not already been
|
||||||
|
// initialized, with the device and baudrate, choosing 1000001
|
||||||
|
// as our unique Device Object Instance ID, 2 as our MAC
|
||||||
|
// address and using default values for maxMaster and
|
||||||
|
// maxInfoFrames
|
||||||
|
sensor.initMaster(defaultDev, 38400, 1000001, 2);
|
||||||
|
|
||||||
|
// Uncomment to enable debugging output
|
||||||
|
// sensor.setDebug(true);
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
System.out.println("Device Name: "
|
||||||
|
+ sensor.getDeviceName());
|
||||||
|
System.out.println("Device Description: "
|
||||||
|
+ sensor.getDeviceDescription());
|
||||||
|
System.out.println("Device Location: " + sensor.getDeviceLocation());
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
System.out.println("Fan Mode: "
|
||||||
|
+ sensor.getMultiStateValueText(TB7300.MULTISTATE_VALUES_T.MV_Fan_Mode));
|
||||||
|
System.out.println("Fan Status: "
|
||||||
|
+ sensor.getMultiStateValueText(TB7300.MULTISTATE_VALUES_T.MV_Fan_Status));
|
||||||
|
System.out.println("System Mode: "
|
||||||
|
+ sensor.getMultiStateValueText(TB7300.MULTISTATE_VALUES_T.MV_System_Mode));
|
||||||
|
System.out.println("Service Alarm:"
|
||||||
|
+ sensor.getBinaryInputText(TB7300.BINARY_INPUTS_T.BI_Service_Alarm));
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
// update and print the room temperature every 5 seconds
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// update our values
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
// we show both C and F for temperature
|
||||||
|
System.out.println("Temperature: "
|
||||||
|
+ sensor.getTemperature()
|
||||||
|
+ " C / "
|
||||||
|
+ sensor.getTemperature(true)
|
||||||
|
+ " F");
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
Thread.sleep(5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
98
examples/java/TZEMT400_Example.java
Normal file
98
examples/java/TZEMT400_Example.java
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_ozw.TZEMT400;
|
||||||
|
|
||||||
|
public class TZEMT400_Example
|
||||||
|
{
|
||||||
|
private static String defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
public static void main(String[] args) throws InterruptedException
|
||||||
|
{
|
||||||
|
// ! [Interesting]
|
||||||
|
|
||||||
|
if (args.length > 0)
|
||||||
|
defaultDev = args[0];
|
||||||
|
System.out.println("Using device " + defaultDev);
|
||||||
|
|
||||||
|
// Instantiate a TZEMT400 instance, on device node 13. You
|
||||||
|
// will almost certainly need to change this to reflect your
|
||||||
|
// own network. Use the ozwdump example to see what nodes are
|
||||||
|
// available.
|
||||||
|
TZEMT400 sensor = new TZEMT400(13);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor.optionsCreate();
|
||||||
|
sensor.optionsLock();
|
||||||
|
|
||||||
|
System.out.println("Initializing, this may take awhile depending "
|
||||||
|
+ "on your ZWave network");
|
||||||
|
|
||||||
|
sensor.init(defaultDev);
|
||||||
|
System.out.println("Initialization complete");
|
||||||
|
|
||||||
|
System.out.println("Querying data...");
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
System.out.println("Temperature: "
|
||||||
|
+ sensor.getTemperature()
|
||||||
|
+ " C / "
|
||||||
|
+ sensor.getTemperature(true)
|
||||||
|
+ " F");
|
||||||
|
|
||||||
|
System.out.println("Mode: "
|
||||||
|
+ sensor.getMode());
|
||||||
|
|
||||||
|
System.out.println("Operating State: "
|
||||||
|
+ sensor.getOperatingState());
|
||||||
|
|
||||||
|
System.out.println("Heating Point: "
|
||||||
|
+ sensor.getHeatingPointTemperature()
|
||||||
|
+ " C / "
|
||||||
|
+ sensor.getHeatingPointTemperature(true)
|
||||||
|
+ " F");
|
||||||
|
|
||||||
|
System.out.println("Cooling Point: "
|
||||||
|
+ sensor.getCoolingPointTemperature()
|
||||||
|
+ " C / "
|
||||||
|
+ sensor.getCoolingPointTemperature(true)
|
||||||
|
+ " F");
|
||||||
|
|
||||||
|
System.out.println("Fan Mode: "
|
||||||
|
+ sensor.getFanMode());
|
||||||
|
|
||||||
|
System.out.println("Fan State: "
|
||||||
|
+ sensor.getFanState());
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
Thread.sleep(5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ! [Interesting]
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*global */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2014 Intel Corporation.
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*global */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Marc Graham <marc@m2ag.net>
|
* Author: Marc Graham <marc@m2ag.net>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
100
examples/javascript/aeotecdsb09104.js
Normal file
100
examples/javascript/aeotecdsb09104.js
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_ozw');
|
||||||
|
|
||||||
|
/************** Main code **************/
|
||||||
|
var defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (process.argv.length > 2)
|
||||||
|
{
|
||||||
|
defaultDev = process.argv[2];
|
||||||
|
}
|
||||||
|
console.log("Using device " + defaultDev);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec DSB09104 instance, on device node 12. You
|
||||||
|
// will almost certainly need to change this to reflect your own
|
||||||
|
// network. Use the ozwdump example to see what nodes are
|
||||||
|
// available.
|
||||||
|
var sensor = new sensorObj.AeotecDSB09104(12);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor.optionsCreate();
|
||||||
|
sensor.optionsLock();
|
||||||
|
|
||||||
|
// Next, initialize it.
|
||||||
|
console.log("Initializing, this may take awhile depending on your ZWave network");
|
||||||
|
|
||||||
|
sensor.init(defaultDev);
|
||||||
|
console.log("Initialization complete");
|
||||||
|
|
||||||
|
console.log("Querying data...");
|
||||||
|
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
console.log("Watts, Channel 1: "
|
||||||
|
+ sensor.getWattsC1()
|
||||||
|
+ " W");
|
||||||
|
|
||||||
|
console.log("Watts, Channel 2: "
|
||||||
|
+ sensor.getWattsC2()
|
||||||
|
+ " W");
|
||||||
|
|
||||||
|
console.log("Watts, Channel 3: "
|
||||||
|
+ sensor.getWattsC3()
|
||||||
|
+ " W");
|
||||||
|
|
||||||
|
console.log("Energy, Channel 1: "
|
||||||
|
+ sensor.getEnergyC1()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
console.log("Energy, Channel 2: "
|
||||||
|
+ sensor.getEnergyC2()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
console.log("Energy, Channel 3: "
|
||||||
|
+ sensor.getEnergyC3()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
console.log("Battery Level: "
|
||||||
|
+ sensor.getBatteryLevel()
|
||||||
|
+ "%");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
}, 3000);
|
||||||
|
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
92
examples/javascript/aeotecdw2e.js
Normal file
92
examples/javascript/aeotecdw2e.js
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_ozw');
|
||||||
|
|
||||||
|
/************** Main code **************/
|
||||||
|
var defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (process.argv.length > 2)
|
||||||
|
{
|
||||||
|
defaultDev = process.argv[2];
|
||||||
|
}
|
||||||
|
console.log("Using device " + defaultDev);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec Door/Window 2nd Edition sensor instance, on
|
||||||
|
// device node 10. You will almost certainly need to change this to
|
||||||
|
// reflect your own network. Use the ozwdump example to see what
|
||||||
|
// nodes are available.
|
||||||
|
var sensor = new sensorObj.AeotecDW2E(10);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor.optionsCreate();
|
||||||
|
sensor.optionsLock();
|
||||||
|
|
||||||
|
// Next, initialize it.
|
||||||
|
console.log("Initializing, this may take awhile depending on your ZWave network");
|
||||||
|
|
||||||
|
sensor.init(defaultDev);
|
||||||
|
console.log("Initialization complete");
|
||||||
|
|
||||||
|
console.log("Querying data...");
|
||||||
|
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
if (sensor.isDeviceAvailable())
|
||||||
|
{
|
||||||
|
console.log("Alarm status: "
|
||||||
|
+ sensor.isAlarmTripped());
|
||||||
|
|
||||||
|
console.log("Tamper Switch status: "
|
||||||
|
+ sensor.isTamperTripped());
|
||||||
|
|
||||||
|
console.log("Battery Level: "
|
||||||
|
+ sensor.getBatteryLevel()
|
||||||
|
+ "%");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
console.log("Device has not yet responded to probe.");
|
||||||
|
console.log("Try waking it, or wait until it wakes itself if "
|
||||||
|
+ "configured to do so.");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
}
|
||||||
|
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
116
examples/javascript/aeotecsdg2.js
Normal file
116
examples/javascript/aeotecsdg2.js
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_ozw');
|
||||||
|
|
||||||
|
function sleepFor(millis)
|
||||||
|
{
|
||||||
|
var now = new Date().getTime();
|
||||||
|
while(new Date().getTime() < now + millis)
|
||||||
|
{
|
||||||
|
/* do nothing */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/************** Main code **************/
|
||||||
|
var defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (process.argv.length > 2)
|
||||||
|
{
|
||||||
|
defaultDev = process.argv[2];
|
||||||
|
}
|
||||||
|
console.log("Using device " + defaultDev);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec Smart Dimmer Gen2 instance, on device node
|
||||||
|
// 9. You will almost certainly need to change this to reflect your
|
||||||
|
// own network. Use the ozwdump example to see what nodes are
|
||||||
|
// available.
|
||||||
|
var sensor = new sensorObj.AeotecSDG2(9);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor.optionsCreate();
|
||||||
|
sensor.optionsLock();
|
||||||
|
|
||||||
|
// Next, initialize it.
|
||||||
|
console.log("Initializing, this may take awhile depending on your ZWave network");
|
||||||
|
|
||||||
|
sensor.init(defaultDev);
|
||||||
|
console.log("Initialization complete");
|
||||||
|
|
||||||
|
// turn light on
|
||||||
|
console.log("Turning switch on, then sleeping for 5 secs");
|
||||||
|
sensor.on();
|
||||||
|
sleepFor(5000);
|
||||||
|
|
||||||
|
console.log("Querying data...");
|
||||||
|
var dim = false;
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
// put on a light show...
|
||||||
|
if (dim)
|
||||||
|
sensor.setLevel(25);
|
||||||
|
else
|
||||||
|
sensor.on();
|
||||||
|
|
||||||
|
dim = !dim;
|
||||||
|
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
console.log("Current Level: "
|
||||||
|
+ sensor.getLevel());
|
||||||
|
|
||||||
|
console.log("Volts: "
|
||||||
|
+ sensor.getVolts()
|
||||||
|
+ " volts");
|
||||||
|
|
||||||
|
console.log("Energy Consumption: "
|
||||||
|
+ sensor.getEnergy()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
console.log("Watts: "
|
||||||
|
+ sensor.getWatts());
|
||||||
|
|
||||||
|
console.log("Current: "
|
||||||
|
+ sensor.getCurrent()
|
||||||
|
+ " amps");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
console.log("Turning switch off and sleeping for 5 seconds...");
|
||||||
|
sensor.off();
|
||||||
|
sleepFor(5000);
|
||||||
|
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
107
examples/javascript/aeotecss6.js
Normal file
107
examples/javascript/aeotecss6.js
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_ozw');
|
||||||
|
|
||||||
|
function sleepFor(millis)
|
||||||
|
{
|
||||||
|
var now = new Date().getTime();
|
||||||
|
while(new Date().getTime() < now + millis)
|
||||||
|
{
|
||||||
|
/* do nothing */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/************** Main code **************/
|
||||||
|
var defaultDev = "/dev/ttyACM0";
|
||||||
|
|
||||||
|
// if an argument was specified, use it as the device instead
|
||||||
|
if (process.argv.length > 2)
|
||||||
|
{
|
||||||
|
defaultDev = process.argv[2];
|
||||||
|
}
|
||||||
|
console.log("Using device " + defaultDev);
|
||||||
|
|
||||||
|
// Instantiate an Aeotec Smart Switch 6 instance, on device node 11.
|
||||||
|
// You will almost certainly need to change this to reflect your own
|
||||||
|
// network. Use the ozwdump example to see what nodes are available.
|
||||||
|
var sensor = new sensorObj.AeotecSS6(11);
|
||||||
|
|
||||||
|
// The first thing to do is create options, then lock them when done.
|
||||||
|
sensor.optionsCreate();
|
||||||
|
sensor.optionsLock();
|
||||||
|
|
||||||
|
// Next, initialize it.
|
||||||
|
console.log("Initializing, this may take awhile depending on your ZWave network");
|
||||||
|
|
||||||
|
sensor.init(defaultDev);
|
||||||
|
console.log("Initialization complete");
|
||||||
|
|
||||||
|
// turn light on
|
||||||
|
console.log("Turning switch on, then sleeping for 5 secs");
|
||||||
|
sensor.on();
|
||||||
|
sleepFor(5000);
|
||||||
|
|
||||||
|
console.log("Querying data...");
|
||||||
|
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
console.log("Switch status: "
|
||||||
|
+ sensor.isOn());
|
||||||
|
|
||||||
|
console.log("Volts: "
|
||||||
|
+ sensor.getVolts()
|
||||||
|
+ " volts");
|
||||||
|
|
||||||
|
console.log("Energy Consumption: "
|
||||||
|
+ sensor.getEnergy()
|
||||||
|
+ " kWh");
|
||||||
|
|
||||||
|
console.log("Watts: "
|
||||||
|
+ sensor.getWatts());
|
||||||
|
|
||||||
|
console.log("Current: "
|
||||||
|
+ sensor.getCurrent()
|
||||||
|
+ " amps");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
}, 3000);
|
||||||
|
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
console.log("Turning switch off and sleeping for 5 seconds...");
|
||||||
|
sensor.off();
|
||||||
|
sleepFor(5000);
|
||||||
|
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Yannick Adam <yannick.adam@gmail.com>
|
* Author: Yannick Adam <yannick.adam@gmail.com>
|
||||||
* Copyright (c) 2016 Yannick Adam
|
* Copyright (c) 2016 Yannick Adam
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*global */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2014 Intel Corporation.
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
69
examples/javascript/bma250e.js
Normal file
69
examples/javascript/bma250e.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_bmx055');
|
||||||
|
|
||||||
|
// Instantiate a BMA250E instance using default i2c bus and address
|
||||||
|
var sensor = new sensorObj.BMA250E();
|
||||||
|
|
||||||
|
// For SPI, bus 0, you would pass -1 as the address, and a valid pin for CS:
|
||||||
|
// BMA250E(0, -1, 10);
|
||||||
|
|
||||||
|
var x = new sensorObj.new_floatp();
|
||||||
|
var y = new sensorObj.new_floatp();
|
||||||
|
var z = new sensorObj.new_floatp();
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
sensor.getAccelerometer(x, y, z);
|
||||||
|
console.log("Accelerometer x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " g");
|
||||||
|
|
||||||
|
// we show both C and F for temperature
|
||||||
|
console.log("Compensation Temperature: "
|
||||||
|
+ sensor.getTemperature()
|
||||||
|
+ " C / "
|
||||||
|
+ sensor.getTemperature(true)
|
||||||
|
+ " F");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
|
||||||
|
}, 250);
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
66
examples/javascript/bmc150.js
Normal file
66
examples/javascript/bmc150.js
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_bmx055');
|
||||||
|
|
||||||
|
// Instantiate a BMC150 instance using default i2c bus and address
|
||||||
|
var sensor = new sensorObj.BMC150();
|
||||||
|
|
||||||
|
var x = new sensorObj.new_floatp();
|
||||||
|
var y = new sensorObj.new_floatp();
|
||||||
|
var z = new sensorObj.new_floatp();
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
sensor.getAccelerometer(x, y, z);
|
||||||
|
console.log("Accelerometer x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " g");
|
||||||
|
|
||||||
|
sensor.getMagnetometer(x, y, z);
|
||||||
|
console.log("Magnetometer x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " uT");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
|
||||||
|
}, 250);
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2016 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
69
examples/javascript/bmg160.js
Normal file
69
examples/javascript/bmg160.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_bmx055');
|
||||||
|
|
||||||
|
// Instantiate a BMG160 instance using default i2c bus and address
|
||||||
|
var sensor = new sensorObj.BMG160();
|
||||||
|
|
||||||
|
// For SPI, bus 0, you would pass -1 as the address, and a valid pin for CS:
|
||||||
|
// BMG160(0, -1, 10);
|
||||||
|
|
||||||
|
var x = new sensorObj.new_floatp();
|
||||||
|
var y = new sensorObj.new_floatp();
|
||||||
|
var z = new sensorObj.new_floatp();
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
sensor.getGyroscope(x, y, z);
|
||||||
|
console.log("Gyroscope x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " degrees/s");
|
||||||
|
|
||||||
|
// we show both C and F for temperature
|
||||||
|
console.log("Compensation Temperature: "
|
||||||
|
+ sensor.getTemperature()
|
||||||
|
+ " C / "
|
||||||
|
+ sensor.getTemperature(true)
|
||||||
|
+ " F");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
|
||||||
|
}, 250);
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
66
examples/javascript/bmi055.js
Normal file
66
examples/javascript/bmi055.js
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_bmx055');
|
||||||
|
|
||||||
|
// Instantiate a BMI055 instance using default i2c bus and address
|
||||||
|
var sensor = new sensorObj.BMI055();
|
||||||
|
|
||||||
|
var x = new sensorObj.new_floatp();
|
||||||
|
var y = new sensorObj.new_floatp();
|
||||||
|
var z = new sensorObj.new_floatp();
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
sensor.getAccelerometer(x, y, z);
|
||||||
|
console.log("Accelerometer x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " g");
|
||||||
|
|
||||||
|
sensor.getGyroscope(x, y, z);
|
||||||
|
console.log("Gyroscope x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " degrees/s");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
|
||||||
|
}, 250);
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2016 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
62
examples/javascript/bmm150.js
Normal file
62
examples/javascript/bmm150.js
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_bmx055');
|
||||||
|
|
||||||
|
// Instantiate a BMM150 instance using default i2c bus and address
|
||||||
|
var sensor = new sensorObj.BMM150();
|
||||||
|
|
||||||
|
// For SPI, bus 0, you would pass -1 as the address, and a valid pin for CS:
|
||||||
|
// BMM150(0, -1, 10);
|
||||||
|
|
||||||
|
var x = new sensorObj.new_floatp();
|
||||||
|
var y = new sensorObj.new_floatp();
|
||||||
|
var z = new sensorObj.new_floatp();
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
sensor.getMagnetometer(x, y, z);
|
||||||
|
console.log("Magnetometer x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " uT");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
|
||||||
|
}, 250);
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2016 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*global */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2014 Intel Corporation.
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
73
examples/javascript/bmx055.js
Normal file
73
examples/javascript/bmx055.js
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var sensorObj = require('jsupm_bmx055');
|
||||||
|
|
||||||
|
// Instantiate a BMX055 instance using default i2c bus and address
|
||||||
|
var sensor = new sensorObj.BMX055();
|
||||||
|
|
||||||
|
var x = new sensorObj.new_floatp();
|
||||||
|
var y = new sensorObj.new_floatp();
|
||||||
|
var z = new sensorObj.new_floatp();
|
||||||
|
|
||||||
|
// now output data every 250 milliseconds
|
||||||
|
setInterval(function()
|
||||||
|
{
|
||||||
|
// update our values from the sensor
|
||||||
|
sensor.update();
|
||||||
|
|
||||||
|
sensor.getAccelerometer(x, y, z);
|
||||||
|
console.log("Accelerometer x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " g");
|
||||||
|
|
||||||
|
sensor.getGyroscope(x, y, z);
|
||||||
|
console.log("Gyroscope x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " degrees/s");
|
||||||
|
|
||||||
|
sensor.getMagnetometer(x, y, z);
|
||||||
|
console.log("Magnetometer x: "
|
||||||
|
+ sensorObj.floatp_value(x)
|
||||||
|
+ " y: " + sensorObj.floatp_value(y)
|
||||||
|
+ " z: " + sensorObj.floatp_value(z)
|
||||||
|
+ " uT");
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
|
||||||
|
}, 250);
|
||||||
|
|
||||||
|
// exit on ^C
|
||||||
|
process.on('SIGINT', function()
|
||||||
|
{
|
||||||
|
sensor = null;
|
||||||
|
sensorObj.cleanUp();
|
||||||
|
sensorObj = null;
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2016 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*global */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2014 Intel Corporation.
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Ron Evans (@deadprogram)
|
* Author: Ron Evans (@deadprogram)
|
||||||
* Copyright (c) 2016 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2016 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*global */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2014 Intel Corporation.
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2016 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2016 Intel Corporation.
|
* Copyright (c) 2016 Intel Corporation.
|
||||||
@ -63,8 +60,8 @@ sensor.initMaster(defaultDev, 38400, 1000001, 2);
|
|||||||
// sensor.setDebug(true);
|
// sensor.setDebug(true);
|
||||||
|
|
||||||
console.log("");
|
console.log("");
|
||||||
console.log("Device Description:", sensor.getDescription());
|
console.log("Device Description:", sensor.getDeviceDescription());
|
||||||
console.log("Device Location:", sensor.getLocation());
|
console.log("Device Location:", sensor.getDeviceLocation());
|
||||||
console.log("");
|
console.log("");
|
||||||
|
|
||||||
// update and print a few values every 5 seconds
|
// update and print a few values every 5 seconds
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*global */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2014 Intel Corporation.
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*global */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2014 Intel Corporation.
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2014 Intel Corporation.
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Jun Kato
|
* Author: Jun Kato
|
||||||
* Contributions: Jon Trulson <jtrulson@ics.com>
|
* Contributions: Jon Trulson <jtrulson@ics.com>
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2014 Intel Corporation.
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Jon Trulson <jtrulson@ics.com>
|
* Author: Jon Trulson <jtrulson@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
||||||
/*jshint unused:true */
|
|
||||||
/*
|
/*
|
||||||
* Author: Zion Orent <zorent@ics.com>
|
* Author: Zion Orent <zorent@ics.com>
|
||||||
* Copyright (c) 2015 Intel Corporation.
|
* Copyright (c) 2015 Intel Corporation.
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user