mirror of
https://github.com/eclipse/upm.git
synced 2025-07-06 20:01:12 +03:00
Compare commits
40 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 |
@ -17,9 +17,9 @@ compiler:
|
||||
- clang
|
||||
- gcc
|
||||
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 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 update-java-alternatives -s java-8-oracle
|
||||
before_script:
|
||||
|
@ -10,7 +10,7 @@ find_package (PkgConfig REQUIRED)
|
||||
|
||||
# Force a libmraa search and minimum required version every time a config is generated
|
||||
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}")
|
||||
|
||||
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.
|
||||
@ -25,7 +25,7 @@ include (GetGitRevisionDescription)
|
||||
git_describe (VERSION "--tags")
|
||||
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
|
||||
message (WARNING " - Install git to compile a production UPM!")
|
||||
set (VERSION "v0.7.1-dirty")
|
||||
set (VERSION "v0.8.0-dirty")
|
||||
endif ()
|
||||
|
||||
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 "")
|
||||
|
||||
option (BUILDDOC "Build all doc." OFF)
|
||||
option (BUILDSWIG "Build swig 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 (BUILDSWIGJAVA "Build swig java modules" OFF)
|
||||
option (BUILDPYTHON3 "Use python3 for building/installing/testing" OFF)
|
||||
option (BUILDEXAMPLES "Build C++ example binaries" OFF)
|
||||
option (BUILDJAVAEXAMPLES "Build java example jars" OFF)
|
||||
option (BUILDSWIGJAVA "Build swig java modules" OFF)
|
||||
option (IPK "Generate IPK using CPack" OFF)
|
||||
option (RPM "Generate RPM using CPack" OFF)
|
||||
option (BUILDTESTS "Generate check-ups for upm" ON)
|
||||
option (ENABLECXX11 "Enable C++11 standards support" ON)
|
||||
|
||||
# Find swig
|
||||
if (BUILDSWIG)
|
||||
if (BUILDSWIGPYTHON OR BUILDSWIGNODE OR BUILDSWIGJAVA)
|
||||
if (BUILDSWIGNODE)
|
||||
find_package (SWIG 3.0.5 REQUIRED)
|
||||
else ()
|
||||
@ -125,7 +124,7 @@ if (BUILDDOC)
|
||||
endif (DOXYGEN_FOUND)
|
||||
# Check if Sphinx is installed and add target to generate API documentation
|
||||
find_package (Sphinx)
|
||||
if(SPHINX_FOUND AND BUILDSWIG AND BUILDSWIGPYTHON)
|
||||
if(SPHINX_FOUND AND BUILDSWIGPYTHON)
|
||||
# Python required for Sphinx build
|
||||
find_package (PythonLibs ${PYTHONBUILD_VERSION} REQUIRED)
|
||||
string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
|
||||
@ -231,14 +230,6 @@ if (RPM)
|
||||
include(CPack)
|
||||
endif()
|
||||
|
||||
if(BUILDEXAMPLES)
|
||||
add_subdirectory (examples/c++)
|
||||
endif()
|
||||
|
||||
if(BUILDJAVAEXAMPLES)
|
||||
add_subdirectory (examples/java)
|
||||
endif()
|
||||
|
||||
if (BUILDSWIGPYTHON OR BUILDTESTS)
|
||||
if (BUILDPYTHON3)
|
||||
set (PYTHONBUILD_VERSION 3)
|
||||
@ -248,6 +239,14 @@ if (BUILDSWIGPYTHON OR BUILDTESTS)
|
||||
endif ()
|
||||
|
||||
add_subdirectory (src)
|
||||
if(BUILDEXAMPLES)
|
||||
add_subdirectory (examples/c++)
|
||||
endif()
|
||||
|
||||
if(BUILDJAVAEXAMPLES)
|
||||
add_subdirectory (examples/java)
|
||||
endif()
|
||||
|
||||
|
||||
if (BUILDTESTS)
|
||||
find_package (PythonInterp ${PYTHONBUILD_VERSION} REQUIRED)
|
||||
|
@ -86,6 +86,8 @@ please refer to the Intel Developer Zone IDE page.
|
||||
|
||||
See building documentation [here](docs/building.md).
|
||||
|
||||
[](https://travis-ci.org/intel-iot-devkit/upm)
|
||||
|
||||
### Making your own UPM module
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
@ -12,4 +16,3 @@ compatibility between releases:
|
||||
* **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()`
|
||||
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/
|
||||
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
|
||||
the install location of mraa pkgconfig to the following environment variable:
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
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
|
||||
individual CMakeLists.txt files.
|
||||
@ -45,10 +56,18 @@ Cross-compiling on a different system:
|
||||
-DCMAKE_CXX_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:
|
||||
~~~~~~~~~~~~~
|
||||
-DBUILDSWIGNODE=OFF
|
||||
~~~~~~~~~~~~~
|
||||
Generating python3 modules instead of python2.7
|
||||
~~~~~~~~~~~~~
|
||||
-DBUILDPYTHON3=ON
|
||||
~~~~~~~~~~~~~
|
||||
Disabling python module building
|
||||
~~~~~~~~~~~~~
|
||||
-DBUILDSWIGPYTHON=OFF
|
||||
@ -57,7 +76,7 @@ Setting the python library to use:
|
||||
~~~~~~~~~~~~~
|
||||
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.so.1.0
|
||||
~~~~~~~~~~~~~
|
||||
Building doxygen doc
|
||||
Building documentation
|
||||
~~~~~~~~~~~~~
|
||||
-DBUILDDOC=ON
|
||||
~~~~~~~~~~~~~
|
||||
@ -65,12 +84,16 @@ Build C++ example binaries
|
||||
~~~~~~~~~~~~~
|
||||
-DBUILDEXAMPLES=ON
|
||||
~~~~~~~~~~~~~
|
||||
Build Java examples
|
||||
~~~~~~~~~~~~~
|
||||
-DBUILDJAVAEXAMPLES=ON
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
If you intend to turn on all the options and build everything at once (C++,
|
||||
Node, Python and Documentation) you will have to edit the src/doxy2swig.py file
|
||||
and change the line endings from Windows style to Linux format. This has to be
|
||||
repeated every time to sync with the master branch since our Github repository
|
||||
stores files using CR LF line breaks.
|
||||
If you intend to turn on all the options and build everything at once
|
||||
(C++, Java, Node, Python and Documentation) you will have to edit the
|
||||
src/doxy2swig.py file and change the line endings from Windows style to Linux
|
||||
format. This has to be repeated every time to sync with the master branch since
|
||||
our Github repository stores files using CR LF line breaks.
|
||||
|
||||
You can also generate the include and lib directories containing all the sensor
|
||||
headers and library files respectively with *make install*. Further, you may
|
||||
|
@ -4,6 +4,33 @@ Changelog {#changelog}
|
||||
Here's a list summarizing some of the key undergoing changes to our library
|
||||
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
|
||||
|
@ -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
|
||||
dropped characters, washed out text and/or failed I2C writes while using USB
|
||||
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
|
||||
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.
|
||||
@ -49,6 +53,8 @@ such sensors and known workarounds if they exist.
|
||||
it will trigger continous callbacks when the sensor is not reading anything.
|
||||
* **Grove RTC** (DS1307) is not compatible with the Intel Edison Arduino board
|
||||
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
|
||||
|
||||
@ -57,12 +63,15 @@ such sensors and known workarounds if they exist.
|
||||
|
||||
#### Other Sensors
|
||||
|
||||
* **NRF24L01** corrupted data packets are sent to the device due to the Intel
|
||||
Edison SPI bus limitation. Sensor works as expected with the Intel Galileo
|
||||
boards.
|
||||
* **NRF8001** based devices do not initialize properly with provided examples
|
||||
on Intel Edison boards also due to SPI bus limitation and data corruption.
|
||||
Works on Intel Galileo.
|
||||
* **MLX90614** is not compatible with the Intel Galileo due to the inability
|
||||
to change the I2C bus speed to 100 KHz.
|
||||
* **MICSV89** is not compatible with the Intel Galileo due to the inability to
|
||||
change the I2C bus speed to 100 KHz.
|
||||
* **MPL3115A2** uses repeated starts for I2C communication and may not work as
|
||||
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
|
||||
|
||||
@ -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.
|
||||
|
||||
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
|
||||
slightly or make the sensor entirely unusable. Unlike the I2C bus limitation,
|
||||
different boards are not likely to resolve this. A kernel update on the other
|
||||
hand might help alleviate this.
|
||||
sensors are connected to it, if using an old image. This has been resolved with
|
||||
the latest releases.
|
||||
|
||||
On the Intel Galileo boards, the *UART* bus might drop data if several bytes
|
||||
are read at once.
|
||||
|
@ -224,10 +224,6 @@ add_example (groveultrasonic)
|
||||
add_example (sx1276-lora)
|
||||
add_example (sx1276-fsk)
|
||||
add_example (ili9341)
|
||||
if (OPENZWAVE_FOUND)
|
||||
include_directories(${OPENZWAVE_INCLUDE_DIRS})
|
||||
add_example (ozw)
|
||||
endif()
|
||||
add_example (nlgpio16)
|
||||
add_example (ads1x15)
|
||||
if (MODBUS_FOUND)
|
||||
@ -271,7 +267,9 @@ add_example (ds18b20)
|
||||
add_example (bmp280)
|
||||
add_example (bno055)
|
||||
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)
|
||||
include_directories (${PROJECT_SOURCE_DIR}/src)
|
||||
@ -290,9 +288,9 @@ add_custom_example (ak8975-example ak8975.cxx mpu9150)
|
||||
add_custom_example (mpu9250-example mpu9250.cxx mpu9150)
|
||||
add_custom_example (groveledbar-example groveledbar.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 (humidity-sensor-example humidity-sensor.cxx "si7005;bme280")
|
||||
add_custom_example (pressure-sensor-example pressure-sensor.cxx "bmpx8x;bme280")
|
||||
add_custom_example (temperature-sensor-example temperature-sensor.cxx "si7005;bmpx8x;bmp280")
|
||||
add_custom_example (humidity-sensor-example humidity-sensor.cxx "si7005;bmp280")
|
||||
add_custom_example (pressure-sensor-example pressure-sensor.cxx "bmpx8x;bmp280")
|
||||
add_custom_example (co2-sensor-example co2-sensor.cxx "t6713")
|
||||
add_custom_example (adc-example adc-sensor.cxx "ads1x15")
|
||||
add_custom_example (light-sensor-example light-sensor.cxx "si1132;max44009")
|
||||
@ -303,3 +301,13 @@ 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>
|
||||
* Copyright (c) 2015 Intel Corporation.
|
||||
* 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
|
||||
@ -46,6 +46,15 @@ main()
|
||||
// Instantiate a Digital Proximity and Ambient Light sensor on iio device 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) {
|
||||
float lux = light_proximity->getAmbient();
|
||||
cout << "Luminance value is " << lux << endl;
|
||||
@ -53,6 +62,8 @@ main()
|
||||
cout << "Proximity value is " << proximity << endl;
|
||||
sleep(1);
|
||||
}
|
||||
light_proximity->enableProximity(false);
|
||||
light_proximity->enableIlluminance(false);
|
||||
//! [Interesting]
|
||||
|
||||
cout << "Exiting" << endl;
|
||||
|
@ -53,7 +53,7 @@ int main(int argc, char **argv)
|
||||
// Output data every second until interrupted
|
||||
while (shouldRun)
|
||||
{
|
||||
printf("Temperature: %f Celcius\n", bar->getTemperature());
|
||||
printf("Temperature: %f Celsius\n", bar->getTemperature());
|
||||
printf("Pressure: %f Millibars\n", bar->getPressure());
|
||||
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>
|
||||
* Copyright (c) 2015 Intel Corporation.
|
||||
* 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
|
||||
@ -22,8 +22,9 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include "kxcjk1013.hpp"
|
||||
|
||||
@ -44,7 +45,8 @@ data_callback(char* data)
|
||||
{
|
||||
float 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
|
||||
@ -54,7 +56,10 @@ main()
|
||||
//! [Interesting]
|
||||
// Instantiate a KXCJK1013 Accelerometer Sensor on iio device 0
|
||||
accelerometer = new upm::KXCJK1013(0);
|
||||
// Available scales are 0.009582(2g), 0.019163(4g), and 0.038326(8g)
|
||||
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->enable3AxisChannel();
|
||||
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>
|
||||
* Copyright (c) 2015 Intel Corporation.
|
||||
* 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
|
||||
@ -22,8 +22,9 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include "l3gd20.hpp"
|
||||
|
||||
@ -43,8 +44,10 @@ void
|
||||
data_callback(char* data)
|
||||
{
|
||||
float x, y, z;
|
||||
if (gyroscope->extract3Axis(data, &x, &y, &z))
|
||||
printf("% .2f % .2f % .2f\n", x, y, z);
|
||||
if (gyroscope->extract3Axis(data, &x, &y, &z)) {
|
||||
cout << fixed << setprecision(1);
|
||||
cout << x << '\t' << y << '\t' << z << "[rad/sec]" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
@ -54,7 +57,9 @@ main()
|
||||
//! [Interesting]
|
||||
// Instantiate a L3GD20 Gyroscope Sensor on iio device 3
|
||||
gyroscope = new upm::L3GD20(3);
|
||||
// Available scales are 0.000153(250dps), 0.000305(500dps), and 0.001222(2000dps)
|
||||
gyroscope->setScale(0.001222);
|
||||
// Available sampling frequency are 95, 190, 380, and 760
|
||||
gyroscope->setSamplingFrequency(95.0);
|
||||
gyroscope->enable3AxisChannel();
|
||||
gyroscope->installISR(data_callback, NULL);
|
||||
|
@ -18,7 +18,7 @@ int main()
|
||||
cout << "1 - read temp \t" ;
|
||||
cout << "2 - sleep mode \t";
|
||||
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 << "6 - Set Tcrit \t" ;
|
||||
cout << "7 - Set Tupper \t" ;
|
||||
@ -53,7 +53,7 @@ int main()
|
||||
temp->shutDown(false);
|
||||
break;
|
||||
case 4:
|
||||
cout << "set mode to " << (temp->isCelsius() ? "Fahrenheit" : "Celcius") << endl;
|
||||
cout << "set mode to " << (temp->isCelsius() ? "Fahrenheit" : "Celsius") << endl;
|
||||
temp->setMode(!temp->isCelsius());
|
||||
break;
|
||||
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 <iostream>
|
||||
#include <iomanip>
|
||||
#include <stdexcept>
|
||||
#include <signal.h>
|
||||
#include "otp538u.hpp"
|
||||
|
||||
@ -52,14 +53,24 @@ int main()
|
||||
// Object temperature.
|
||||
upm::OTP538U *temps = new upm::OTP538U(0, 1, OTP538U_AREF);
|
||||
|
||||
// enable debugging if you would like
|
||||
// temps->setDebug(true);
|
||||
|
||||
// Output ambient and object temperatures
|
||||
while (shouldRun)
|
||||
{
|
||||
try {
|
||||
cout << "Ambient temp: " << std::fixed << setprecision(2)
|
||||
<< temps->ambientTemperature()
|
||||
<< " C, Object temp: " << temps->objectTemperature()
|
||||
<< " C" << endl;
|
||||
}
|
||||
catch (std::out_of_range& e) {
|
||||
cerr << "Temperature(s) are out of range: " << e.what()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
cout << endl;
|
||||
sleep(1);
|
||||
}
|
||||
//! [Interesting]
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* a copy of this software and associated documentation files (the
|
||||
@ -25,7 +25,7 @@
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
|
||||
#include "ozw.hpp"
|
||||
#include "ozwdump.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -39,8 +39,8 @@ int main(int argc, char **argv)
|
||||
if (argc > 1)
|
||||
defaultDev = string(argv[1]);
|
||||
|
||||
// Instantiate an OZW instance
|
||||
upm::OZW *sensor = new upm::OZW();
|
||||
// Instantiate an OZWDUMP instance
|
||||
upm::OZWDUMP *sensor = new upm::OZWDUMP();
|
||||
|
||||
// The first thing to do is create options, then lock them when done.
|
||||
sensor->optionsCreate();
|
||||
@ -50,16 +50,12 @@ int main(int argc, char **argv)
|
||||
cout << "Initializing, this may take awhile depending on your ZWave network"
|
||||
<< endl;
|
||||
|
||||
if (!sensor->init(defaultDev))
|
||||
{
|
||||
cerr << "Init failed." << endl;
|
||||
return 0;
|
||||
}
|
||||
sensor->init(defaultDev);
|
||||
cout << "Initialization complete" << endl;
|
||||
|
||||
cout << "Dumping nodes..." << endl;
|
||||
|
||||
sensor->dumpNodes();
|
||||
sensor->dumpNodes(true);
|
||||
|
||||
// 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: 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]
|
||||
|
||||
|
||||
cout << "Exiting..." << endl;
|
||||
|
||||
delete sensor;
|
@ -35,7 +35,7 @@ int main ()
|
||||
try {
|
||||
upm::SI7005* sensor = new upm::SI7005(EDISON_I2C_BUS, EDISON_GPIO_SI7005_CS);
|
||||
while (true) {
|
||||
int temperature = sensor->getTemperatureCelcius();
|
||||
int temperature = sensor->getTemperatureCelsius();
|
||||
int humidity = sensor->getHumidityRelative();
|
||||
std::cout << "Temperature = " << temperature << "C" << std::endl;
|
||||
std::cout << "Humidity = " << humidity << "%" << std::endl;
|
||||
|
@ -76,7 +76,7 @@ int main ()
|
||||
std::cout << "Temperature sensor " << temperatureSensor->getModuleName() << " detected" << std::endl;
|
||||
while (true) {
|
||||
try {
|
||||
int value = temperatureSensor->getTemperatureCelcius();
|
||||
int value = temperatureSensor->getTemperatureCelsius();
|
||||
std::cout << "Temperature = " << value << "C" << std::endl;
|
||||
} catch (std::exception& e) {
|
||||
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]
|
||||
}
|
||||
}
|
@ -144,4 +144,11 @@ 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()
|
||||
|
||||
|
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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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)
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* Copyright (c) 2015 Intel Corporation.
|
||||
|
@ -1,5 +1,3 @@
|
||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
||||
/*jshint unused:true */
|
||||
/*
|
||||
* Author: Jun Kato
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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>
|
||||
* Copyright (c) 2016 Intel Corporation.
|
||||
|
@ -1,6 +1,3 @@
|
||||
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
||||
/*jshint unused:true */
|
||||
|
||||
/*
|
||||
* Author: Zion Orent <zorent@ics.com>
|
||||
* 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>
|
||||
* 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>
|
||||
* 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