mirror of
https://github.com/Fishwaldo/open-zwave.git
synced 2025-03-15 19:41:36 +00:00
merge 2013-11-13 branch into trunk
This commit is contained in:
parent
b38e81fcc8
commit
4e0a719d10
148 changed files with 9046 additions and 4471 deletions
82
INSTALL
Normal file
82
INSTALL
Normal file
|
@ -0,0 +1,82 @@
|
|||
Minimal Install Guide for OpenZWave!
|
||||
|
||||
For Unix's (including Mac, bsd's etc)
|
||||
=================
|
||||
execute Make in the Top Level Directory
|
||||
make
|
||||
|
||||
Libraries to link to (Static and Dynamic) will be in top level directory as
|
||||
well (but you can change that as detailed below with LIBDIR)
|
||||
|
||||
To Install:
|
||||
make install
|
||||
|
||||
Some Options you can set:
|
||||
"BUILD=(release|debug)" - Build a Release or Debug Version of the Library
|
||||
(Release is default)
|
||||
|
||||
"PREFIX=(path)" - Prefix to install the shared library into - Defaults to
|
||||
/usr/local
|
||||
|
||||
"LIBDIR=/tmp" - Path to place the libraries into after complication. A poor
|
||||
mans "make install" for simple Applications.
|
||||
|
||||
To use the options, specify them on the commandline when executing make eg:
|
||||
"BUILD=debug PREFIX=/opt/local make"
|
||||
|
||||
What Gets installed:
|
||||
When make install is called the following happens:
|
||||
|
||||
* Documentation:
|
||||
if you have DoxyGen, API documentation is installed into
|
||||
(PREFIX)/share/doc/openzwave-(version)/
|
||||
|
||||
* Shared Libary (libopenzwave.so.*):
|
||||
The Shared Library is installed into either (prefix)/lib64 (on 64
|
||||
bit platforms) or (prefix)/lib/ on 32 bit platforms)
|
||||
|
||||
* Header Files:
|
||||
Installed into (prefix)/include/openzwave/
|
||||
|
||||
* pkg-config file:
|
||||
Installed into (prefix)/lib(64)/pkgconfig/libopenzwave.pc
|
||||
|
||||
* Config files and Device Databases (manufacturer_specific.xml et al)
|
||||
Installed into (prefix)/etc/openzwave/
|
||||
|
||||
* MinOZW example program:
|
||||
Installed into (prefix)/bin/ directory
|
||||
|
||||
The Static Version of the library is never installed, but will be created in
|
||||
cpp/lib directory after a successfull make.
|
||||
|
||||
Windows Versions
|
||||
================
|
||||
|
||||
Visual Studio Solution Files and Mingw32 Makefiles are present in
|
||||
cpp/build/windows/. Select the correct Visual Studio or Mingw32 directory
|
||||
depending on the versions you have.
|
||||
|
||||
(Note, if building DLL's on Windows (currently a option in the vs2010
|
||||
solution) - You have to ensure you application is compiled with exactly the
|
||||
same compiler options and versions as OpenZWave - Otherwise strange things
|
||||
might happen)
|
||||
|
||||
For the .NET dll, the solution files exist in the dotnet/build/ directory
|
||||
|
||||
Sample Programs
|
||||
===============
|
||||
|
||||
For all platforms, there is a simple example program that will print out
|
||||
events as they happen on your ZWave network. This sample is called MinOZW
|
||||
and you can find the source in the cpp/examples directory. By default, these
|
||||
examples are built during the Make Install Stage. If you want compile them
|
||||
separately, you can use the "make examples" target.
|
||||
|
||||
For the .NET wrapper, there is a OZWForm application in
|
||||
dotnet/examples/OZWForm/. Please read the README file in that directory for
|
||||
further instructions
|
||||
|
||||
|
||||
|
||||
|
46
Makefile
Normal file
46
Makefile
Normal file
|
@ -0,0 +1,46 @@
|
|||
#
|
||||
# Makefile for OpenzWave Mac OS X applications
|
||||
# Greg Satz
|
||||
|
||||
# GNU make only
|
||||
|
||||
# requires libudev-dev
|
||||
|
||||
.SUFFIXES: .d .cpp .o .a
|
||||
.PHONY: default clean install
|
||||
|
||||
|
||||
top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
|
||||
top_builddir ?= $(CURDIR)
|
||||
export top_builddir
|
||||
PREFIX ?= /usr/local
|
||||
export PREFIX
|
||||
|
||||
all:
|
||||
$(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS)
|
||||
$(MAKE) -C $(top_srcdir)/cpp/examples/MinOZW/ -$(MAKEFLAGS)
|
||||
|
||||
install:
|
||||
$(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) $(MAKECMDGOALS)
|
||||
$(MAKE) -C $(top_srcdir)/cpp/examples/MinOZW/ -$(MAKEFLAGS) $(MAKECMDGOALS)
|
||||
|
||||
clean:
|
||||
$(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) $(MAKECMDGOALS)
|
||||
$(MAKE) -C $(top_srcdir)/cpp/examples/MinOZW/ -$(MAKEFLAGS) $(MAKECMDGOALS)
|
||||
|
||||
cpp/src/vers.cpp:
|
||||
$(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) cpp/src/vers.cpp
|
||||
|
||||
check:
|
||||
|
||||
include $(top_srcdir)/cpp/build/support.mk
|
||||
|
||||
dist-update:
|
||||
@echo "Updating List of Distribition Files"
|
||||
@$(SVN) --xml -v st > .distfiles
|
||||
@$(top_srcdir)/makedist
|
||||
|
||||
DIST_FORMATS ?= gzip
|
||||
|
||||
include $(top_srcdir)/distfiles.mk
|
||||
include $(top_srcdir)/dist.mk
|
62
config/BeNext/AlarmSound.xml
Normal file
62
config/BeNext/AlarmSound.xml
Normal file
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
<!-- COMMAND_CLASS_ALARM AlarmCmd_Get not supported -->
|
||||
<CommandClass id="113" getsupported="false" />
|
||||
|
||||
<!-- Configuration -->
|
||||
<CommandClass id="112">
|
||||
<Value type="byte" genre="config" instance="1" index="1" label="Set to Default" value="-1">
|
||||
<Help>Set all configuration values to default values (factory settings)</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="2" label="Destination routine enabled" value="255">
|
||||
<Help>Enables an internal routine that periodically checks the Z-Wave device in assocication group 2</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="3" label="Destination routine success time" value="60">
|
||||
<Help>Configure the time that the AlarmSound sends a new frame when previous frame was send successful</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="4" label="Destination routine failed time" value="240">
|
||||
<Help>Configure the time that the AlarmSound sends a few frame when previous frame was send not successful</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="5" label="Temperature calibration offset (byte 1)" value="0">
|
||||
<Help>A (signed) offset to calibrate the onboard temperature sensor</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="6" label="Temperature calibration offset (byte 2)" value="0">
|
||||
<Help>A (signed) offset to calibrate the onboard temperature sensor</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="7" label="Select index sound/light mode" value="1">
|
||||
<Help>The index of the sound mode when a switch binary/basic set frame is received</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="8" label="Power offline sound/light mode" value="6">
|
||||
<Help>The index of the sound mode when the AlarmSound will start when it is unplugged</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="9" label="Error sound/light mode" value="5">
|
||||
<Help>The index of the sound mode when the AlarmSound will play when it is unable to reach the device in association group 2</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="10" label="Sound/Light index 1" value="-1">
|
||||
<Help>Params 10 until 27 are the values to configure the sound and light thtat are played when index 1 is selected</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="28" label="Sound/Light index 2" value="-1">
|
||||
<Help>Params 28 until 45 are the values to configure the sound and light thtat are played when index 2 is selected</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="46" label="Sound/Light index 3" value="-1">
|
||||
<Help>Params 46 until 63 are the values to configure the sound and light thtat are played when index 3 is selected</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="64" label="Sound/Light index 4" value="-1">
|
||||
<Help>Params 64 until 81 are the values to configure the sound and light thtat are played when index 4 is selected</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="82" label="Sound/Light index 5" value="-1">
|
||||
<Help>Params 82 until 99 are the values to configure the sound and light thtat are played when index 5 is selected</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="100" label="Sound/Light index 6" value="-1">
|
||||
<Help>Params 100 until 117 are the values to configure the sound and light thtat are played when index 6 is selected</Help>
|
||||
</Value>
|
||||
</CommandClass>
|
||||
|
||||
<!-- Association Groups -->
|
||||
<CommandClass id="133">
|
||||
<Associations num_groups="2">
|
||||
<Group index="1" max_associations="1" label="Group 1" auto="false"/>
|
||||
<Group index="2" max_associations="1" label="Group 2" auto="false"/>
|
||||
</Associations>
|
||||
</CommandClass>
|
||||
</Product>
|
|
@ -1,7 +1,41 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Aeon Labs Door/Window Sensor -->
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
<!-- Configuration Parameters not supported -->
|
||||
<!-- Configuration -->
|
||||
<CommandClass id="112">
|
||||
<Value type="byte" genre="config" instance="1" index="1" label="Toggle the sensor binary report value when the Magnet switch is opened/closed." min="0" max="1" value="0">
|
||||
<Help>0, Open: FF, Close: 00; 1, Open: 00, Close: FF
|
||||
Default setting: 0
|
||||
</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="2" label="Enable wake up 10 minutes when the power is switched on." min="0" max="1" value="0">
|
||||
<Help>0: Disable; 1: Enable
|
||||
Default setting: 0
|
||||
</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="3" label="Toggle the basic set value when Magnet switch is opened/closed." min="0" max="1" value="0">
|
||||
<Help>0, Open: FF, Close: 00; 1, Open: 00, Close: FF;
|
||||
Default setting: 0
|
||||
</Help>
|
||||
</Value>
|
||||
<Value type="int" genre="config" instance="1" index="121" label="Determines which report will be sent when Magnet switch is opened/ closed." min="0" max="1" value="256">
|
||||
<Help>Which reports need to send automatically in timing intervals for group 1
|
||||
Bitsets:
|
||||
0 -> Battery report
|
||||
4 -> Sensor Binary
|
||||
8 -> Basic Set
|
||||
Default setting: 0x00000100 (Basic Set)
|
||||
</Help>
|
||||
</Value>
|
||||
<Value type="short" index="254" genre="config" label="Device Tag" units="" min="0" max="255" value="0">
|
||||
<Help>Device Tag</Help>
|
||||
</Value>
|
||||
<Value type="button" index="255" genre="config" label="Reset configuration settings to factory defaults" write_only="true" value="0" >
|
||||
<Help>Reset to factory defaults.</Help>
|
||||
</Value>
|
||||
</CommandClass>
|
||||
<!-- Basic set as report -->
|
||||
<CommandClass id="32" setasreport="true"/>
|
||||
<!-- Association Groups -->
|
||||
<CommandClass id="133">
|
||||
<!-- Information from http://www.pepper1.net/zwavedb/uploads/resources/1804efacf71a36402c53209c0991c04f20b31588.pdf -->
|
||||
|
|
26
config/eurotronic/eur_stellaz.xml
Normal file
26
config/eurotronic/eur_stellaz.xml
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
|
||||
<CommandClass id="64" >
|
||||
<Instance index="1" />
|
||||
<Value type="list" genre="user" instance="1" index="0" label="Mode">
|
||||
<Item label="Frost Protection" value="0" />
|
||||
<Item label="Comfort" value="1" />
|
||||
<Item label="Energy Saving" value="11" />
|
||||
<Item label="Direct Valve Control" value="31" />
|
||||
</Value>
|
||||
<SupportedModes>
|
||||
<Mode index="0" label="Frost Protection" />
|
||||
<Mode index="1" label="Comfort" />
|
||||
<Mode index="11" label="Energy Saving" />
|
||||
<Mode index="31" label="Direct Valve Control" />
|
||||
</SupportedModes>
|
||||
</CommandClass>
|
||||
<CommandClass id="67" base="0">
|
||||
<Instance index="1" />
|
||||
<Value type="int" genre="user" instance="1" index="1" label="Comfort setpoint" units="C" />
|
||||
<Value type="int" genre="user" instance="1" index="11" label="Energy saving setpoint" units="C" />
|
||||
<!-- <Value instance="1" index="7" action="remove" /> -->
|
||||
</CommandClass>
|
||||
|
||||
</Product>
|
120
config/fibaro/fgfs101.xml
Normal file
120
config/fibaro/fgfs101.xml
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
|
||||
<!-- Configuration -->
|
||||
<CommandClass id="112">
|
||||
<Value type="short" genre="config" instance="1" index="1" label="IN1 Alarm Cancellation Delay" min="0" max="3600" value="0">
|
||||
<Help>Flood alarm cancellation delay. Additional delay after a flood alarm has ceased. The parameter allows you to specify additional time, after which the flood alarm is cancelled once its violation has ceased.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="2" label="Acoustic and visual signals" value="3" size="1">
|
||||
<Help>Acoustic and visual signals in case of flooding.</Help>
|
||||
<Item label="Signals INACTIVE" value="0" />
|
||||
<Item label="Acoustic INACTIVE, visual ACTIVE" value="1" />
|
||||
<Item label="Acoustic ACTIVE, visual INACTIVE" value="2" />
|
||||
<Item label="Acoustic ACTIVE, visual ACTIVE" value="3" />
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="5" label="Type of alarm frame for association group 1" value="255" size="1">
|
||||
<Help>Type of alarm frame for association group 1, activated by flood sensor. The parameter allows to specify the type of alarm frame or to force transmission of control commands (BASIC_SET)</Help>
|
||||
<Item label="ALARM WATER" value="0" />
|
||||
<Item label="BASIC_SET" value="255" />
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="7" label="Forced Level of Dimming group 1" min="1" max="255" value="255">
|
||||
<Help>Value of the parameter specifying the forced level of dimming / opening sun blinds when comes "switch on" / "open" command to devices from association group no. 1.
|
||||
In the case of alarm frames the alarm priority is specified. Possible parameter settings: (1 – 99) and 255. Value of 255 makes it possible to activate the device when using the Dimmer module it means activating the device and setting it to the previous stored condition, e.g. when Dimmer is set to 30%, then deactivated, and then reactivated using command 255, it will automatically be set to the previous condition, i.e. 30%.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="9" label="Deactivate transmission of frame cancelling alarm" value="1" size="1">
|
||||
<Help>Deactivating transmission of the frame cancelling the alarm or the control frame deactivating the device (Basic). It allows for disabling the deactivation function or the alarm cancellation function for devices associated with the appropriate input of the Fibaro Sensor. NOTE: Information concerning alarm violation or activation commands for devices from association groups are always sent.</Help>
|
||||
<Item label="Alarm (flooding) cancellation INACTIVE" value="0" />
|
||||
<Item label="Alarm (flooding) cancellation ACTIVE" value="1" />
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="10" label="Interval between successive readings of temperature sensors" min="1" max="65535" value="300">
|
||||
<Help>Interval between successive readings of temperature from all sensors connected to the device in seconds. Note: taking temperature readings from the sensor does not result in sending a temperature condition report to the central hub.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="12" label="Insensitiveness to temperature changes." min="1" max="1000" value="50">
|
||||
<Help>Insensitiveness to temperature changes. This is the maximum acceptable difference between the last reported temperature and the current temperature taken from the sensor. If the temperatures differ by the set value or more, then a report with the current temperature value is sent to the device assigned to association group no. 3. Intervals between taking readings from sensors are specified by parameter no. 10.
|
||||
Possible parameter settings:1 – 1000 [each 0.01oC] [0.01oC – 10.00oC].</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="13" label="Transmitting the alarm or control frame broadcast mode" value="0" size="1">
|
||||
<Help>Transmitting the alarm or control frame in "broadcast" mode (i.e. to all devices within range), information sent in this mode is not repeated by the mesh network. NOTE: If the broadcast mode of information transmission is activated for a given channel, then transmission of information in singlecast mode to devices assigned to the association group of this channel is deactivated.</Help>
|
||||
<Item label="Broadcasts INACTIVE" value="0" />
|
||||
<Item label="Flood ACTIVE, tamper INACTIVE" value="1" />
|
||||
<Item label="Flood INACTIVE, tamper ACTIVE" value="2" />
|
||||
<Item label="Flood ACTIVE, tamper ACTIVE" value="3" />
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="50" label="Low temperature alarm threshold." min="-10000" max="10000" value="1500">
|
||||
<Help>The parameter stores a temperature value, below which LED indicator blinks with a colour determined by Parameter 61 settings. By default the LED indicator blinks blue.
|
||||
Possible parameter settings:-10000 – 10000 [each 0.01oC] [-100oC – 100oC].</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="51" label="High temperature alarm threshold." min="-10000" max="10000" value="3500">
|
||||
<Help>The parameter stores a temperature value, above which LED indicator blinks with a colour determined by Parameter 62 settings. By default the LED indicator blinks red.
|
||||
Possible parameter settings:-10000 – 10000 [each 0.01oC] [-100oC – 100oC].</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="int" genre="config" instance="1" index="61" label="Low temperature alarm indicator colour." min="0" max="16777215" value="255">
|
||||
<Help>The parameter stores RGB colour value.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="int" genre="config" instance="1" index="62" label="High temperature alarm indicator colour." min="0" max="16777215" value="16711680">
|
||||
<Help>The parameter stores RGB colour value.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="63" label="Managing a LED indicator under standard operation." value="2" size="1">
|
||||
<Help>Parameter determines LED indicator's operation. Set to 0 turns the indicator off, saving battery life.</Help>
|
||||
<Item label="LED doesn't indicate temperature" value="0" />
|
||||
<Item label="LED indicates temperature (blink) every Temperature Measurement Interval (Parameter 10, constant power + battery) or Wake Up Interval (battery)" value="1" />
|
||||
<Item label="LED indicates temperature constantly, only in constant power mode." value="2" />
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="73" label="Temperature measurement compensation." min="-10000" max="10000" value="0">
|
||||
<Help>Parameter stores a temperature value to be added to or deducted from the current temperature measured by the internal temperature sensor in order to compensate the difference between air temperature and the temperature at floor level.
|
||||
Possible parameter settings:-10000 – 10000 [each 0.01oC] [-100oC – 100oC].</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="74" label="Alarm frame sent to group 2 (tamper/tilt)." value="2" size="1">
|
||||
<Help>The device is able to turn on alarms resulting from sensors vibrations, e.g. when the sensor is moved, or the TMP button is released. Group 2 association alarms are not cancelled.</Help>
|
||||
<Item label="Tamper alarms INACTIVE" value="0" />
|
||||
<Item label="Button tamper alarm ACTIVE" value="1" />
|
||||
<Item label="Movement tamper alarm ACTIVE" value="2" />
|
||||
<Item label="Button and movement tamper alarms ACTIVE" value="3" />
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="75" label="Visual and audible alarm duration" min="0" max="65535" value="0">
|
||||
<Help>Parameter determines a time period after which alarm will become 'quiet' - still active but the device will go into battery saving mode. Visual or acoustic alarm will be reactivated after time period specified in Parameter 76. When alarm status ceases, alarm will be turned off immediately.
|
||||
Value of 0 means visual and acoustic alarms are active indefinitely. In battery power mode the device will never go to sleep which may shorten battery life significantly.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="76" label="Alarm frame/basic set frame retransmission time" min="0" max="65535" value="0">
|
||||
<Help>Parameter determines a time period after which an alarm frame will be retransmitted.
|
||||
Value of 0 cancels an alarm frame retransmission.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="77" label="Flood sensor functionality turned off." value="0" size="1">
|
||||
<Help>Allows for turning off the internal flood sensor. Tamper and internal temperature sensors will remain active.</Help>
|
||||
<Item label="Default flood sensor operation (ACTIVE)" value="0" />
|
||||
<Item label="Flood sensor INACTIVE" value="1" />
|
||||
</Value>
|
||||
|
||||
</CommandClass>
|
||||
|
||||
<CommandClass id="96" mapping="endpoints" />
|
||||
|
||||
<!-- Association Groups -->
|
||||
<CommandClass id="133">
|
||||
<Associations num_groups="3">
|
||||
<Group index="1" max_associations="5" label="Flood Alarm" auto="true"/>
|
||||
<Group index="2" max_associations="5" label="Tamper Alarm" auto="true" />
|
||||
<Group index="3" max_associations="5" label="Device Status" auto="true"/>
|
||||
</Associations>
|
||||
</CommandClass>
|
||||
|
||||
</Product>
|
82
config/fibaro/fgrm222.xml
Normal file
82
config/fibaro/fgrm222.xml
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
<!-- Configuration -->
|
||||
<CommandClass id="112">
|
||||
<Value type="list" genre="config" instance="1" index="1" label="Activate / deactivate functions ALL ON / ALL OFF" value="0" size="1">
|
||||
<Help> </Help>
|
||||
<Item label="ALL ON disabled/ ALL OFF disable - Default" value="0" />
|
||||
<Item label="ALL ON disabled/ ALL OFF active" value="1" />
|
||||
<Item label="ALL ON active / ALL OFF disabled" value="2" />
|
||||
<Item label="ALL ON active / ALL OFF active" value="255" />
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="10" label="Turning off the shutter positioning function" value="0" size="1">
|
||||
<Help> </Help>
|
||||
<Item label="Turning on the shutter positioning function - Default" value="0"/>
|
||||
<Item label="Turning off the shutter positioning function" value="1"/>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="14" label="14. Inputs Button/Switch configuration" value="0" size="1">
|
||||
<Help>Binary inputs type configuration</Help>
|
||||
<Item label="Mono-stable switch (button) - Default" value="0"/>
|
||||
<Item label="Bi-stable switch (switch)" value="1"/>
|
||||
<Item label="Single Mono-stable switch" value="2"/>
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="20" label="Saving the position Favourites" value="16" size="1">
|
||||
<Help>Options for changing parameter 1-99, default 16</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="30" label="General Alarm, set for shutter no. 1" value="2" size="1">
|
||||
<Help> </Help>
|
||||
<Item label="DEACTIVATION - the device does not respond to alarm data frames" value="0"/>
|
||||
<Item label="OPEN SHUTTER ALARM - the device closes the roller shutter after detecting an alarm" value="1"/>
|
||||
<Item label="CLOSED SHUTTER ALARM - the device opens the roller shutter after detecting an alarm - Default" value="2"/>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="31" label="Alarm of flooding with water, set for relay the shutter." value="0" size="1">
|
||||
<Help> </Help>
|
||||
<Item label="DEACTIVATION - the device does not respond to alarm data frames - Default" value="0"/>
|
||||
<Item label="OPEN SHUTTER ALARM - the device closes the roller shutter after detecting an alarm" value="1"/>
|
||||
<Item label="CLOSED SHUTTER ALARM - the device opens the roller shutter after detecting an alarm" value="2"/>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="32" label="Smoke, CO, CO2 Alarm. Set for the roller shutter." value="1" size="1">
|
||||
<Help> </Help>
|
||||
<Item label="DEACTIVATION - the device does not respond to alarm data frames" value="0"/>
|
||||
<Item label="OPEN SHUTTER ALARM - the device closes the roller shutter after detecting an alarm - Default" value="1"/>
|
||||
<Item label="CLOSED SHUTTER ALARM - the device opens the roller shutter after detecting an alarm" value="2"/>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="33" label="Temperature Alarm, set for roller shutter" value="1" size="1">
|
||||
<Help> </Help>
|
||||
<Item label="DEACTIVATION - the device does not respond to alarm data frames" value="0"/>
|
||||
<Item label="OPEN SHUTTER ALARM - the device closes the roller shutter after detecting an alarm - Default" value="1"/>
|
||||
<Item label="CLOSED SHUTTER ALARM - the device opens the roller shutter after detecting an alarm" value="2"/>
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="41" label="Scene activation functionality" value="0" size="1">
|
||||
<Help> Only valid for the 1.9 version of FGR221. The device offers the possibility of sending commands compatible with Command class scene activation. Information is sent to devices assigned to association group no. 3. Controllers such as Home Center 2 are able to interpret such commands and based on these commands they activate scenes, to which specific scene IDs have been assigned. The user may expand the functionality of the button connected to inputs S1 and S2 by distinguishing the actions of keys connected to those inputs. For example: double click would activate the scene goodnight and triple click would activate the scene morning.
|
||||
</Help>
|
||||
<Item label="Deactivation of functionality - Default" value="0"/>
|
||||
<Item label="Activation of functionality" value="1"/>
|
||||
</Value>
|
||||
<Value type="list" genre="config" instance="1" index="29" label="Start Calibration" value="0" size="1">
|
||||
<Help> Start a Calibration Cycle on the device</Help>
|
||||
<Item label="No" value="0"/>
|
||||
<Item label="Yes" value="1"/>
|
||||
</Value>
|
||||
</CommandClass>
|
||||
<!--
|
||||
<CommandClass id="96" mapping="endpoints" />
|
||||
-->
|
||||
<!-- Association Groups -->
|
||||
<CommandClass id="133">
|
||||
<Associations num_groups="3">
|
||||
<Group index="1" max_associations="16" label="Group 1" auto="false"/>
|
||||
<Group index="2" max_associations="16" label="Group 2" auto="false" />
|
||||
<Group index="3" max_associations="1" label="Send updates" auto="true"/>
|
||||
</Associations>
|
||||
</CommandClass>
|
||||
|
||||
</Product>
|
144
config/fibaro/fgss101.xml
Normal file
144
config/fibaro/fgss101.xml
Normal file
|
@ -0,0 +1,144 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
|
||||
<!-- Configuration -->
|
||||
<CommandClass id="112">
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="1" label="Smoke alarm cancellation delay" min="0" max="65535" value="0">
|
||||
<Help>The time between when the smoke disappears and the Fibaro Smoke Sensor stops sending the alarm signal.
|
||||
0: no delay, immediate cancellation,
|
||||
65535: alarm cancellation inactive - Smoke Sensor will keep indicating smoke alarm after the smoke will have disappeared. The smoke alarm can be only ceased manually, by entering 2nd menu level (see section XIII).
|
||||
Default setting: 0
|
||||
</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="2" label="LED indicator and acoustic alarm turned ON / OFF at any alarm type" min="0" max="3" value="3" size="1">
|
||||
<Help>Allows for deactivating the LED indicator and the acoustic alarm, in case of detecting an alarm of any type. This doesn’t affect the communication with the Z-Wave network controller, i.e. the sensor will keep sending alarms, reports and all information to the associated devices. Modifying this parameter settings helps extending the battery life.</Help>
|
||||
<Item label="Acoustic and visual alarms inactive" value="0" />
|
||||
<Item label="Acoustic alarm inactive, visual alarm active" value="1" />
|
||||
<Item label="Acoustic alarm active, visual alarm inactive" value="2" />
|
||||
<Item label="Acoustic and visual alarms active" value="3" />
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="5" label="Type of alarm frame for association group 1" value="255" size="1">
|
||||
<Help>Type of alarm frame for association group 1, activated by smoke sensor. The parameter allows to specify the type of alarm frame or to force transmission of control commands (BASIC_SET)</Help>
|
||||
<Item label="ALARM SMOKE" value="0" />
|
||||
<Item label="BASIC_SET" value="255" />
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="7" label="Forced Level of Dimming group 1" min="1" max="255" value="255">
|
||||
<Help>Value of the parameter specifying the forced level of dimming / opening sun blinds when comes "switch on" / "open" command to devices from association group no. 1.
|
||||
In the case of alarm frames the alarm priority is specified. Possible parameter settings: (1 – 99) and 255. Value of 255 makes it possible to activate the device when using the Dimmer module it means activating the device and setting it to the previous stored condition, e.g. when Dimmer is set to 30%, then deactivated, and then reactivated using command 255, it will automatically be set to the previous condition, i.e. 30%.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="10" label="Temperature report interval" min="1" max="17280" value="0">
|
||||
<Help>Interval between successive readings of temperature from all sensors connected to the device in seconds. Note: taking temperature readings from the sensor does not result in sending a temperature condition report to the central hub.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="12" label="Temperature report hysteresis" min="1" max="100" value="20">
|
||||
<Help>The temperature report will only be sent if there is a difference in temperature value from the previous value reported, defined in this parameter (hysteresis).
|
||||
Temparature reports can be also sent as a result of polling.
|
||||
Available settings:0 – 100 (in 0,1C steps)
|
||||
0– temperature change reporting inactive
|
||||
Default setting: 20 (2C)
|
||||
Possible parameter settings:1 - 1000 (0.01C - 10.00C)</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="13" label="Alarm broadcast" value="0" size="1">
|
||||
<Help>Transmitting the alarm or control frame in "broadcast" mode (i.e. to all devices within range), information sent in this mode is not repeated by the mesh network. NOTE: If the broadcast mode of information transmission is activated for a given channel, then transmission of information in singlecast mode to devices assigned to the association group of this channel is deactivated.</Help>
|
||||
<Item label="Broadcasts INACTIVE" value="0" />
|
||||
<Item label="Smoke ACTIVE, tamper INACTIVE" value="1" />
|
||||
<Item label="Smoke INACTIVE, tamper ACTIVE" value="2" />
|
||||
<Item label="Smoke ACTIVE, tamper ACTIVE" value="3" />
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="73" label="Temperature measurement compensation" min="-10000" max="10000" value="0" size="2">
|
||||
<Help>Parameter stores a temperature value to be added to or deducted from the current temperature measured by the internal temperature sensor in order to compensate the difference between air temperature and the temperature at floor level.
|
||||
Possible parameter settings:-10000 - 10000 [each 0.01C] (-100C - 100C).</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="80" label="Z-Wave range test interval" value="1" min="0" max="144" size="1">
|
||||
<Help>Time period between the consecutive Z-Wave network range tests.
|
||||
In battery powering mode, Z-Wave network range test is carried out at the wake up
|
||||
interval. The value of 0 turns off the Z-Wave range test, regardless of the powering mode chosen.
|
||||
Available settings: 0 – 144 (10min multiplier) [10min-24h]
|
||||
0 – Z-Wave network range test inactive
|
||||
Default setting: 1 (10min)
|
||||
</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="81" label="Temperature alarm threshold" value="54" min="0" max="100" size="1">
|
||||
<Help>Temperature value, measured by the built-in temperature sensor, above which the temperature alarm is sent.
|
||||
Available settings: 0, 2 - 100
|
||||
0: temperature alarm inactive.
|
||||
2 - 100 – (2 - 100C)
|
||||
Default setting: 54 (54C)
|
||||
</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="82" label="Smoke Sensor sensitivity" value="2" min="1" max="3" size="1">
|
||||
<Help>There are 3 levels of sensitivity to smoke presence. Level 1 means the highest sensitivity.</Help>
|
||||
<Item label="High" value="1" />
|
||||
<Item label="Medium" value="2" />
|
||||
<Item label="Low" value="3" />
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="83" label="Black Box sensitivity level" value="2" min="1" max="3" size="1">
|
||||
<Help>This parameter allows for specifying the moment in which the Black Box starts recording data. After the specified smoke and temperature values will be exceeded, the Fibaro Smoke Sensor’s Black Box will record them.</Help>
|
||||
<Item label="High" value="1" />
|
||||
<Item label="Medium" value="2" />
|
||||
<Item label="Low" value="3" />
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="84" label="Malfunction alarm" value="10" min="0" max="255" size="1">
|
||||
<Help>Time interval in which malfuntion alarm, if detected, is repeated using visual and acoustic alarms.
|
||||
Available settings: 1 - 255 (100 ms multiplier) [100ms-25,5s]
|
||||
Default setting: 10 (1s)</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="85" label="Temperature alarm" value="5" min="0" max="255" size="1">
|
||||
<Help>Time interval in which temperature alarm, if detected, is repeated using visual and acoustic alarms.
|
||||
Available settings: 1 - 255 (100 ms multiplier) [100ms-25,5s]
|
||||
Default setting: 10 (1s)</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="86" label="Lack of the Z-Wave range alarm" value="360" min="0" max="17280" size="2">
|
||||
<Help>Time interval in which lack of the Z-Wave network alarm, if detected, is repeated using visual and acoustic alarms.
|
||||
Available settings: 1 - 17280 (5s multiplier) [5s-24h]
|
||||
Default setting: 360 (30min)</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="short" genre="config" instance="1" index="87" label="Low battery alarm" value="360" min="1" max="17280" size="2">
|
||||
<Help>Time interval in which low battery alarm, if detected, is repeated using visual and acoustic alarms.
|
||||
Available settings: 1 - 17280 (5s multiplier) [5s-24h]
|
||||
Default setting: 360 (30min)</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="88" label="Consider temperature measurement compensation" value="0" size="1">
|
||||
<Help>This parameter allows for specifying the moment in which the Black Box starts recording data. After the specified smoke and temperature values will be exceeded, the Fibaro Smoke Sensor’s Black Box will record them.</Help>
|
||||
<Item label="Ignore temperature compensation" value="0" />
|
||||
<Item label="Include temperature compensation" value="1" />
|
||||
</Value>
|
||||
|
||||
<Value type="list" genre="config" instance="1" index="89" label="Tamper alarm" value="2" min="0" max="2" size="1">
|
||||
<Help>default setting: tamper alarm active, with cancellation option available</Help>
|
||||
<Item label="tamper alarm inactive" value="0" />
|
||||
<Item label="tamper alarm active, with cancellation option available" value="1" />
|
||||
<Item label="tamper alarm active, without cancellation option" value="2" />
|
||||
</Value>
|
||||
</CommandClass>
|
||||
|
||||
<!-- Basic set as report -->
|
||||
<CommandClass id="32" setasreport="true"/>
|
||||
|
||||
<!-- Association Groups -->
|
||||
<CommandClass id="133">
|
||||
<Associations num_groups="3">
|
||||
<Group index="1" max_associations="5" label="Smoke Alarm" auto="true"/>
|
||||
<Group index="2" max_associations="5" label="Tamper Alarm" auto="true" />
|
||||
<Group index="3" max_associations="1" label="Device Status" auto="true"/>
|
||||
</Associations>
|
||||
</CommandClass>
|
||||
|
||||
</Product>
|
|
@ -1,6 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
|
||||
<!-- COMMAND_CLASS_ALARM AlarmCmd_Get not supported -->
|
||||
<CommandClass id="113" getsupported="false" />
|
||||
|
||||
<!-- COMMAND_CLASS_SWITCH_ALL SwitchAllCmd_Get not supported -->
|
||||
<CommandClass id="39" getsupported="false" />
|
||||
<!-- Configuration -->
|
||||
<CommandClass id="112">
|
||||
|
||||
|
@ -63,7 +69,7 @@
|
|||
<Item label="Cyclically change device state, each 1second" value="2" />
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="39" label="39. Alarm duration" value="600" size="2">
|
||||
<Value type="short" genre="config" instance="1" index="39" label="39. Alarm duration" value="600" size="2">
|
||||
<Help>Wall Plug's alarm mode duration. If a device sending an alarm frame through the Z-Wave network sets alarm duration as well, this parameter's settings are ignored.</Help>
|
||||
</Value>
|
||||
|
||||
|
@ -100,7 +106,7 @@
|
|||
</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="47" label="47. Time period between reports on power load and energy consumption." value="3600" size="2">
|
||||
<Value type="short" genre="config" instance="1" index="47" label="47. Time period between reports on power load and energy consumption." value="3600" size="2">
|
||||
<Help>Parameter defines time period between reports sent when changes
|
||||
in power load have not been recorded. By default, if power load
|
||||
changes have not been recorded, reports are sent every hour.
|
||||
|
@ -115,11 +121,11 @@
|
|||
<Item label="function inactive" value="1" />
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="50" label="50. DOWN value" value="300" size="2">
|
||||
<Value type="short" genre="config" instance="1" index="50" label="50. DOWN value" value="300" size="2">
|
||||
<Help>Lower power threshold, used in parameter 52. Default setting: 300 (30 W) Available settings: 0 - 25 000 (0,0W - 2 500W) DOWN value cannot be higher than a value specified in parameter 51.</Help>
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="51" label="51. UP value " value="500" size="2">
|
||||
<Value type="short" genre="config" instance="1" index="51" label="51. UP value " value="500" size="2">
|
||||
<Help>Upper power threshold, used in parameter 52. Default setting: 500 (50 W) Available settings: 1 - 25 000 (0,1W - 2 500W) UP value cannot be lower than a value specified in parameter 50.</Help>
|
||||
</Value>
|
||||
|
||||
|
@ -156,7 +162,7 @@
|
|||
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="60" label="60. Power load, which when exceeded, makes the LED ring flash violet." value="25000" size="2">
|
||||
<Value type="short" genre="config" instance="1" index="60" label="60. Power load, which when exceeded, makes the LED ring flash violet." value="25000" size="2">
|
||||
<Help>Function is active only when parameter 61 is set to 0 or 1.Default setting: 25 000 (2 500W) Available settings: 1 000 - 32 000 (100W - 3200W).</Help>
|
||||
</Value>
|
||||
|
||||
|
@ -215,7 +221,7 @@
|
|||
<Item label="illumination turned off completely" value="9" />
|
||||
</Value>
|
||||
|
||||
<Value type="byte" genre="config" instance="1" index="70" label="70. Oveload safety switch" value="65535" size="2">
|
||||
<Value type="short" genre="config" instance="1" index="70" label="70. Oveload safety switch" value="65535" size="2">
|
||||
<Help>This function allows for turning off the controlled device in case of exceeding the defined power. Controlled device will be turned off even if "always on" function is active (parameter 1).
|
||||
Controlled device can be turned back on via B-button or sending a
|
||||
control frame. By default this function is inactive.
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
</Manufacturer>
|
||||
<Manufacturer id="008a" name="BeNext">
|
||||
<Product type="0004" id="0100" name="Door Sensor" config="BeNext/DoorSensor.xml"/>
|
||||
<Product type="0005" id="0101" name="Alarm Sound" config="BeNext/AlarmSound.xml"/>
|
||||
<Product type="0006" id="0101" name="Energy Switch" config="BeNext/EnergySwitch.xml"/>
|
||||
<Product type="0007" id="0101" name="Tag Reader" config="BeNext/TagReader.xml"/>
|
||||
<Product type="0008" id="0101" name="Power Switch"/>
|
||||
|
@ -118,6 +119,9 @@
|
|||
</Manufacturer>
|
||||
<Manufacturer id="0035" name="Embedit A/S">
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0148" name="EUROtronic">
|
||||
<Product type="0001" id="0001" name="EUR_STELLAZ Wall Radiator Thermostat Valve Control" config="eurotronic/eur_stellaz.xml"/>
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0060" name="Everspring">
|
||||
<Product type="0003" id="0001" name="AD142 Plug-in Dimmer Module"/>
|
||||
<Product type="0104" id="0001" name="AN145 Lamp Screw In Module" config="everspring/an145.xml"/>
|
||||
|
@ -152,10 +156,12 @@
|
|||
<Product type="0100" id="0104" name="FGD211 Universal Dimmer 500W" />
|
||||
<Product type="0100" id="0107" name="FGD211 Universal Dimmer 500W" config="fibaro/fgd211.xml" />
|
||||
<Product type="0100" id="0109" name="FGD211 Universal Dimmer 500W" config="fibaro/fgd211.xml" />
|
||||
<Product type="0100" id="100a" name="FGD211 Universal Dimmer 500W" config="fibaro/fgd211.xml" />
|
||||
<Product type="0700" id="1000" name="FGK101 Door Opening Sensor" config="fibaro/fgk001.xml" />
|
||||
<Product type="0300" id="100a" name="FGR221 Roller Shutter Controller" config="fibaro/fgr221.xml"/>
|
||||
<Product type="0300" id="0106" name="FGR221 Roller Shutter Controller" config="fibaro/fgr221.xml"/>
|
||||
<Product type="0300" id="0107" name="FGR221 Roller Shutter Controller" config="fibaro/fgr221.xml"/>
|
||||
<Product type="0301" id="1001" name="FGRM222 Roller Shutter Controller 2" config="fibaro/fgrm222.xml"/>
|
||||
<Product type="0400" id="0104" name="FGS211 Switch 3kW" config="fibaro/fgs211.xml" />
|
||||
<Product type="0400" id="0105" name="FGS211 Switch 3kW" config="fibaro/fgs211.xml" />
|
||||
<Product type="0400" id="0106" name="FGS211 Switch 3kW" config="fibaro/fgs211.xml" />
|
||||
|
@ -170,7 +176,9 @@
|
|||
<Product type="0200" id="0109" name="FGS221 Double Relay Switch 2x1.5kW" config="fibaro/fgs221.xml" />
|
||||
<Product type="0200" id="100a" name="FGS221 Double Relay Switch 2x1.5kW" config="fibaro/fgs221.xml" />
|
||||
<Product type="0600" id="1000" name="FGWPE Wall Plug" config="fibaro/fgwpe.xml" />
|
||||
<Product type="0b00" id="3001" name="FGFS101 Flood Sensor" config ="fibaro/fgfs101.xml" />
|
||||
<Product type="0900" id="1000" name="FGRGBWM441 RGBW Controller" config="fibaro/fgrgbwm441.xml" />
|
||||
<Product type="0c00" id="1000" name="FGSS101 Smoke Sensor" config="fibaro/fgss101.xml" />
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0037" name="Foard Sys">
|
||||
</Manufacturer>
|
||||
|
@ -205,6 +213,7 @@
|
|||
<Manufacturer id="001e" name="Homeseer">
|
||||
<Product type="0001" id="0002" name="ZTroller" config="homeseer/ztroller.xml"/>
|
||||
<Product type="0002" id="0001" name="HSM100 Wireless Multi-Sensor" config="homeseer/hsm100.xml"/>
|
||||
<Product type="0002" id="0002" name="EZMotion+ 3-in-1 Sensor" config="homeseer/hsm100.xml"/>
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0039" name="Honeywell">
|
||||
<Product type="0011" id="0001" name="TH8320ZW1000 Touchscreen Thermostat" config="honeywell/th8320zw1000.xml"/>
|
||||
|
@ -312,6 +321,9 @@
|
|||
</Manufacturer>
|
||||
<Manufacturer id="0041" name="OpenPeak Inc.">
|
||||
</Manufacturer>
|
||||
<Manufacturer id="013c" name="Philio Technology Corporation">
|
||||
<Product type="0001" id="0004" name="In Wall Dual Relay (1 Way) Switch Module (PAN06-1)" />
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0064" name="Popp / Duwi">
|
||||
<Product type="0001" id="0000" name="ZW EDAN 300 Flush Mounted Dimmer" />
|
||||
<Product type="1001" id="0000" name="Plugin Dimmer" />
|
||||
|
@ -319,6 +331,7 @@
|
|||
<Product type="3001" id="0000" name="ZW ZS 3500 Plugin Switch" />
|
||||
<Product type="3002" id="0000" name="ZW ZSA 3500 Plugin Switch" />
|
||||
<Product type="4001" id="0000" name="ZW ESJ Blind Control" />
|
||||
<Product type="5002" id="0000" name="Wireless Flush Mounted Switch" />
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0016" name="PowerLynx">
|
||||
</Manufacturer>
|
||||
|
@ -332,6 +345,7 @@
|
|||
</Manufacturer>
|
||||
<Manufacturer id="5254" name="Remotec">
|
||||
<Product type="0000" id="531f" name="Z-URC" config="remotec/zurc.xml"/>
|
||||
<Product type="0101" id="8377" name="ZXT-120" config="remotec/zxt-120.xml" />
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0010" name="RCS">
|
||||
<Product type="0001" id="0002" name="TZ43 Thermostat" />
|
||||
|
@ -407,6 +421,7 @@
|
|||
<Product type="0007" id="0020" name="WDTC-20 Thermostat" config="waynedalton/WDTC-20.xml"/>
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0118" name="Wenzhou TKB Control System">
|
||||
<Product type="0001" id="0001" name="TZ88 Smart Energy Plug-in Switch" config="wenzhou/tz88.xml"/>
|
||||
</Manufacturer>
|
||||
<Manufacturer id="004c" name="Woodward Labs">
|
||||
</Manufacturer>
|
||||
|
@ -419,9 +434,12 @@
|
|||
<Manufacturer id="0000" name="Zensys">
|
||||
<Product type="0001" id="0001" name="Controller"/>
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0109" name="Vision">
|
||||
<Product type="1001" id="0101" name="Z-Wave USB Stick"/>
|
||||
</Manufacturer>
|
||||
<Manufacturer id="0115" name="Z-Wave.Me">
|
||||
<Product type="1000" id="0002" name="ZME_06433 Wall Flush-Mountable Dimmer" config="zwave.me/ZME_06433.xml"/>
|
||||
<Product type="1000" id="0003" name="ZME_06435 Motor Control"/>
|
||||
<Product type="1000" id="0003" name="ZME_06436 Motor Control" config="zwave.me/ZME_06436.xml" />
|
||||
<Product type="1000" id="0004" name="ZME_064435 Wall Controller"/>
|
||||
<Product type="0100" id="0001" name="ZME_KFOB 4 Button Key Fob" config="zwave.me/kfob.xml"/>
|
||||
<Product type="1000" id="0001" name="ZME_054313Z Flush-Mountable Switch" />
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
<Option name="logging" value="true" />
|
||||
<Option name="Associate" value="true" />
|
||||
<Option name="NotifyTransactions" value="false" />
|
||||
<Option name="DriverMaxAttempts" value="0" />
|
||||
<Option name="DriverMaxAttempts" value="5" />
|
||||
<Option name="SaveConfiguration" value="true" />
|
||||
</Options>
|
||||
|
|
5
config/remotec/zxt-120.xml
Normal file
5
config/remotec/zxt-120.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
<!-- This thermostat's setpoint descriptions are 0 based, not 1 -->
|
||||
<CommandClass id="67" base="0" />
|
||||
</Product>
|
13
config/wenzhou/tz88.xml
Normal file
13
config/wenzhou/tz88.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
<!-- Configuration -->
|
||||
<CommandClass id="112">
|
||||
<Value type="byte" genre="config" instance="1" index="1" label="Watt meter report period" min="1" max="32767" units="5 sec" value="1">
|
||||
<Help>If the setting is configured for 1 hour (value=720), the TZ88 will report its instant power consumption every 1 hour.</Help>
|
||||
</Value>
|
||||
<Value type="byte" genre="config" instance="1" index="2" label="kWh meter report period" min="1" max="32767" units="10 min" value="6">
|
||||
<Help>If the setting is configured for 1 hour (value=6), the TZ88 will report its accumulated power consumption (kWh) every 1 hour.</Help>
|
||||
</Value>
|
||||
</CommandClass>
|
||||
</Product>
|
97
config/zwave.me/ZME_06436.xml
Normal file
97
config/zwave.me/ZME_06436.xml
Normal file
|
@ -0,0 +1,97 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--Taken from http://en.z-wave.me/docs/ZME_0643x_UserManual.pdf-->
|
||||
<Product xmlns='http://code.google.com/p/open-zwave/'>
|
||||
<!-- Configuration Parameters -->
|
||||
<!--IMPORTANT: Controllers may only allow to configure signed values.
|
||||
In order to set values in the range 128?255 for parameters 4, 5 and 6 the
|
||||
value sent in the application shall be the desired value minus 256.
|
||||
For example: to set parameter 4 in Window Blind to 200? sit may be needed
|
||||
to set a value of 200?256=?56.
|
||||
Similar rule applies to parameter 2: to set values in range 32768?65535
|
||||
use value equal to desired value minus 65536. For example, to set auto
|
||||
switch off period to 10 hours =36000s it may be needed to set a value
|
||||
36000?65536=?29536.-->
|
||||
|
||||
<CommandClass id="112">
|
||||
<Value type="list" index="1" genre="config" label="Set LED indication mode" units="" min="1" max="99" value="3" size="1">
|
||||
<Item label="Disabled" value="0" />
|
||||
<Item label="Show switch/dimmer state / when in motion or inactive (for blinds)" value="1" />
|
||||
<Item label="Night mode (inverted switch state)" value="2" />
|
||||
<Item label="Operated by Indicator Command Class (default)" value="3" />
|
||||
<Item label="Show if not closed (for blinds only)" value="4" />
|
||||
</Value>
|
||||
<Value type="int" index="2" genre="config" label="Automatically open or close after" units="seconds" min="0" max="65535" value="0">
|
||||
<Help>If not zero, automatically switch off/close blind after a user defined time</Help>
|
||||
</Value>
|
||||
<Value type="list" index="3" genre="config" label="What to do on RF off command" value="0" size="1">
|
||||
<Help>If not zero, automatically switch off/close blind after a user defined time</Help>
|
||||
<Item label="Switch off (default)" value="0" />
|
||||
<Item label="Ignore" value="1" />
|
||||
<Item label="Switch on" value="2" />
|
||||
</Value>
|
||||
<Value type="byte" index="4" genre="config" label="Full close time" units="Second" min="0" max="255" value="60" size="1">
|
||||
<Help>Time to go from opened to closed state. Used to estimate the current level. Note that in Permanent motion mode the reported value would a be Closed or Opened, while all Basic and Multilevel Set values (1-99, 255) would Open except 0 value that would Close.</Help>
|
||||
</Value>
|
||||
<Value type="byte" index="5" genre="config" label="Full open time" units="Second" min="0" max="255" value="60" size="1">
|
||||
<Help>Time to go from closed to open state. This value may differ from Full close time for some blinds due to gravity. Used to estimate the current level. Note that in Permanent motion mode the reported value would a be Closed or Opened, while all Basic and Multilevel Set values (1-99, 255) would Open except 0 value that would Close.</Help>
|
||||
</Value>
|
||||
<Value type="byte" index="6" genre="config" label="Node Id of the blocking device" min="0" max="232" value="0">
|
||||
<Help>Id of the device which commands would be interpreted not as Open/Close, but as block/unblock. Usefull with door opening detector: if the door is open, block the blind not to break shades while they move.</Help>
|
||||
</Value>
|
||||
<Value type="list" index="7" genre="config" label="On which command from blocking node to enable the protection" min="0" max="1" value="0" size="1">
|
||||
<Help>Defines which command from blocking device to interpret as closed door and hence, unprotected.</Help>
|
||||
<Item label="on On (default)" value="0" />
|
||||
<Item label="on Off" value="1" />
|
||||
</Value>
|
||||
<Value type="list" index="8" genre="config" label="Stop or Revert if opposite button is pressed" units="" min="0" max="2" value="0">
|
||||
<Help>Defines behaviour on open press while closing and vice versa. To allow Stop behavior when switched by remote, use Stop by Basic</Help>
|
||||
<Item label="Stop (by buttons and Binary) (Default)" value="0" />
|
||||
<Item label="Stop (by buttons, Binary and Basic)" value="1" />
|
||||
<Item label="Revert" value="2" />
|
||||
</Value>
|
||||
<Value type="list" index="9" genre="config" label="Invert open and close relays" units="" min="0" max="1" value="0">
|
||||
<Help>Allow exchanging open and close relays if blind control is wired to the motor incorrectly</Help>
|
||||
<Item label="No (default)" value="0" />
|
||||
<Item label="Yes" value="1" />
|
||||
</Value>
|
||||
<Value type="byte" index="10" genre="config" label="Typical click timeout" units="x 10 milliseconds" min="1" max="100" value="50">
|
||||
<Help>Typical time used to differentiate click, hold, double and triple clicks.</Help>
|
||||
</Value>
|
||||
<Value type="list" index="11" genre="config" label="Invert buttons" value="0" size="1">
|
||||
<Item label="No default)" value="0" />
|
||||
<Item label="Yes" value="1" />
|
||||
</Value>
|
||||
<Value type="list" index="12" genre="config" label="Switch by buttons" value="1" size="1">
|
||||
<Help>If disabled, the local operations by buttons will not switch the load, but only send commands to On/Off association group. In this mode buttons are not linked with the switch anymore. They can be used separately: buttons to control remote device, switch will operate by RF commands only. </Help>
|
||||
<Item label="No" value="0" />
|
||||
<Item label="By single press and hold (default)" value="1" />
|
||||
<Item label="By double press and hold" value="1" />
|
||||
</Value>
|
||||
<Value type="list" index="13" genre="config" label="Action on button single press or hold" value="1" size="1">
|
||||
<Help>Defines which command should be sent on button single press or hold. Basic commands are sent to Association group. Switch All commands are sent broadcast. </Help>
|
||||
<Item label="Disabled" value="0" />
|
||||
<Item label="Switch On, Off and dim using Basic Set(default)" value="1" />
|
||||
<Item label="Switch All On/Off" value="1" />
|
||||
</Value>
|
||||
<Value type="list" index="13" genre="config" label="Action on button double press or hold" value="0" size="1">
|
||||
<Help>Defines which command should be sent on button double press or press-hold. Basic commands are sent to Association group. Switch All commands are sent broadcast. If not disabled, the device will wait for a click timeout to see if the second click would be pressed. This will introduce a small delay for single click commands.</Help>
|
||||
<Item label="Disabled (don't wait for double click,default)" value="0" />
|
||||
<Item label="Switch On, Off and dim using Basic Set" value="1" />
|
||||
<Item label="Switch All On/Off" value="1" />
|
||||
</Value>
|
||||
<Value type="list" index="15" genre="config" label="Send the following Switch All commands" value="1" size="1">
|
||||
<Item label="Switch All Off only (default)" value="1" />
|
||||
<Item label="Switch All On only" value="1" />
|
||||
<Item label="Switch All On and Off" value="255" />
|
||||
</Value>
|
||||
</CommandClass>
|
||||
|
||||
<!-- Association Groups -->
|
||||
<CommandClass id="133">
|
||||
<Associations num_groups="3">
|
||||
<Group index="1" max_associations="8" label="Group 1" auto="false"/>
|
||||
<Group index="2" max_associations="8" label="Group 2" auto="false" />
|
||||
<Group index="3" max_associations="8" label="Send updates" auto="true"/>
|
||||
</Associations>
|
||||
</CommandClass>
|
||||
</Product>
|
191
cpp/build/Makefile
Normal file
191
cpp/build/Makefile
Normal file
|
@ -0,0 +1,191 @@
|
|||
#
|
||||
# Makefile for OpenZWave Linux build
|
||||
# Greg Satz
|
||||
|
||||
# GNU make only
|
||||
|
||||
# Linux requires libudev-dev
|
||||
# FreeBSD requires port misc/e2fsprogs-libuuid
|
||||
|
||||
|
||||
|
||||
#these variables can be modified by the user if needed
|
||||
|
||||
|
||||
# what flags we will use for compiling in debug mode
|
||||
DEBUG_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -Werror -g -DDEBUG -fPIC -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\""
|
||||
# what flags we will use for compiling in release mode
|
||||
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Werror -Wno-format -O3 -DNDEBUG -fPIC -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\""
|
||||
#what flags we will use for linking in debug mode
|
||||
DEBUG_LDFLAGS := -g
|
||||
|
||||
top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../)
|
||||
|
||||
include $(top_srcdir)/cpp/build/support.mk
|
||||
|
||||
|
||||
#if we are on a Mac, add these flags and libs to the compile and link phases
|
||||
ifeq ($(UNAME),Darwin)
|
||||
CFLAGS += -c -DDARWIN -arch i386 -arch x86_64
|
||||
LDFLAGS += -arch i386 -arch x86_64
|
||||
LIBS += -framework IOKit -framework CoreFoundation -arch i386 -arch x86_64
|
||||
else ifeq ($(UNAME),FreeBSD)
|
||||
CFLAGS += -I/usr/local/include
|
||||
else
|
||||
LDFLAGS += -Wl,-soname,libopenzwave.so.$(VERSION)
|
||||
LIBS += -ludev
|
||||
endif
|
||||
|
||||
#where to put the temporary library
|
||||
LIBDIR ?= $(top_builddir)
|
||||
|
||||
INCLUDES := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/src/command_classes/ -I $(top_srcdir)/cpp/src/value_classes/ \
|
||||
-I $(top_srcdir)/cpp/src/platform/ -I $(top_srcdir)/cpp/src/platform/unix -I $(top_srcdir)/cpp/tinyxml/ -I $(top_srcdir)/cpp/hidapi/hidapi/
|
||||
|
||||
ifeq ($(UNAME),Darwin)
|
||||
SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/mac
|
||||
else ifeq ($(UNAME),FreeBSD)
|
||||
SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/libusb
|
||||
else
|
||||
SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/linux
|
||||
endif
|
||||
|
||||
|
||||
SOURCES := $(top_srcdir)/cpp/src $(top_srcdir)/cpp/src/command_classes $(top_srcdir)/cpp/tinyxml \
|
||||
$(top_srcdir)/cpp/src/value_classes $(top_srcdir)/cpp/src/platform $(top_srcdir)/cpp/src/platform/unix $(SOURCES_HIDAPI)
|
||||
VPATH = $(top_srcdir)/cpp/src:$(top_srcdir)/cpp/src/command_classes:$(top_srcdir)/cpp/tinyxml:\
|
||||
$(top_srcdir)/cpp/src/value_classes:$(top_srcdir)/cpp/src/platform:$(top_srcdir)/cpp/src/platform/unix:$(SOURCES_HIDAPI)
|
||||
|
||||
|
||||
tinyxml := $(notdir $(wildcard $(top_srcdir)/cpp/tinyxml/*.cpp))
|
||||
|
||||
ifeq ($(UNAME),Darwin)
|
||||
hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/mac/*.c))
|
||||
else ifeq ($(UNAME),FreeBSD)
|
||||
hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/libusb/*.c))
|
||||
else
|
||||
hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/linux/*.c)) # we do not want the libusb version
|
||||
endif
|
||||
|
||||
cclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/command_classes/*.cpp))
|
||||
vclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/value_classes/*.cpp))
|
||||
pform := $(notdir $(wildcard $(top_srcdir)/cpp/src/platform/*.cpp)) \
|
||||
$(notdir $(wildcard $(top_srcdir)/cpp/src/platform/unix/*.cpp))
|
||||
indep := $(notdir $(filter-out $(top_srcdir)/cpp/src/vers.cpp, $(wildcard $(top_srcdir)/cpp/src/*.cpp)))
|
||||
|
||||
default: $(LIBDIR)/libopenzwave.a $(LIBDIR)/libopenzwave.so.$(VERSION)
|
||||
|
||||
clean:
|
||||
@rm -rf $(DEPDIR) $(OBJDIR) $(LIBDIR)/libopenzwave.so* $(LIBDIR)/libopenzwave.a $(top_builddir)/libopenzwave.pc $(top_builddir)/docs/api $(top_builddir)/Doxyfile
|
||||
|
||||
|
||||
ifeq ($(XMLLINT),)
|
||||
xmltest: $(XMLLINT)
|
||||
$(error xmllint command not found.)
|
||||
else
|
||||
xmltest: $(XMLLINT)
|
||||
@$(XMLLINT) --noout --schema ../../config/device_classes.xsd ../../config/device_classes.xml
|
||||
@$(XMLLINT) --noout --schema ../../config/options.xsd ../../config/options.xml
|
||||
@$(XMLLINT) --noout --schema ../../config/manufacturer_specific.xsd ../../config/manufacturer_specific.xml
|
||||
@$(XMLLINT) --noout --schema ../../config/device_configuration.xsd ../../config/*/*.xml
|
||||
endif
|
||||
|
||||
|
||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(tinyxml))
|
||||
-include $(patsubst %.c,$(DEPDIR)/%.d,$(hidapi))
|
||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(cclasses))
|
||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(vclasses))
|
||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(pform))
|
||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(indep))
|
||||
|
||||
#create a vers.cpp file that contains our version and subversion revisions
|
||||
$(top_srcdir)/cpp/src/vers.cpp:
|
||||
@echo "Creating $(top_srcdir)/cpp/src/vers.cpp file"
|
||||
@echo '#include "Defs.h"' > $(top_srcdir)/cpp/src/vers.cpp
|
||||
@echo 'uint16_t ozw_vers_major = $(VERSION_MAJ);' >> $(top_srcdir)/cpp/src/vers.cpp
|
||||
@echo 'uint16_t ozw_vers_minor = $(VERSION_MIN);' >> $(top_srcdir)/cpp/src/vers.cpp
|
||||
@echo 'uint16_t ozw_vers_revision = $(VERSION_REV);' >> $(top_srcdir)/cpp/src/vers.cpp
|
||||
|
||||
#$(OBJDIR)/vers.o: $(top_builddir)/vers.cpp
|
||||
|
||||
$(LIBDIR)/libopenzwave.a: $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \
|
||||
$(patsubst %.c,$(OBJDIR)/%.o,$(hidapi)) \
|
||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(cclasses)) \
|
||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(vclasses)) \
|
||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(pform)) \
|
||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(indep)) \
|
||||
$(OBJDIR)/vers.o
|
||||
@echo "Linking Static Library"
|
||||
@$(AR) $@ $+
|
||||
@$(RANLIB) $@
|
||||
|
||||
$(LIBDIR)/libopenzwave.so.$(VERSION): $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \
|
||||
$(patsubst %.c,$(OBJDIR)/%.o,$(hidapi)) \
|
||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(cclasses)) \
|
||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(vclasses)) \
|
||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(pform)) \
|
||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(indep)) \
|
||||
$(OBJDIR)/vers.o
|
||||
@echo "Linking Shared Library"
|
||||
@$(LD) $(LDFLAGS) -shared -o $@ $+ $(LIBS)
|
||||
@ln -sf libopenzwave.so.$(VERSION) $(LIBDIR)/libopenzwave.so
|
||||
|
||||
ifeq ($(PKGCONFIG),)
|
||||
$(top_builddir)/libopenzwave.pc: $(top_srcdir)/cpp/build/libopenzwave.pc.in
|
||||
$(warning Not Installing Package Config File)
|
||||
else
|
||||
$(top_builddir)/libopenzwave.pc: $(top_srcdir)/cpp/build/libopenzwave.pc.in $(PKGCONFIG)
|
||||
@echo "Making libopenzwave pkg-config file"
|
||||
@$(SED) \
|
||||
-e 's|[@]prefix@|$(PREFIX)|g' \
|
||||
-e 's|[@]exec_prefix@|$(PREFIX)/bin|g' \
|
||||
-e 's|[@]libdir@|$(instlibdir)|g' \
|
||||
-e 's|[@]includedir@|$(PREFIX)/include/openzwave/|g' \
|
||||
-e 's|[@]VERSION@|$(VERSION)|g' \
|
||||
< "$<" > "$@"
|
||||
endif
|
||||
|
||||
$(top_builddir)/Doxyfile: $(top_srcdir)/docs/Doxyfile.in
|
||||
@mkdir -p $(top_builddir)/docs/api/
|
||||
@$(SED) \
|
||||
-e 's|[@]OUTPUT_DIR@|$(top_builddir)/docs/api/|g' \
|
||||
-e 's|[@]TOPSRC_DIR@|$(top_srcdir)|g' \
|
||||
< "$<" > "$@"
|
||||
|
||||
|
||||
ifeq ($(DOXYGEN),)
|
||||
doc:
|
||||
$(warning Documentation not being built)
|
||||
else
|
||||
doc: $(top_builddir)/Doxyfile
|
||||
@echo "Creating Documentation at $(top_builddir)/docs/api/"
|
||||
@mkdir -p $(top_builddir)/docs/api/
|
||||
@cd $(top_builddir); $(DOXYGEN)
|
||||
endif
|
||||
|
||||
install: $(LIBDIR)/libopenzwave.so.$(VERSION) doc $(top_builddir)/libopenzwave.pc
|
||||
install -d $(DESTDIR)/$(instlibdir)/
|
||||
cp $(LIBDIR)/libopenzwave.so.$(VERSION) $(DESTDIR)/$(instlibdir)/libopenzwave.so.$(VERSION)
|
||||
ln -sf libopenzwave.so.$(VERSION) $(DESTDIR)/$(instlibdir)/libopenzwave.so
|
||||
install -d $(DESTDIR)/$(includedir)
|
||||
install -m 0644 $(top_srcdir)/cpp/src/*.h $(DESTDIR)/$(includedir)
|
||||
install -d $(DESTDIR)/$(includedir)/command_classes/
|
||||
install -m 0644 $(top_srcdir)/cpp/src/command_classes/*.h $(DESTDIR)/$(includedir)/command_classes/
|
||||
install -d $(DESTDIR)/$(includedir)/value_classes/
|
||||
install -m 0644 $(top_srcdir)/cpp/src/value_classes/*.h $(DESTDIR)/$(includedir)/value_classes/
|
||||
install -d $(DESTDIR)/$(includedir)/platform/
|
||||
install -m 0644 $(top_srcdir)/cpp/src/platform/*.h $(DESTDIR)/$(includedir)/platform/
|
||||
install -d $(DESTDIR)/$(includedir)/platform/unix/
|
||||
install -m 0644 $(top_srcdir)/cpp/src/platform/unix/*.h $(DESTDIR)/$(includedir)/platform/unix/
|
||||
install -d $(DESTDIR)/$(sysconfdir)/
|
||||
cp -r $(top_srcdir)/config/* $(DESTDIR)/$(sysconfdir)
|
||||
install -d $(DESTDIR)/$(docdir)/
|
||||
cp -r $(top_srcdir)/docs/* $(DESTDIR)/$(docdir)
|
||||
if [ -d "$(top_builddir)/docs/html/" ]; then cp -r $(top_builddir)/docs/html/* $(DESTDIR)/$(docdir); fi
|
||||
install -d $(DESTDIR)/$(instlibdir)/pkgconfig/
|
||||
if [ -f "$(PKGCONFIG)" ]; then install -d $(DESTDIR)/$(instlibdir)/pkgconfig/; cp $(top_builddir)/libopenzwave.pc $(DESTDIR)/$(instlibdir)/pkgconfig/; fi
|
||||
|
||||
|
||||
|
||||
.SUFFIXES: .d .cpp .o .a
|
||||
.PHONY: default clean install doc
|
11
cpp/build/libopenzwave.pc.in
Normal file
11
cpp/build/libopenzwave.pc.in
Normal file
|
@ -0,0 +1,11 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: libopenzwave
|
||||
Description: A Open Source implementation of the ZWave Serial API
|
||||
URL: http://www.openzwave.org/
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lopenzwave
|
||||
Cflags: -I${includedir} -I${includedir}/command_classes/ -I${includedir}/value_classes/ -I${includedir}/platform/
|
|
@ -1,101 +0,0 @@
|
|||
#
|
||||
# Makefile for OpenZWave Linux build
|
||||
# Greg Satz
|
||||
|
||||
# GNU make only
|
||||
|
||||
# Requires libudev-dev
|
||||
|
||||
.SUFFIXES: .d .cpp .o .a
|
||||
.PHONY: default clean verscheck
|
||||
|
||||
CC := $(CROSS_COMPILE)gcc
|
||||
CXX := $(CROSS_COMPILE)g++
|
||||
LD := $(CROSS_COMPILE)g++
|
||||
AR := $(CROSS_COMPILE)ar rc
|
||||
RANLIB := $(CROSS_COMPILE)ranlib
|
||||
|
||||
DEBUG_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -Werror -g -DDEBUG -DLOG_STDERR -fPIC
|
||||
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Werror -Wno-format -O3 -DNDEBUG -fPIC
|
||||
|
||||
DEBUG_LDFLAGS := -g
|
||||
|
||||
# Change for DEBUG or RELEASE
|
||||
CFLAGS := -c $(DEBUG_CFLAGS)
|
||||
LDFLAGS := $(DEBUG_LDFLAGS)
|
||||
|
||||
LIBDIR := ../../lib/linux
|
||||
|
||||
INCLUDES := -I ../../src -I ../../src/command_classes/ -I ../../src/value_classes/ \
|
||||
-I ../../src/platform/ -I ../../src/platform/unix -I ../../tinyxml/ -I ../../hidapi/hidapi/
|
||||
SOURCES := ../../src ../../src/command_classes ../../tinyxml ../../hidapi/linux \
|
||||
../../src/value_classes ../../src/platform ../../src/platform/unix
|
||||
|
||||
VPATH = ../../src:../../src/command_classes:../../tinyxml:../../hidapi/linux:\
|
||||
../../src/value_classes:../../src/platform:../../src/platform/unix
|
||||
|
||||
%.d : %.cpp
|
||||
@set -e; rm -f $@; \
|
||||
$(CXX) -MM $(INCLUDES) $< > $@.$$$$; \
|
||||
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
tinyxml := $(notdir $(wildcard ../../tinyxml/*.cpp))
|
||||
hidapi := $(notdir $(wildcard ../../hidapi/linux/hid.c)) # we do not want the libusb version
|
||||
cclasses := $(notdir $(wildcard ../../src/command_classes/*.cpp))
|
||||
vclasses := $(notdir $(wildcard ../../src/value_classes/*.cpp))
|
||||
pform := $(notdir $(wildcard ../../src/platform/*.cpp)) \
|
||||
$(notdir $(wildcard ../../src/platform/unix/*.cpp))
|
||||
indep := $(notdir $(wildcard ../../src/*.cpp))
|
||||
|
||||
%.o : %.cpp
|
||||
$(CXX) $(CFLAGS) $(INCLUDES) -o $@ $<
|
||||
|
||||
%.o : %.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
|
||||
|
||||
default: $(LIBDIR)/libopenzwave.a $(LIBDIR)/libopenzwave.so
|
||||
|
||||
clean:
|
||||
rm -f *.d *.d.* *.o vers.c
|
||||
|
||||
XMLLINT := $(shell which xmllint)
|
||||
|
||||
ifeq ($(XMLLINT),)
|
||||
xmltest: $(XMLLINT)
|
||||
$(error xmllint command not found.)
|
||||
else
|
||||
xmltest: $(XMLLINT)
|
||||
@$(XMLLINT) --noout --schema ../../../config/device_classes.xsd ../../../config/device_classes.xml
|
||||
@$(XMLLINT) --noout --schema ../../../config/options.xsd ../../../config/options.xml
|
||||
@$(XMLLINT) --noout --schema ../../../config/manufacturer_specific.xsd ../../../config/manufacturer_specific.xml
|
||||
@$(XMLLINT) --noout --schema ../../../config/device_configuration.xsd ../../../config/*/*.xml
|
||||
endif
|
||||
|
||||
-include $(tinyxml:.cpp=.d)
|
||||
-include $(hidapi:.c=.d)
|
||||
-include $(cclasses:.cpp=.d)
|
||||
-include $(vclasses:.cpp=.d)
|
||||
-include $(pform:.cpp=.d)
|
||||
-include $(indep:.cpp=.d)
|
||||
|
||||
vers.c: verscheck
|
||||
echo 'char ozw_vers[] = "OpenZWave version 1.0.'`svnversion ../..`'";' > vers.c
|
||||
|
||||
vers.o: vers.c
|
||||
|
||||
$(LIBDIR)/libopenzwave.a: $(patsubst %.cpp,%.o,$(tinyxml)) \
|
||||
$(patsubst %.c,%.o,$(hidapi)) \
|
||||
$(patsubst %.cpp,%.o,$(cclasses)) \
|
||||
$(patsubst %.cpp,%.o,$(vclasses)) \
|
||||
$(patsubst %.cpp,%.o,$(pform)) \
|
||||
$(patsubst %.cpp,%.o,$(indep)) vers.o
|
||||
$(AR) $@ $?
|
||||
|
||||
$(LIBDIR)/libopenzwave.so: $(patsubst %.cpp,%.o,$(tinyxml)) \
|
||||
$(patsubst %.c,%.o,$(hidapi)) \
|
||||
$(patsubst %.cpp,%.o,$(cclasses)) \
|
||||
$(patsubst %.cpp,%.o,$(vclasses)) \
|
||||
$(patsubst %.cpp,%.o,$(pform)) \
|
||||
$(patsubst %.cpp,%.o,$(indep)) vers.o
|
||||
$(LD) -shared -Wl,-soname,libopenzwave.so -o $@ $+
|
|
@ -1,102 +0,0 @@
|
|||
#
|
||||
# Makefile for OpenZWave Mac OS X build
|
||||
# Greg Satz
|
||||
|
||||
# GNU make only
|
||||
|
||||
.SUFFIXES: .d .cpp .o .a
|
||||
.PHONY: default clean verscheck
|
||||
|
||||
CC := gcc
|
||||
CXX := g++
|
||||
LD := g++
|
||||
AR := ar crc
|
||||
RANLIB := ranlib
|
||||
|
||||
DEBUG_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-inline -Werror -Wno-format -g -DDEBUG -DLOG_STDERR -fPIC
|
||||
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Werror -Wno-format -O3 -DNDEBUG -fPIC
|
||||
|
||||
DEBUG_LDFLAGS := -g
|
||||
|
||||
# Change for DEBUG or RELEASE
|
||||
ARCH := -arch i386 -arch x86_64
|
||||
CFLAGS := -c -DDARWIN $(ARCH) $(DEBUG_CFLAGS)
|
||||
LDFLAGS := $(DEBUG_LDFLAGS) $(ARCH)
|
||||
|
||||
LIBDIR := ../../lib/mac
|
||||
|
||||
INCLUDES := -I ../../src -I ../../src/command_classes/ -I ../../src/value_classes/ \
|
||||
-I ../../src/platform/ -I ../../src/platform/unix -I ../../tinyxml/ -I ../../hidapi/hidapi/
|
||||
SOURCES := ../../src ../../src/command_classes ../../tinyxml ../../hidapi/mac\
|
||||
../../src/value_classes ../../src/platform ../../src/platform/unix
|
||||
|
||||
VPATH = ../../src:../../src/command_classes:../../tinyxml:../../hidapi/mac:\
|
||||
../../src/value_classes:../../src/platform:../../src/platform/unix
|
||||
|
||||
%.d : %.cpp
|
||||
@set -e; rm -f $@; \
|
||||
$(CXX) -MM $(INCLUDES) $< > $@.$$$$; \
|
||||
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
tinyxml := $(notdir $(wildcard ../../tinyxml/*.cpp))
|
||||
hidapi := $(notdir $(wildcard ../../hidapi/mac/*.c))
|
||||
cclasses := $(notdir $(wildcard ../../src/command_classes/*.cpp))
|
||||
vclasses := $(notdir $(wildcard ../../src/value_classes/*.cpp))
|
||||
pform := $(notdir $(wildcard ../../src/platform/*.cpp)) \
|
||||
$(notdir $(wildcard ../../src/platform/unix/*.cpp))
|
||||
indep := $(notdir $(wildcard ../../src/*.cpp))
|
||||
|
||||
%.o : %.cpp
|
||||
$(CXX) $(CFLAGS) $(INCLUDES) -o $@ $<
|
||||
|
||||
%.o : %.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
|
||||
|
||||
default: $(LIBDIR)/libopenzwave.a $(LIBDIR)/libopenzwave.so
|
||||
|
||||
clean:
|
||||
rm -f *.d *.d.* *.o vers.c
|
||||
|
||||
XMLLINT := $(shell whereis xmllint)
|
||||
|
||||
ifeq ($(XMLLINT),)
|
||||
xmltest: $(XMLLINT)
|
||||
$(error xmllint command not found.)
|
||||
else
|
||||
xmltest: $(XMLLINT)
|
||||
@$(XMLLINT) --noout --schema ../../../config/device_classes.xsd ../../../config/device_classes.xml
|
||||
@$(XMLLINT) --noout --schema ../../../config/options.xsd ../../../config/options.xml
|
||||
@$(XMLLINT) --noout --schema ../../../config/manufacturer_specific.xsd ../../../config/manufacturer_specific.xml
|
||||
@$(XMLLINT) --noout --schema ../../../config/device_configuration.xsd ../../../config/*/*.xml
|
||||
endif
|
||||
|
||||
-include $(tinyxml:.cpp=.d)
|
||||
-include $(hidapi:.c=.d)
|
||||
-include $(cclasses:.cpp=.d)
|
||||
-include $(vclasses:.cpp=.d)
|
||||
-include $(pform:.cpp=.d)
|
||||
-include $(indep:.cpp=.d)
|
||||
|
||||
vers.c: verscheck
|
||||
echo 'char ozw_vers[] = "OpenZWave version 1.0.'`svnversion ../..`'";' > vers.c
|
||||
|
||||
vers.o: vers.c
|
||||
|
||||
$(LIBDIR)/libopenzwave.a: $(patsubst %.cpp,%.o,$(tinyxml)) \
|
||||
$(patsubst %.c,%.o,$(hidapi)) \
|
||||
$(patsubst %.cpp,%.o,$(cclasses)) \
|
||||
$(patsubst %.cpp,%.o,$(vclasses)) \
|
||||
$(patsubst %.cpp,%.o,$(pform)) \
|
||||
$(patsubst %.cpp,%.o,$(indep)) vers.o
|
||||
rm -f $@
|
||||
$(AR) $@ *.o
|
||||
$(RANLIB) $@
|
||||
|
||||
$(LIBDIR)/libopenzwave.so: $(patsubst %.cpp,%.o,$(tinyxml)) \
|
||||
$(patsubst %.c,%.o,$(hidapi)) \
|
||||
$(patsubst %.cpp,%.o,$(cclasses)) \
|
||||
$(patsubst %.cpp,%.o,$(vclasses)) \
|
||||
$(patsubst %.cpp,%.o,$(pform)) \
|
||||
$(patsubst %.cpp,%.o,$(indep)) vers.o
|
||||
$(LD) -shared $(ARCH) -o $@ $+ -framework IOKit -framework CoreFoundation
|
113
cpp/build/support.mk
Normal file
113
cpp/build/support.mk
Normal file
|
@ -0,0 +1,113 @@
|
|||
#The Major Version Number
|
||||
VERSION_MAJ ?= 1
|
||||
#The Minor Version Number
|
||||
VERSION_MIN ?= 0
|
||||
|
||||
#the build type we are making (release or debug)
|
||||
BUILD ?= release
|
||||
#the prefix to install the library into
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
|
||||
#The Location of the svnversion command for determining the repository version
|
||||
SVNVERSION := $(shell which svnversion)
|
||||
#the System we are building on
|
||||
UNAME := $(shell uname -s)
|
||||
#the location of Doxygen to generate our api documentation
|
||||
DOXYGEN := $(shell which doxygen)
|
||||
#the machine type we are building on (i686 or x86_64)
|
||||
MACHINE := $(shell uname -m)
|
||||
#the location of xmllink for checking our config files
|
||||
XMLLINT := $(shell which xmllint)
|
||||
#temp directory to build our tarfile for make dist target
|
||||
TMP := /tmp
|
||||
#pkg-config binary for package config files
|
||||
PKGCONFIG := $(shell which pkg-config)
|
||||
#svn binary for doing a make dist export
|
||||
SVN := $(shell which svn)
|
||||
# if svnversion is not installed, then set the revision to 0
|
||||
ifeq ($(SVNVERSION),)
|
||||
VERSION_REV ?= 0
|
||||
else
|
||||
VERSION_REV ?= $(shell $(SVNVERSION) $(top_srcdir)|awk -F'[^0-9]*' '$$0=$$1')
|
||||
endif
|
||||
ifeq ($(VERSION_REV),)
|
||||
VERSION_REV ?= 0
|
||||
endif
|
||||
# version number to use on the shared library
|
||||
VERSION := $(VERSION_MAJ).$(VERSION_MIN)
|
||||
|
||||
# support Cross Compiling options
|
||||
CC := $(CROSS_COMPILE)gcc
|
||||
CXX := $(CROSS_COMPILE)g++
|
||||
LD := $(CROSS_COMPILE)g++
|
||||
ifeq ($(UNAME),Darwin)
|
||||
AR := libtool -static -o
|
||||
RANLIB := ranlib
|
||||
else
|
||||
AR := $(CROSS_COMPILE)ar rc
|
||||
RANLIB := $(CROSS_COMPILE)ranlib
|
||||
endif
|
||||
SED := sed
|
||||
|
||||
|
||||
#determine if we are release or debug Build and set appropriate flags
|
||||
ifeq ($(BUILD), release)
|
||||
CFLAGS := -c $(RELEASE_CFLAGS)
|
||||
LDFLAGS := $(RELEASE_LDFLAGS)
|
||||
else
|
||||
CFLAGS := -c $(DEBUG_CFLAGS)
|
||||
LDFLAGS := $(DEBUG_LDFLAGS)
|
||||
endif
|
||||
|
||||
#if /lib64 exists, then setup x86_64 library path to lib64 (good indication if a linux has /lib and lib64).
|
||||
#Else, if it doesnt, then set as /lib. This is used in the make install target
|
||||
ifeq ($(wildcard /lib64),)
|
||||
instlibdir.x86_64 = /lib/
|
||||
else
|
||||
instlibdir.x86_64 = /lib64/
|
||||
endif
|
||||
instlibdir.default = /lib/
|
||||
|
||||
#our actual install location for the library
|
||||
ifneq ($(instlibdir.$(MACHINE)),)
|
||||
instlibdir ?= $(PREFIX)$(instlibdir.$(MACHINE))
|
||||
else
|
||||
instlibdir ?= $(PREFIX)$(instlibdir.default)
|
||||
endif
|
||||
|
||||
sysconfdir ?= $(PREFIX)/etc/openzwave/
|
||||
includedir ?= $(PREFIX)/include/openzwave/
|
||||
docdir ?= $(PREFIX)/share/doc/openzwave-$(VERSION).$(VERSION_REV)
|
||||
|
||||
top_builddir ?= $(CURDIR)
|
||||
export top_builddir
|
||||
|
||||
OBJDIR = $(top_builddir)/.lib
|
||||
DEPDIR = $(top_builddir)/.dep
|
||||
|
||||
|
||||
|
||||
|
||||
$(OBJDIR)/%.o : %.cpp
|
||||
@echo "Building $(notdir $@)"
|
||||
@$(CXX) $(CFLAGS) $(INCLUDES) -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o : %.c
|
||||
@echo "Building $(notdir $@)"
|
||||
@$(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
|
||||
|
||||
$(DEPDIR)/%.d : %.cpp
|
||||
@set -e; rm -f $@; \
|
||||
$(CXX) -MM $(INCLUDES) $< > $@.$$$$; \
|
||||
$(SED) 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
$(DEPDIR)/%.d : %.c
|
||||
@set -e; rm -f $@; \
|
||||
$(CXX) -MM $(INCLUDES) $< > $@.$$$$; \
|
||||
$(SED) 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
dummy := $(shell test -d $(OBJDIR) || mkdir -p $(OBJDIR))
|
||||
dummy := $(shell test -d $(DEPDIR) || mkdir -p $(DEPDIR))
|
8
cpp/build/windows/installer/buildall.bat
Normal file
8
cpp/build/windows/installer/buildall.bat
Normal file
|
@ -0,0 +1,8 @@
|
|||
msbuild ..\..\..\examples\windows\MinOZW\vs2010\MinOZW.sln /t:Rebuild /p:Configuration="Debug"
|
||||
msbuild ..\..\..\examples\windows\MinOZW\vs2010\MinOZW.sln /t:Rebuild /p:Configuration="DebugDLL"
|
||||
msbuild ..\..\..\examples\windows\MinOZW\vs2010\MinOZW.sln /t:Rebuild /p:Configuration="Release"
|
||||
msbuild ..\..\..\examples\windows\MinOZW\vs2010\MinOZW.sln /t:Rebuild /p:Configuration="ReleaseDLL"
|
||||
copy ..\..\..\..\dotnet\examples/OZWForm\build\vs2010\*.sln ..\..\..\..\dotnet\examples\OZWForm\src\
|
||||
copy ..\..\..\..\dotnet\examples/OZWForm\build\vs2010\*.csproj ..\..\..\..\dotnet\examples\OZWForm\src\
|
||||
msbuild ..\..\..\..\dotnet\examples\OZWForm\src\OZWForm.sln /t:Rebuild /p:Configuration="Debug"
|
||||
msbuild ..\..\..\..\dotnet\examples\OZWForm\src\OZWForm.sln /t:Rebuild /p:Configuration="Release"
|
68
cpp/build/windows/installer/openzwave.nsi
Normal file
68
cpp/build/windows/installer/openzwave.nsi
Normal file
|
@ -0,0 +1,68 @@
|
|||
installDir "$PROGRAMFILES\OpenZWave"
|
||||
Name "OpenZWave"
|
||||
outFile "setup.exe"
|
||||
|
||||
Page license
|
||||
Page components
|
||||
Page directory
|
||||
Page instfiles
|
||||
UninstPage uninstConfirm
|
||||
UninstPage instfiles
|
||||
|
||||
|
||||
LicenseData ..\..\..\..\license\lgpl.txt
|
||||
|
||||
|
||||
Section "Core Files"
|
||||
SectionIn RO
|
||||
setOutPath "$INSTDIR"
|
||||
File ..\..\..\..\license\lgpl.txt
|
||||
File ..\..\..\examples\windows\MinOZW\vs2010\ReleaseDLL\OpenZWave.dll
|
||||
setOutPath "$INSTDIR\docs\"
|
||||
File ..\..\..\..\docs\default.htm
|
||||
setOutPath "$INSTDIR\docs\images+css\"
|
||||
File ..\..\..\..\docs\images+css\*
|
||||
setOutPath "$INSTDIR\docs\general\"
|
||||
File ..\..\..\..\docs\general\*
|
||||
createShortCut "$SMPROGRAMS\OpenZWave\Getting Started.lnk" "$INSTDIR\docs\default.htm"
|
||||
SectionEnd
|
||||
|
||||
Section /o "Development Files"
|
||||
setOutPath "$INSTDIR\development\DebugDLL"
|
||||
File ..\..\..\examples\windows\MinOZW\vs2010\DebugDLL\OpenZWaved.dll
|
||||
File ..\..\..\examples\windows\MinOZW\vs2010\DebugDLL\OpenZWaved.lib
|
||||
setOutPath "$INSTDIR\development\Debug"
|
||||
File ..\..\..\..\dotnet\examples\OZWForm\src\Debug\OpenZWave.lib
|
||||
setOutPath "$INSTDIR\development\ReleaseDLL"
|
||||
File ..\..\..\examples\windows\MinOZW\vs2010\ReleaseDLL\OpenZWave.dll
|
||||
File ..\..\..\examples\windows\MinOZW\vs2010\ReleaseDLL\OpenZWave.lib
|
||||
setOutPath "$INSTDIR\development\Release"
|
||||
File ..\..\..\..\dotnet\examples\OZWForm\src\Release\OpenZWave.lib
|
||||
setOutPath "$INSTDIR\development\include\openzwave\"
|
||||
File ..\..\..\src\*.h
|
||||
setOutPath "$INSTDIR\development\include\openzwave\command_classes\"
|
||||
file ..\..\..\src\command_classes\*.h
|
||||
setOutPath "$INSTDIR\development\include\openzwave\value_classes\"
|
||||
file ..\..\..\src\value_classes\*.h
|
||||
setOutPath "$INSTDIR\development\include\openzwave\platform\"
|
||||
file ..\..\..\src\platform\*.h
|
||||
setOutPath "$INSTDIR\development\include\openzwave\platform\windows\"
|
||||
file ..\..\..\src\platform\windows\*.h
|
||||
SectionEnd
|
||||
|
||||
Section ".Net Component"
|
||||
SectionIn RO
|
||||
setOutPath "$INSTDIR\dotnet\"
|
||||
File ..\..\..\..\dotnet\examples\OZWForm\src\Debug\OpenZWaveDotNetd.dll
|
||||
File ..\..\..\..\dotnet\examples\OZWForm\src\Debug\OpenZWaveDotNetd.lib
|
||||
File ..\..\..\..\dotnet\examples\OZWForm\src\Release\OpenZWaveDotNet.dll
|
||||
File ..\..\..\..\dotnet\examples\OZWForm\src\Release\OpenZWaveDotNet.lib
|
||||
SectionEnd
|
||||
|
||||
Section "Examples"
|
||||
setOutPath "$INSTDIR\dotnet\"
|
||||
File ..\..\..\examples\windows\MinOZW\vs2010\ReleaseDLL\MinOZW.exe
|
||||
File ..\..\..\..\dotnet\examples\OZWForm\src\bin\x86\Release\OZWForm.exe
|
||||
createShortCut "$SMPROGRAMS\OpenZWave\OpenZWave Form.lnk" "$INSTDIR\OZWForm.exe"
|
||||
SectionEnd
|
||||
|
|
@ -6,11 +6,17 @@ EndProject
|
|||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
DLL_Debug|Win32 = DLL_Debug|Win32
|
||||
DLL_Release|Win32 = DLL_Release|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DLL_Debug|Win32.ActiveCfg = DLL_Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DLL_Debug|Win32.Build.0 = DLL_Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DLL_Release|Win32.ActiveCfg = DLL_Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DLL_Release|Win32.Build.0 = DLL_Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Version="9,00"
|
||||
Name="OpenZWave"
|
||||
ProjectGUID="{497F9828-DEC2-4C80-B9E0-AD066CCB587C}"
|
||||
RootNamespace="OpenZWave"
|
||||
|
@ -144,6 +144,147 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="DLL_Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\src\command_classes;..\..\..\src\value_classes;..\..\..\src\platform;..\..\..\src\platform\windows;..\..\..\tinyxml;..\..\..\hidapi\hidapi"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;OPENZWAVE_MAKEDLL"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Setupapi.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName).dll"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="DLL_Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\src\command_classes;..\..\..\src\value_classes;..\..\..\src\platform;..\..\..\src\platform\windows;..\..\..\tinyxml;..\..\..\hidapi\hidapi"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;OPENZWAVE_MAKEDLL"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Setupapi.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
|
|
|
@ -1,18 +1,24 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
# Visual C++ Express 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenZWave", "OpenZWave.vcxproj", "{497F9828-DEC2-4C80-B9E0-AD066CCB587C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
DebugDLL|Win32 = DebugDLL|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
ReleaseDLL|Win32 = ReleaseDLL|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Release|Win32.Build.0 = Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="DebugDLL|Win32">
|
||||
<Configuration>DebugDLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseDLL|Win32">
|
||||
<Configuration>ReleaseDLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
|
@ -25,6 +33,14 @@
|
|||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
@ -34,18 +50,36 @@
|
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(ProjectName)d</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(ProjectName)</TargetName>
|
||||
<TargetExt Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">.dll</TargetExt>
|
||||
<TargetExt Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">.dll</TargetExt>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -65,6 +99,86 @@
|
|||
<AdditionalDependencies>setupapi.lib</AdditionalDependencies>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Lib>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProgramFiles)\TortoiseSVN\bin\subwcrev.exe" . ..\winversion.ini ..\winversion.cpp
|
||||
if %ERRORLEVEL% GTR 0 (
|
||||
echo Using Default WinVersion.cpp Version as we could not find a copy of TortoiseSVN in your Program Files
|
||||
copy ..\winversion.tmpl ..\winversion.cpp
|
||||
)
|
||||
exit 0</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Export SVN Revision</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\src;..\..\..\src\command_classes;..\..\..\src\value_classes;..\..\..\src\platform;..\..\..\src\platform\windows;..\..\..\tinyxml;..\..\..\hidapi\hidapi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;OPENZWAVE_MAKEDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).dll</OutputFile>
|
||||
<AdditionalDependencies>setupapi.lib</AdditionalDependencies>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Lib>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalDependencies>Setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProgramFiles)\TortoiseSVN\bin\subwcrev.exe" . ..\winversion.ini ..\winversion.cpp
|
||||
if %ERRORLEVEL% GTR 0 (
|
||||
echo Using Default WinVersion.cpp Version as we could not find a copy of TortoiseSVN in your Program Files
|
||||
copy ..\winversion.tmpl ..\winversion.cpp
|
||||
)
|
||||
exit 0</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Export SVN Revision</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\src;..\..\..\src\command_classes;..\..\..\src\value_classes;..\..\..\src\platform;..\..\..\src\platform\windows;..\..\..\tinyxml;..\..\..\hidapi\hidapi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_LIB;OPENZWAVE_MAKEDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).lib</OutputFile>
|
||||
<AdditionalDependencies>setupapi.lib</AdditionalDependencies>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Lib>
|
||||
<Link>
|
||||
<AdditionalDependencies>Setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent />
|
||||
<PreBuildEvent>
|
||||
<Message>Export SVN Revision</Message>
|
||||
<Command>"$(ProgramFiles)\TortoiseSVN\bin\subwcrev.exe" . ..\winversion.ini ..\winversion.cpp
|
||||
if %ERRORLEVEL% GTR 0 (
|
||||
echo Using Default WinVersion.cpp Version as we could not find a copy of TortoiseSVN in your Program Files
|
||||
copy ..\winversion.tmpl ..\winversion.cpp
|
||||
)
|
||||
exit 0</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -83,6 +197,17 @@
|
|||
<OutputFile>$(OutDir)\$(ProjectName).lib</OutputFile>
|
||||
<AdditionalDependencies>setupapi.lib</AdditionalDependencies>
|
||||
</Lib>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(ProgramFiles)\TortoiseSVN\bin\subwcrev.exe" . ..\winversion.ini ..\winversion.cpp
|
||||
if %ERRORLEVEL% GTR 0 (
|
||||
echo Using Default WinVersion.cpp Version as we could not find a copy of TortoiseSVN in your Program Files
|
||||
copy ..\winversion.tmpl ..\winversion.cpp
|
||||
)
|
||||
exit 0</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Export SVN Revision</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\hidapi\hidapi\hidapi.h" />
|
||||
|
@ -270,6 +395,7 @@
|
|||
<ClCompile Include="..\..\..\src\command_classes\ThermostatSetpoint.cpp" />
|
||||
<ClCompile Include="..\..\..\src\command_classes\Version.cpp" />
|
||||
<ClCompile Include="..\..\..\src\command_classes\WakeUp.cpp" />
|
||||
<ClCompile Include="..\winversion.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
|
@ -584,5 +584,8 @@
|
|||
<ClCompile Include="..\..\..\src\command_classes\UserCode.cpp">
|
||||
<Filter>Command Classes</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\winversion.cpp">
|
||||
<Filter>Main</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
3
cpp/build/windows/winversion.ini
Normal file
3
cpp/build/windows/winversion.ini
Normal file
|
@ -0,0 +1,3 @@
|
|||
unsigned short ozw_vers_minor = 1;
|
||||
unsigned short ozw_vers_major = 0;
|
||||
unsigned short ozw_vers_revision = $WCREV$;
|
3
cpp/build/windows/winversion.tmpl
Normal file
3
cpp/build/windows/winversion.tmpl
Normal file
|
@ -0,0 +1,3 @@
|
|||
unsigned short ozw_vers_minor = 1;
|
||||
unsigned short ozw_vers_major = 0;
|
||||
unsigned short ozw_vers_revision = 0;
|
|
@ -254,11 +254,14 @@ int main( int argc, char* argv[] )
|
|||
|
||||
pthread_mutex_lock( &initMutex );
|
||||
|
||||
|
||||
printf("Starting MinOZW with OpenZWave Version %s\n", Manager::getVersionAsString().c_str());
|
||||
|
||||
// Create the OpenZWave Manager.
|
||||
// The first argument is the path to the config files (where the manufacturer_specific.xml file is located
|
||||
// The second argument is the path for saved Z-Wave network state and the log file. If you leave it NULL
|
||||
// the log file will appear in the program's working directory.
|
||||
Options::Create( "../../../../config/", "", "" );
|
||||
Options::Create( "../../../config/", "", "" );
|
||||
Options::Get()->AddOptionInt( "SaveLogLevel", LogLevel_Detail );
|
||||
Options::Get()->AddOptionInt( "QueueLogLevel", LogLevel_Debug );
|
||||
Options::Get()->AddOptionInt( "DumpTrigger", LogLevel_Error );
|
||||
|
@ -278,7 +281,13 @@ int main( int argc, char* argv[] )
|
|||
// Add a Z-Wave Driver
|
||||
// Modify this line to set the correct serial port for your PC interface.
|
||||
|
||||
#ifdef DARWIN
|
||||
string port = "/dev/cu.usbserial";
|
||||
#elif WIN32
|
||||
string port = "\\\\.\\COM6";
|
||||
#else
|
||||
string port = "/dev/ttyUSB0";
|
||||
#endif
|
||||
if ( argc > 1 )
|
||||
{
|
||||
port = argv[1];
|
68
cpp/examples/MinOZW/Makefile
Normal file
68
cpp/examples/MinOZW/Makefile
Normal file
|
@ -0,0 +1,68 @@
|
|||
#
|
||||
# Makefile for OpenzWave Mac OS X applications
|
||||
# Greg Satz
|
||||
|
||||
# GNU make only
|
||||
|
||||
# requires libudev-dev
|
||||
|
||||
.SUFFIXES: .d .cpp .o .a
|
||||
.PHONY: default clean
|
||||
|
||||
|
||||
DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG
|
||||
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3
|
||||
|
||||
DEBUG_LDFLAGS := -g
|
||||
|
||||
top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../../)
|
||||
|
||||
|
||||
INCLUDES := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/src/command_classes/ -I $(top_srcdir)/cpp/src/value_classes/ \
|
||||
-I $(top_srcdir)/cpp/src/platform/ -I $(top_srcdir)/cpp/src/platform/unix -I $(top_srcdir)/cpp/tinyxml/ -I $(top_srcdir)/cpp/hidapi/hidapi/
|
||||
LIBS = $(wildcard $(LIBDIR)/*.so $(top_builddir)/*.so $(top_builddir)/cpp/build/*.so )
|
||||
LIBSDIR = $(abspath $(dir $(firstword $(LIBS))))
|
||||
minozwsrc := $(notdir $(wildcard $(top_srcdir)/cpp/examples/MinOZW/*.cpp))
|
||||
VPATH := $(top_srcdir)/cpp/examples/MinOZW
|
||||
|
||||
top_builddir ?= $(CURDIR)
|
||||
|
||||
default: $(top_builddir)/MinOZW
|
||||
|
||||
include $(top_srcdir)/cpp/build/support.mk
|
||||
|
||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(minozwsrc))
|
||||
|
||||
#if we are on a Mac, add these flags and libs to the compile and link phases
|
||||
ifeq ($(UNAME),Darwin)
|
||||
CFLAGS += -DDARWIN
|
||||
endif
|
||||
|
||||
$(OBJDIR)/MinOZW: $(patsubst %.cpp,$(OBJDIR)/%.o,$(minozwsrc))
|
||||
@echo "Linking $(OBJDIR)/MinOZW"
|
||||
$(LD) $(LDFLAGS) -o $@ $< $(LIBS) -pthread
|
||||
|
||||
$(top_builddir)/MinOZW: $(top_srcdir)/cpp/examples/MinOZW/MinOZW.in $(OBJDIR)/MinOZW
|
||||
@echo "Creating Temporary Shell Launch Script"
|
||||
@$(SED) \
|
||||
-e 's|[@]LDPATH@|$(LIBSDIR)|g' \
|
||||
< "$<" > "$@"
|
||||
@chmod +x $(top_builddir)/MinOZW
|
||||
|
||||
clean:
|
||||
@rm -rf $(DEPDIR) $(OBJDIR) $(top_builddir)/MinOZW
|
||||
|
||||
ifeq ($(XMLLINT),)
|
||||
xmltest: $(XMLLINT)
|
||||
$(error xmllint command not found.)
|
||||
else
|
||||
xmltest: $(XMLLINT)
|
||||
@$(XMLLINT) --noout --schema ../../../config/zwcfg.xsd zwcfg_*.xml
|
||||
@$(XMLLINT) --noout --schema ../../../config/zwscene.xsd zwscene.xml
|
||||
endif
|
||||
|
||||
install: $(OBJDIR)/MinOZW
|
||||
@echo "Installing into Prefix: $(PREFIX)"
|
||||
@install -d $(DESTDIR)/$(PREFIX)/bin/
|
||||
@cp $(OBJDIR)/MinOZW $(DESTDIR)/$(PREFIX)/bin/MinOZW
|
||||
@chmod 755 $(DESTDIR)/$(PREFIX)/bin/MinOZW
|
9
cpp/examples/MinOZW/MinOZW.in
Normal file
9
cpp/examples/MinOZW/MinOZW.in
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
LD_PATH=@LDPATH@
|
||||
if test $# -gt 0; then
|
||||
if test $1 == "gdb"; then
|
||||
LD_LIBRARY_PATH="$LD_PATH:$LD_LIBRARY_PATH" gdb .lib/MinOZW
|
||||
fi
|
||||
else
|
||||
LD_LIBRARY_PATH="$LD_PATH:$LD_LIBRARY_PATH" .lib/MinOZW
|
||||
fi
|
|
@ -1,53 +0,0 @@
|
|||
#
|
||||
# Makefile for OpenzWave Mac OS X applications
|
||||
# Greg Satz
|
||||
|
||||
# GNU make only
|
||||
|
||||
# requires libudev-dev
|
||||
|
||||
.SUFFIXES: .cpp .o .a .s
|
||||
|
||||
CC := $(CROSS_COMPILE)gcc
|
||||
CXX := $(CROSS_COMPILE)g++
|
||||
LD := $(CROSS_COMPILE)g++
|
||||
AR := $(CROSS_COMPILE)ar rc
|
||||
RANLIB := $(CROSS_COMPILE)ranlib
|
||||
|
||||
DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG
|
||||
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3
|
||||
|
||||
DEBUG_LDFLAGS := -g
|
||||
|
||||
# Change for DEBUG or RELEASE
|
||||
CFLAGS := -c $(DEBUG_CFLAGS)
|
||||
LDFLAGS := $(DEBUG_LDFLAGS)
|
||||
|
||||
INCLUDES := -I ../../../src -I ../../../src/command_classes/ -I ../../../src/value_classes/ \
|
||||
-I ../../../src/platform/ -I ../../../h/platform/unix -I ../../../tinyxml/ -I ../../../hidapi/hidapi/
|
||||
LIBS = $(wildcard ../../../lib/linux/*.a)
|
||||
|
||||
%.o : %.cpp
|
||||
$(CXX) $(CFLAGS) $(INCLUDES) -o $@ $<
|
||||
|
||||
all: test
|
||||
|
||||
lib:
|
||||
$(MAKE) -C ../../../build/linux
|
||||
|
||||
test: Main.o lib
|
||||
$(LD) -o $@ $(LDFLAGS) $< $(LIBS) -pthread -ludev
|
||||
|
||||
clean:
|
||||
rm -f test Main.o
|
||||
|
||||
XMLLINT := $(shell whereis -b xmllint | cut -c10-)
|
||||
|
||||
ifeq ($(XMLLINT),)
|
||||
xmltest: $(XMLLINT)
|
||||
$(error xmllint command not found.)
|
||||
else
|
||||
xmltest: $(XMLLINT)
|
||||
@$(XMLLINT) --noout --schema ../../../../config/zwcfg.xsd zwcfg_*.xml
|
||||
@$(XMLLINT) --noout --schema ../../../../config/zwscene.xsd zwscene.xml
|
||||
endif
|
|
@ -1,370 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Main.cpp
|
||||
//
|
||||
// Minimal application to test OpenZWave.
|
||||
//
|
||||
// Creates an OpenZWave::Driver and the waits. In Debug builds
|
||||
// you should see verbose logging to the console, which will
|
||||
// indicate that communications with the Z-Wave network are working.
|
||||
//
|
||||
// Copyright (c) 2010 Mal Lansell <mal@openzwave.com>
|
||||
//
|
||||
//
|
||||
// SOFTWARE NOTICE AND LICENSE
|
||||
//
|
||||
// This file is part of OpenZWave.
|
||||
//
|
||||
// OpenZWave is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation, either version 3 of the License,
|
||||
// or (at your option) any later version.
|
||||
//
|
||||
// OpenZWave is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include "Options.h"
|
||||
#include "Manager.h"
|
||||
#include "Driver.h"
|
||||
#include "Node.h"
|
||||
#include "Group.h"
|
||||
#include "Notification.h"
|
||||
#include "ValueStore.h"
|
||||
#include "Value.h"
|
||||
#include "ValueBool.h"
|
||||
#include "Log.h"
|
||||
|
||||
using namespace OpenZWave;
|
||||
|
||||
static uint32 g_homeId = 0;
|
||||
static bool g_initFailed = false;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32 m_homeId;
|
||||
uint8 m_nodeId;
|
||||
bool m_polled;
|
||||
list<ValueID> m_values;
|
||||
}NodeInfo;
|
||||
|
||||
static list<NodeInfo*> g_nodes;
|
||||
static pthread_mutex_t g_criticalSection;
|
||||
static pthread_cond_t initCond = PTHREAD_COND_INITIALIZER;
|
||||
static pthread_mutex_t initMutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <GetNodeInfo>
|
||||
// Return the NodeInfo object associated with this notification
|
||||
//-----------------------------------------------------------------------------
|
||||
NodeInfo* GetNodeInfo
|
||||
(
|
||||
Notification const* _notification
|
||||
)
|
||||
{
|
||||
uint32 const homeId = _notification->GetHomeId();
|
||||
uint8 const nodeId = _notification->GetNodeId();
|
||||
for( list<NodeInfo*>::iterator it = g_nodes.begin(); it != g_nodes.end(); ++it )
|
||||
{
|
||||
NodeInfo* nodeInfo = *it;
|
||||
if( ( nodeInfo->m_homeId == homeId ) && ( nodeInfo->m_nodeId == nodeId ) )
|
||||
{
|
||||
return nodeInfo;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <OnNotification>
|
||||
// Callback that is triggered when a value, group or node changes
|
||||
//-----------------------------------------------------------------------------
|
||||
void OnNotification
|
||||
(
|
||||
Notification const* _notification,
|
||||
void* _context
|
||||
)
|
||||
{
|
||||
// Must do this inside a critical section to avoid conflicts with the main thread
|
||||
pthread_mutex_lock( &g_criticalSection );
|
||||
|
||||
switch( _notification->GetType() )
|
||||
{
|
||||
case Notification::Type_ValueAdded:
|
||||
{
|
||||
if( NodeInfo* nodeInfo = GetNodeInfo( _notification ) )
|
||||
{
|
||||
// Add the new value to our list
|
||||
nodeInfo->m_values.push_back( _notification->GetValueID() );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_ValueRemoved:
|
||||
{
|
||||
if( NodeInfo* nodeInfo = GetNodeInfo( _notification ) )
|
||||
{
|
||||
// Remove the value from out list
|
||||
for( list<ValueID>::iterator it = nodeInfo->m_values.begin(); it != nodeInfo->m_values.end(); ++it )
|
||||
{
|
||||
if( (*it) == _notification->GetValueID() )
|
||||
{
|
||||
nodeInfo->m_values.erase( it );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_ValueChanged:
|
||||
{
|
||||
// One of the node values has changed
|
||||
if( NodeInfo* nodeInfo = GetNodeInfo( _notification ) )
|
||||
{
|
||||
nodeInfo = nodeInfo; // placeholder for real action
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_Group:
|
||||
{
|
||||
// One of the node's association groups has changed
|
||||
if( NodeInfo* nodeInfo = GetNodeInfo( _notification ) )
|
||||
{
|
||||
nodeInfo = nodeInfo; // placeholder for real action
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_NodeAdded:
|
||||
{
|
||||
// Add the new node to our list
|
||||
NodeInfo* nodeInfo = new NodeInfo();
|
||||
nodeInfo->m_homeId = _notification->GetHomeId();
|
||||
nodeInfo->m_nodeId = _notification->GetNodeId();
|
||||
nodeInfo->m_polled = false;
|
||||
g_nodes.push_back( nodeInfo );
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_NodeRemoved:
|
||||
{
|
||||
// Remove the node from our list
|
||||
uint32 const homeId = _notification->GetHomeId();
|
||||
uint8 const nodeId = _notification->GetNodeId();
|
||||
for( list<NodeInfo*>::iterator it = g_nodes.begin(); it != g_nodes.end(); ++it )
|
||||
{
|
||||
NodeInfo* nodeInfo = *it;
|
||||
if( ( nodeInfo->m_homeId == homeId ) && ( nodeInfo->m_nodeId == nodeId ) )
|
||||
{
|
||||
g_nodes.erase( it );
|
||||
delete nodeInfo;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_NodeEvent:
|
||||
{
|
||||
// We have received an event from the node, caused by a
|
||||
// basic_set or hail message.
|
||||
if( NodeInfo* nodeInfo = GetNodeInfo( _notification ) )
|
||||
{
|
||||
nodeInfo = nodeInfo; // placeholder for real action
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_PollingDisabled:
|
||||
{
|
||||
if( NodeInfo* nodeInfo = GetNodeInfo( _notification ) )
|
||||
{
|
||||
nodeInfo->m_polled = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_PollingEnabled:
|
||||
{
|
||||
if( NodeInfo* nodeInfo = GetNodeInfo( _notification ) )
|
||||
{
|
||||
nodeInfo->m_polled = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_DriverReady:
|
||||
{
|
||||
g_homeId = _notification->GetHomeId();
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_DriverFailed:
|
||||
{
|
||||
g_initFailed = true;
|
||||
pthread_cond_broadcast(&initCond);
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_AwakeNodesQueried:
|
||||
case Notification::Type_AllNodesQueried:
|
||||
case Notification::Type_AllNodesQueriedSomeDead:
|
||||
{
|
||||
pthread_cond_broadcast(&initCond);
|
||||
break;
|
||||
}
|
||||
|
||||
case Notification::Type_DriverReset:
|
||||
case Notification::Type_Notification:
|
||||
case Notification::Type_NodeNaming:
|
||||
case Notification::Type_NodeProtocolInfo:
|
||||
case Notification::Type_NodeQueriesComplete:
|
||||
default:
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &g_criticalSection );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <main>
|
||||
// Create the driver and then wait
|
||||
//-----------------------------------------------------------------------------
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
pthread_mutexattr_t mutexattr;
|
||||
|
||||
pthread_mutexattr_init ( &mutexattr );
|
||||
pthread_mutexattr_settype( &mutexattr, PTHREAD_MUTEX_RECURSIVE );
|
||||
pthread_mutex_init( &g_criticalSection, &mutexattr );
|
||||
pthread_mutexattr_destroy( &mutexattr );
|
||||
|
||||
pthread_mutex_lock( &initMutex );
|
||||
|
||||
// Create the OpenZWave Manager.
|
||||
// The first argument is the path to the config files (where the manufacturer_specific.xml file is located
|
||||
// The second argument is the path for saved Z-Wave network state and the log file. If you leave it NULL
|
||||
// the log file will appear in the program's working directory.
|
||||
Options::Create( "../../../../config/", "", "" );
|
||||
Options::Get()->AddOptionInt( "SaveLogLevel", LogLevel_Detail );
|
||||
Options::Get()->AddOptionInt( "QueueLogLevel", LogLevel_Debug );
|
||||
Options::Get()->AddOptionInt( "DumpTrigger", LogLevel_Error );
|
||||
Options::Get()->AddOptionInt( "PollInterval", 500 );
|
||||
Options::Get()->AddOptionBool( "IntervalBetweenPolls", true );
|
||||
Options::Get()->AddOptionBool("ValidateValueChanges", true);
|
||||
Options::Get()->Lock();
|
||||
|
||||
Manager::Create();
|
||||
|
||||
// Add a callback handler to the manager. The second argument is a context that
|
||||
// is passed to the OnNotification method. If the OnNotification is a method of
|
||||
// a class, the context would usually be a pointer to that class object, to
|
||||
// avoid the need for the notification handler to be a static.
|
||||
Manager::Get()->AddWatcher( OnNotification, NULL );
|
||||
|
||||
// Add a Z-Wave Driver
|
||||
// Modify this line to set the correct serial port for your PC interface.
|
||||
|
||||
string port = "/dev/cu.usbserial";
|
||||
if( argc > 1 )
|
||||
{
|
||||
port = argv[1];
|
||||
}
|
||||
if( strcasecmp( port.c_str(), "usb") == 0 )
|
||||
{
|
||||
Manager::Get()->AddDriver( "HID Controller", Driver::ControllerInterface_Hid );
|
||||
}
|
||||
else
|
||||
{
|
||||
Manager::Get()->AddDriver( port );
|
||||
}
|
||||
|
||||
// Now we just wait for either the AwakeNodesQueried or AllNodesQueried notification,
|
||||
// then write out the config file.
|
||||
// In a normal app, we would be handling notifications and building a UI for the user.
|
||||
pthread_cond_wait( &initCond, &initMutex );
|
||||
|
||||
// Since the configuration file contains command class information that is only
|
||||
// known after the nodes on the network are queried, wait until all of the nodes
|
||||
// on the network have been queried (at least the "listening" ones) before
|
||||
// writing the configuration file. (Maybe write again after sleeping nodes have
|
||||
// been queried as well.)
|
||||
if( !g_initFailed )
|
||||
{
|
||||
|
||||
Manager::Get()->WriteConfig( g_homeId );
|
||||
|
||||
// The section below demonstrates setting up polling for a variable. In this simple
|
||||
// example, it has been hardwired to poll COMMAND_CLASS_BASIC on the each node that
|
||||
// supports this setting.
|
||||
pthread_mutex_lock( &g_criticalSection );
|
||||
for( list<NodeInfo*>::iterator it = g_nodes.begin(); it != g_nodes.end(); ++it )
|
||||
{
|
||||
NodeInfo* nodeInfo = *it;
|
||||
|
||||
// skip the controller (most likely node 1)
|
||||
if( nodeInfo->m_nodeId == 1) continue;
|
||||
|
||||
for( list<ValueID>::iterator it2 = nodeInfo->m_values.begin(); it2 != nodeInfo->m_values.end(); ++it2 )
|
||||
{
|
||||
ValueID v = *it2;
|
||||
if( v.GetCommandClassId() == 0x20 )
|
||||
{
|
||||
Manager::Get()->EnablePoll( v, 2 ); // enables polling with "intensity" of 2, though this is irrelevant with only one value polled
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock( &g_criticalSection );
|
||||
|
||||
// If we want to access our NodeInfo list, that has been built from all the
|
||||
// notification callbacks we received from the library, we have to do so
|
||||
// from inside a Critical Section. This is because the callbacks occur on other
|
||||
// threads, and we cannot risk the list being changed while we are using it.
|
||||
// We must hold the critical section for as short a time as possible, to avoid
|
||||
// stalling the OpenZWave drivers.
|
||||
// At this point, the program just waits for 3 minutes (to demonstrate polling),
|
||||
// then exits
|
||||
for( int i = 0; i < 60*3; i++ )
|
||||
{
|
||||
pthread_mutex_lock( &g_criticalSection );
|
||||
// but NodeInfo list and similar data should be inside critical section
|
||||
pthread_mutex_unlock( &g_criticalSection );
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
Driver::DriverData data;
|
||||
Manager::Get()->GetDriverStatistics( g_homeId, &data );
|
||||
printf("SOF: %d ACK Waiting: %d Read Aborts: %d Bad Checksums: %d\n", data.m_SOFCnt, data.m_ACKWaiting, data.m_readAborts, data.m_badChecksum);
|
||||
printf("Reads: %d Writes: %d CAN: %d NAK: %d ACK: %d Out of Frame: %d\n", data.m_readCnt, data.m_writeCnt, data.m_CANCnt, data.m_NAKCnt, data.m_ACKCnt, data.m_OOFCnt);
|
||||
printf("Dropped: %d Retries: %d\n", data.m_dropped, data.m_retries);
|
||||
}
|
||||
|
||||
// program exit (clean up)
|
||||
if( strcasecmp( port.c_str(), "usb") == 0 )
|
||||
{
|
||||
Manager::Get()->RemoveDriver( "HID Controller" );
|
||||
}
|
||||
else
|
||||
{
|
||||
Manager::Get()->RemoveDriver( port );
|
||||
}
|
||||
|
||||
Manager::Get()->RemoveWatcher( OnNotification, NULL );
|
||||
Manager::Destroy();
|
||||
Options::Destroy();
|
||||
pthread_mutex_destroy( &g_criticalSection );
|
||||
return 0;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
#
|
||||
# Makefile for OpenzWave Mac OS X applications
|
||||
# Greg Satz
|
||||
|
||||
# GNU make only
|
||||
|
||||
.SUFFIXES: .cpp .o .a
|
||||
|
||||
CC := gcc
|
||||
CXX := g++
|
||||
LD := g++
|
||||
AR := ar rc
|
||||
RANLIB := ranlib
|
||||
|
||||
DEBUG_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-inline -Werror -Wno-format -g -DDEBUG
|
||||
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Werror -Wno-format -O3 -DNDEBUG
|
||||
|
||||
DEBUG_LDFLAGS := -g
|
||||
|
||||
# Change for DEBUG or RELEASE
|
||||
ARCH := -arch i386 -arch x86_64
|
||||
CFLAGS := -c -DDARWIN $(DEBUG_CFLAGS) $(ARCH)
|
||||
LDFLAGS := $(DEBUG_LDFLAGS)
|
||||
|
||||
INCLUDES := -I ../../../src -I ../../../src/command_classes/ -I ../../../src/value_classes/ \
|
||||
-I ../../../src/platform/ -I ../../../h/platform/unix -I ../../../tinyxml/ -I ../../../hidapi/hidapi/
|
||||
LIBS = $(wildcard ../../../lib/mac/*.a)
|
||||
|
||||
%.o : %.cpp
|
||||
$(CXX) $(CFLAGS) $(INCLUDES) -o $@ $<
|
||||
|
||||
all: test
|
||||
|
||||
lib:
|
||||
$(MAKE) -C ../../../build/mac
|
||||
|
||||
test: Main.o #lib
|
||||
$(LD) -o $@ $(LDFLAGS) $< $(LIBS) -pthread -framework IOKit -framework CoreFoundation $(ARCH)
|
||||
|
||||
clean:
|
||||
rm -f test Main.o
|
||||
|
||||
XMLLINT := $(shell whereis xmllint)
|
||||
|
||||
ifeq ($(XMLLINT),)
|
||||
xmltest: $(XMLLINT)
|
||||
$(error xmllint command not found.)
|
||||
else
|
||||
xmltest: $(XMLLINT)
|
||||
@$(XMLLINT) --noout --schema ../../../../config/zwcfg.xsd zwcfg_*.xml
|
||||
@$(XMLLINT) --noout --schema ../../../../config/zwscene.xsd zwscene.xml
|
||||
endif
|
|
@ -245,7 +245,7 @@ int main( int argc, char* argv[] )
|
|||
// The first argument is the path to the config files (where the manufacturer_specific.xml file is located
|
||||
// The second argument is the path for saved Z-Wave network state and the log file. If you leave it NULL
|
||||
// the log file will appear in the program's working directory.
|
||||
Options::Create( "../../../../../config/", "", "" );
|
||||
Options::Create( "../../../../../../config/", "", "" );
|
||||
Options::Get()->AddOptionInt( "SaveLogLevel", LogLevel_Detail );
|
||||
Options::Get()->AddOptionInt( "QueueLogLevel", LogLevel_Debug );
|
||||
Options::Get()->AddOptionInt( "DumpTrigger", LogLevel_Error );
|
||||
|
|
|
@ -11,15 +11,25 @@ EndProject
|
|||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
DLL_Debug|Win32 = DLL_Debug|Win32
|
||||
DLL_Release|Win32 = DLL_Release|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.DLL_Debug|Win32.ActiveCfg = DLL_Debug|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.DLL_Debug|Win32.Build.0 = DLL_Debug|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.DLL_Release|Win32.ActiveCfg = DLL_Release|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.DLL_Release|Win32.Build.0 = DLL_Release|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.Release|Win32.Build.0 = Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DLL_Debug|Win32.ActiveCfg = DLL_Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DLL_Debug|Win32.Build.0 = DLL_Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DLL_Release|Win32.ActiveCfg = DLL_Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DLL_Release|Win32.Build.0 = DLL_Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Version="9,00"
|
||||
Name="MinOZW"
|
||||
ProjectGUID="{22847D76-B1CF-4921-8B7A-61E248412C4A}"
|
||||
RootNamespace="MinOZW"
|
||||
|
@ -117,7 +117,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="..\..\..\..\src;..\..\..\..\src\value_classes"
|
||||
AdditionalIncludeDirectories="..\..\..\..\src;..\..\..\..\src\value_classes;..\..\..\..\src\platform"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
|
@ -166,6 +166,156 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="DLL_Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\src;..\..\..\..\src\value_classes;..\..\..\..\src\platform"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;OPENZWAVE_USEDLL"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(OutDir)\OpenZWave.lib""
|
||||
OutputFile="$(OutDir)\$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="DLL_Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="..\..\..\..\src;..\..\..\..\src\value_classes;..\..\..\..\src\platform"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;OPENZWAVE_USEDLL"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(OutDir)\OpenZWave.lib""
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
# Visual C++ Express 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinOZW", "MinOZW.vcxproj", "{22847D76-B1CF-4921-8B7A-61E248412C4A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C} = {497F9828-DEC2-4C80-B9E0-AD066CCB587C}
|
||||
|
@ -11,17 +11,27 @@ EndProject
|
|||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
DebugDLL|Win32 = DebugDLL|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
ReleaseDLL|Win32 = ReleaseDLL|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.Release|Win32.Build.0 = Release|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
|
||||
{22847D76-B1CF-4921-8B7A-61E248412C4A}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.Release|Win32.Build.0 = Release|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
|
||||
{497F9828-DEC2-4C80-B9E0-AD066CCB587C}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="DebugDLL|Win32">
|
||||
<Configuration>DebugDLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseDLL|Win32">
|
||||
<Configuration>ReleaseDLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
|
@ -21,34 +29,60 @@
|
|||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -70,11 +104,32 @@
|
|||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\src;..\..\..\..\src\platform;..\..\..\..\src\value_classes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;OPENZWAVE_USEDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(OutDir)\OpenZWaved.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\src;..\..\..\..\src\value_classes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\src;..\..\..\..\src\platform;..\..\..\..\src\value_classes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
|
@ -92,6 +147,29 @@
|
|||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\src;..\..\..\..\src\platform;..\..\..\..\src\value_classes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;OPENZWAVE_USEDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(OutDir)\OpenZWave.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Main.cpp" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -338,12 +338,15 @@ end:
|
|||
|
||||
int HID_API_EXPORT hid_init(void)
|
||||
{
|
||||
const char *locale;
|
||||
/* Refer to http://code.google.com/p/open-zwave/issues/detail?id=254
|
||||
* We should not be setting the Locale and let the application set it
|
||||
*/
|
||||
// const char *locale;
|
||||
|
||||
/* Set the locale if it's not set. */
|
||||
locale = setlocale(LC_CTYPE, NULL);
|
||||
if (!locale)
|
||||
setlocale(LC_CTYPE, "");
|
||||
// locale = setlocale(LC_CTYPE, NULL);
|
||||
// if (!locale)
|
||||
// setlocale(LC_CTYPE, "");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
namespace OpenZWave
|
||||
{
|
||||
class Bitfield
|
||||
class OPENZWAVE_EXPORT Bitfield
|
||||
{
|
||||
friend class Iterator;
|
||||
|
||||
|
@ -149,7 +149,9 @@ namespace OpenZWave
|
|||
Iterator End()const{ return Iterator( this, m_bits.size()<<5 ); }
|
||||
|
||||
private:
|
||||
OPENZWAVE_EXPORT_WARNINGS_OFF
|
||||
vector<uint32> m_bits;
|
||||
OPENZWAVE_EXPORT_WARNINGS_ON
|
||||
uint32 m_numSetBits;
|
||||
};
|
||||
} // namespace OpenZWave
|
||||
|
|
|
@ -28,7 +28,30 @@
|
|||
#ifndef _Defs_H
|
||||
#define _Defs_H
|
||||
#include <assert.h>
|
||||
#include <list>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
// Compilation export flags
|
||||
#if (defined _WINDOWS || defined WIN32 || defined _MSC_VER) && !defined MINGW
|
||||
# if defined OPENZWAVE_MAKEDLL // Create the dynamic library.
|
||||
# define OPENZWAVE_EXPORT __declspec(dllexport)
|
||||
# elif defined OPENZWAVE_USEDLL // Use the dynamic library
|
||||
# define OPENZWAVE_EXPORT __declspec(dllimport)
|
||||
# else // Create/Use the static library
|
||||
# define OPENZWAVE_EXPORT
|
||||
# endif
|
||||
// Disable export warnings
|
||||
# define OPENZWAVE_EXPORT_WARNINGS_OFF __pragma( warning(push) )\
|
||||
__pragma( warning(disable: 4251) )
|
||||
# define OPENZWAVE_EXPORT_WARNINGS_ON __pragma( warning(pop) )
|
||||
#else
|
||||
# define OPENZWAVE_EXPORT
|
||||
# define OPENZWAVE_EXPORT_WARNINGS_OFF
|
||||
# define OPENZWAVE_EXPORT_WARNINGS_ON
|
||||
#endif
|
||||
|
||||
#ifdef NULL
|
||||
#undef NULL
|
||||
|
@ -58,6 +81,60 @@ typedef unsigned long long uint64;
|
|||
typedef float float32;
|
||||
typedef double float64;
|
||||
|
||||
typedef struct ozwversion {
|
||||
uint32_t _v; /* major << 16 | minor */
|
||||
} ozwversion;
|
||||
|
||||
/**
|
||||
* \brief version_major - return the major version of the given struct
|
||||
* \param v: the version number to obtain the major number from
|
||||
* \return the Major Version Number
|
||||
*/
|
||||
static inline uint16_t version_major(struct ozwversion v) {
|
||||
return (v._v & 0xFFFF0000) >> 16;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief version_minor - return the minor version of the given struct
|
||||
* \param v: the version number to obtain the minor number from
|
||||
* \return the Minor Version Number
|
||||
*/
|
||||
static inline uint16_t version_minor(const struct ozwversion &v) {
|
||||
return v._v & 0xFFFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief version - create a new version number
|
||||
* \param major: major version number
|
||||
* \param minor: minor version number
|
||||
* \return the Version Number Struct
|
||||
*/
|
||||
static inline struct ozwversion version(uint16_t major, uint16_t minor)
|
||||
{
|
||||
struct ozwversion v;
|
||||
v._v = (uint32_t)(major << 16) | (uint32_t)minor;
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief version_cmp - compare two versions
|
||||
* \param a: the first version number
|
||||
* \param b: the second version number
|
||||
* \return a number greater, equal, or less than 0 if a is greater, equal or
|
||||
* less than b, respectively
|
||||
*
|
||||
* Example:
|
||||
* struct version a = version(1, 0);
|
||||
* struct version b = version(1, 3);
|
||||
* if (version_cmp(a, b) < 0)
|
||||
* printf("b is smaller than b\n");
|
||||
*/
|
||||
static inline int version_cmp(struct ozwversion a, struct ozwversion b)
|
||||
{
|
||||
return (a._v == b._v) ? 0 : (a._v > b._v) ? 1 : - 1;
|
||||
}
|
||||
|
||||
|
||||
// Declare the OpenZWave namespace
|
||||
namespace std {}
|
||||
namespace OpenZWave
|
||||
|
|
|
@ -894,7 +894,7 @@ void Driver::RetryQueryStageComplete
|
|||
|
||||
m_sendMutex->Lock();
|
||||
|
||||
for( list<MsgQueueItem>::iterator it = m_msgQueue[MsgQueue_Query].begin(); it != m_msgQueue[MsgQueue_Query].end(); it++ )
|
||||
for( list<MsgQueueItem>::iterator it = m_msgQueue[MsgQueue_Query].begin(); it != m_msgQueue[MsgQueue_Query].end(); ++it )
|
||||
{
|
||||
if( *it == item )
|
||||
{
|
||||
|
@ -1069,7 +1069,7 @@ bool Driver::WriteNextMsg
|
|||
//-----------------------------------------------------------------------------
|
||||
bool Driver::WriteMsg
|
||||
(
|
||||
string const msg
|
||||
string const &msg
|
||||
)
|
||||
{
|
||||
if( !m_currentMsg )
|
||||
|
@ -3264,6 +3264,10 @@ void Driver::HandleApplicationCommandHandlerRequest
|
|||
{
|
||||
node->m_receivedUnsolicited++;
|
||||
}
|
||||
if ( !node->IsNodeAlive() )
|
||||
{
|
||||
node->SetNodeAlive( true );
|
||||
}
|
||||
}
|
||||
if( ApplicationStatus::StaticGetCommandClassId() == classId )
|
||||
{
|
||||
|
@ -3661,7 +3665,7 @@ void Driver::CommonAddNodeStatusRequestHandler
|
|||
//-----------------------------------------------------------------------------
|
||||
bool Driver::EnablePoll
|
||||
(
|
||||
ValueID const _valueId,
|
||||
ValueID const &_valueId,
|
||||
uint8 const _intensity
|
||||
)
|
||||
{
|
||||
|
@ -3714,11 +3718,15 @@ bool Driver::EnablePoll
|
|||
|
||||
// allow the poll thread to continue
|
||||
m_pollMutex->Unlock();
|
||||
ReleaseNodes();
|
||||
|
||||
Log::Write( LogLevel_Info, nodeId, "EnablePoll failed - value not found for node %d", nodeId );
|
||||
return false;
|
||||
}
|
||||
|
||||
// allow the poll thread to continue
|
||||
m_pollMutex->Unlock();
|
||||
|
||||
Log::Write( LogLevel_Info, "EnablePoll failed - node %d not found", nodeId );
|
||||
return false;
|
||||
}
|
||||
|
@ -3729,7 +3737,7 @@ bool Driver::EnablePoll
|
|||
//-----------------------------------------------------------------------------
|
||||
bool Driver::DisablePoll
|
||||
(
|
||||
ValueID const _valueId
|
||||
ValueID const &_valueId
|
||||
)
|
||||
{
|
||||
// make sure the polling thread doesn't lock the node while we're in this function
|
||||
|
@ -3786,7 +3794,7 @@ bool Driver::DisablePoll
|
|||
//-----------------------------------------------------------------------------
|
||||
bool Driver::isPolled
|
||||
(
|
||||
ValueID const _valueId
|
||||
ValueID const &_valueId
|
||||
)
|
||||
{
|
||||
bool bPolled;
|
||||
|
@ -3862,7 +3870,7 @@ bool Driver::isPolled
|
|||
//-----------------------------------------------------------------------------
|
||||
void Driver::SetPollIntensity
|
||||
(
|
||||
ValueID const _valueId,
|
||||
ValueID const &_valueId,
|
||||
uint8 const _intensity
|
||||
)
|
||||
{
|
||||
|
@ -4921,7 +4929,7 @@ void Driver::DoControllerCommand
|
|||
continue;
|
||||
|
||||
map<uint8,uint8>::iterator it = node->m_buttonMap.begin();
|
||||
for( ; it != node->m_buttonMap.end(); it++ )
|
||||
for( ; it != node->m_buttonMap.end(); ++it )
|
||||
{
|
||||
// is virtual node already in map?
|
||||
if( it->second == n )
|
||||
|
@ -5965,7 +5973,7 @@ void Driver::HandleApplicationSlaveCommandRequest
|
|||
if( node != NULL && _data[5] == 3 && _data[6] == 0x20 && _data[7] == 0x01 ) // only support Basic Set for now
|
||||
{
|
||||
map<uint8,uint8>::iterator it = node->m_buttonMap.begin();
|
||||
for( ; it != node->m_buttonMap.end(); it++ )
|
||||
for( ; it != node->m_buttonMap.end(); ++it )
|
||||
{
|
||||
if( it->second == _data[3] )
|
||||
break;
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace OpenZWave
|
|||
/** \brief The Driver class handles communication between OpenZWave
|
||||
* and a device attached via a serial port (typically a controller).
|
||||
*/
|
||||
class Driver
|
||||
class OPENZWAVE_EXPORT Driver
|
||||
{
|
||||
friend class Manager;
|
||||
friend class Node;
|
||||
|
@ -345,10 +345,10 @@ namespace OpenZWave
|
|||
private:
|
||||
int32 GetPollInterval(){ return m_pollInterval ; }
|
||||
void SetPollInterval( int32 _milliseconds, bool _bIntervalBetweenPolls ){ m_pollInterval = _milliseconds; m_bIntervalBetweenPolls = _bIntervalBetweenPolls; }
|
||||
bool EnablePoll( ValueID _valueId, uint8 _intensity = 1 );
|
||||
bool DisablePoll( ValueID _valueId );
|
||||
bool isPolled( ValueID _valueId );
|
||||
void SetPollIntensity( ValueID _valueId, uint8 _intensity );
|
||||
bool EnablePoll( const ValueID &_valueId, uint8 _intensity = 1 );
|
||||
bool DisablePoll( const ValueID &_valueId );
|
||||
bool isPolled( const ValueID &_valueId );
|
||||
void SetPollIntensity( const ValueID &_valueId, uint8 _intensity );
|
||||
static void PollThreadEntryPoint( Event* _exitEvent, void* _context );
|
||||
void PollThreadProc( Event* _exitEvent );
|
||||
|
||||
|
@ -358,7 +358,9 @@ namespace OpenZWave
|
|||
ValueID m_id;
|
||||
uint8 m_pollCounter;
|
||||
};
|
||||
OPENZWAVE_EXPORT_WARNINGS_OFF
|
||||
list<PollEntry> m_pollList; // List of nodes that need to be polled
|
||||
OPENZWAVE_EXPORT_WARNINGS_ON
|
||||
Mutex* m_pollMutex; // Serialize access to the polling list
|
||||
int32 m_pollInterval; // Time interval during which all nodes must be polled
|
||||
bool m_bIntervalBetweenPolls; // if true, the library intersperses m_pollInterval between polls; if false, the library attempts to complete all polls within m_pollInterval
|
||||
|
@ -615,7 +617,7 @@ namespace OpenZWave
|
|||
* RemoveNodeQuery, Node::AllQueriesCompleted
|
||||
*/
|
||||
bool WriteNextMsg( MsgQueue const _queue ); // Extracts the first message from the queue, and makes it the current one.
|
||||
bool WriteMsg( string const str); // Sends the current message to the Z-Wave network
|
||||
bool WriteMsg( string const &str); // Sends the current message to the Z-Wave network
|
||||
void RemoveCurrentMsg(); // Deletes the current message and cleans up the callback etc states
|
||||
bool MoveMessagesToWakeUpQueue( uint8 const _targetNodeId, bool const _move ); // If a node does not respond, and is of a type that can sleep, this method is used to move all its pending messages to another queue ready for when it mext wakes up.
|
||||
bool HandleErrorResponse( uint8 const _error, uint8 const _nodeId, char const* _funcStr, bool _sleepCheck = false ); // Handle data errors and process consistently. If message is moved to wake-up queue, return true.
|
||||
|
@ -700,7 +702,9 @@ namespace OpenZWave
|
|||
ControllerCommandItem* m_cci;
|
||||
};
|
||||
|
||||
OPENZWAVE_EXPORT_WARNINGS_OFF
|
||||
list<MsgQueueItem> m_msgQueue[MsgQueue_Count];
|
||||
OPENZWAVE_EXPORT_WARNINGS_ON
|
||||
Event* m_queueEvent[MsgQueue_Count]; // Events for each queue, which are signalled when the queue is not empty
|
||||
Mutex* m_sendMutex; // Serialize access to the queues
|
||||
Msg* m_currentMsg;
|
||||
|
@ -768,7 +772,9 @@ namespace OpenZWave
|
|||
void QueueNotification( Notification* _notification ); // Adds a notification to the list. Notifications are queued until a point in the thread where we know we do not have any nodes locked.
|
||||
void NotifyWatchers(); // Passes the notifications to all the registered watcher callbacks in turn.
|
||||
|
||||
OPENZWAVE_EXPORT_WARNINGS_OFF
|
||||
list<Notification*> m_notifications;
|
||||
OPENZWAVE_EXPORT_WARNINGS_ON
|
||||
Event* m_notificationsEvent;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <locale.h>
|
||||
#include <sstream>
|
||||
|
||||
#include "Defs.h"
|
||||
#include "Manager.h"
|
||||
|
@ -60,7 +60,9 @@
|
|||
using namespace OpenZWave;
|
||||
|
||||
Manager* Manager::s_instance = NULL;
|
||||
|
||||
extern uint16_t ozw_vers_major;
|
||||
extern uint16_t ozw_vers_minor;
|
||||
extern uint16_t ozw_vers_revision;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Construction
|
||||
|
@ -102,6 +104,23 @@ void Manager::Destroy
|
|||
s_instance = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <Manager::getVersion>
|
||||
// Static method to get the Version of OZW as a string.
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string Manager::getVersionAsString() {
|
||||
std::ostringstream versionstream;
|
||||
versionstream << ozw_vers_major << "." << ozw_vers_minor << "." << ozw_vers_revision;
|
||||
return versionstream.str();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
// <Manager::getVersion>
|
||||
// Static method to get the Version of OZW.
|
||||
//-----------------------------------------------------------------------------
|
||||
ozwversion Manager::getVersion() {
|
||||
return version(ozw_vers_major, ozw_vers_minor);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <Manager::Manager>
|
||||
// Constructor
|
||||
|
@ -111,9 +130,6 @@ Manager::Manager
|
|||
):
|
||||
m_notificationMutex( new Mutex() )
|
||||
{
|
||||
// Set the locale
|
||||
::setlocale( LC_ALL, "" );
|
||||
|
||||
// Ensure the singleton instance is set
|
||||
s_instance = this;
|
||||
|
||||
|
@ -606,7 +622,7 @@ void Manager::SetPollInterval
|
|||
//-----------------------------------------------------------------------------
|
||||
bool Manager::EnablePoll
|
||||
(
|
||||
ValueID const _valueId,
|
||||
ValueID const &_valueId,
|
||||
uint8 const _intensity
|
||||
)
|
||||
{
|
||||
|
@ -625,7 +641,7 @@ bool Manager::EnablePoll
|
|||
//-----------------------------------------------------------------------------
|
||||
bool Manager::DisablePoll
|
||||
(
|
||||
ValueID const _valueId
|
||||
ValueID const &_valueId
|
||||
)
|
||||
{
|
||||
if( Driver* driver = GetDriver( _valueId.GetHomeId() ) )
|
||||
|
@ -643,7 +659,7 @@ bool Manager::DisablePoll
|
|||
//-----------------------------------------------------------------------------
|
||||
bool Manager::isPolled
|
||||
(
|
||||
ValueID const _valueId
|
||||
ValueID const &_valueId
|
||||
)
|
||||
{
|
||||
if( Driver* driver = GetDriver( _valueId.GetHomeId() ) )
|
||||
|
@ -661,7 +677,7 @@ bool Manager::isPolled
|
|||
//-----------------------------------------------------------------------------
|
||||
void Manager::SetPollIntensity
|
||||
(
|
||||
ValueID const _valueId,
|
||||
ValueID const &_valueId,
|
||||
uint8 const _intensity
|
||||
)
|
||||
{
|
||||
|
@ -673,6 +689,29 @@ void Manager::SetPollIntensity
|
|||
Log::Write( LogLevel_Error, "mgr, SetPollIntensity failed - Driver with Home ID 0x%.8x is not available", _valueId.GetHomeId() );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <Manager::GetPollIntensity>
|
||||
// Change the intensity with which this value is polled
|
||||
//-----------------------------------------------------------------------------
|
||||
uint8 Manager::GetPollIntensity
|
||||
(
|
||||
ValueID const &_valueId
|
||||
)
|
||||
{
|
||||
uint8 intensity = 0;
|
||||
if( Driver* driver = GetDriver( _valueId.GetHomeId() ) )
|
||||
{
|
||||
driver->LockNodes();
|
||||
if( Value* value = driver->GetValue( _valueId ) )
|
||||
{
|
||||
intensity = value->GetPollIntensity();
|
||||
value->Release();
|
||||
}
|
||||
driver->ReleaseNodes();
|
||||
}
|
||||
|
||||
return intensity;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Retrieving Node information
|
||||
|
@ -1974,7 +2013,7 @@ bool Manager::GetValueAsString
|
|||
{
|
||||
if( ValueRaw* value = static_cast<ValueRaw*>( driver->GetValue( _id ) ) )
|
||||
{
|
||||
*o_value = value->GetAsString().c_str();
|
||||
*o_value = value->GetAsString();
|
||||
value->Release();
|
||||
res = true;
|
||||
}
|
||||
|
@ -3059,6 +3098,7 @@ bool Manager::RemoveWatcher
|
|||
m_notificationMutex->Unlock();
|
||||
return true;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
|
||||
m_notificationMutex->Unlock();
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace OpenZWave
|
|||
* on/off state) to be available. Finally, after all nodes (whether listening or
|
||||
* sleeping) have been polled, an "AllNodesQueried" notification is sent.]
|
||||
*/
|
||||
class Manager
|
||||
class OPENZWAVE_EXPORT Manager
|
||||
{
|
||||
friend class Driver;
|
||||
friend class CommandClass;
|
||||
|
@ -151,6 +151,18 @@ namespace OpenZWave
|
|||
* \see Create, Get
|
||||
*/
|
||||
static void Destroy();
|
||||
|
||||
/**
|
||||
* \brief Get the Version Number of OZW as a string
|
||||
* \return a String representing the version number as MAJOR.MINOR.REVISION
|
||||
*/
|
||||
static std::string getVersionAsString();
|
||||
|
||||
/**
|
||||
* \brief Get the Version Number as the Version Struct (Only Major/Minor returned)
|
||||
* \return the version struct representing the version
|
||||
*/
|
||||
static ozwversion getVersion();
|
||||
/*@}*/
|
||||
|
||||
private:
|
||||
|
@ -328,8 +340,10 @@ namespace OpenZWave
|
|||
Driver* GetDriver( uint32 const _homeId ); /**< Get a pointer to a Driver object from the HomeID. Only to be used by OpenZWave. */
|
||||
void SetDriverReady( Driver* _driver, bool success ); /**< Indicate that the Driver is ready to be used, and send the notification callback. */
|
||||
|
||||
OPENZWAVE_EXPORT_WARNINGS_OFF
|
||||
list<Driver*> m_pendingDrivers; /**< Drivers that are in the process of reading saved data and querying their Z-Wave network for basic information. */
|
||||
map<uint32,Driver*> m_readyDrivers; /**< Drivers that are ready to be used by the application. */
|
||||
OPENZWAVE_EXPORT_WARNINGS_ON
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Polling Z-Wave devices
|
||||
|
@ -364,27 +378,35 @@ namespace OpenZWave
|
|||
* \param _valueId The ID of the value to start polling.
|
||||
* \return True if polling was enabled.
|
||||
*/
|
||||
bool EnablePoll( ValueID const _valueId, uint8 const _intensity = 1 );
|
||||
bool EnablePoll( ValueID const &_valueId, uint8 const _intensity = 1 );
|
||||
|
||||
/**
|
||||
* \brief Disable the polling of a device's state.
|
||||
* \param _valueId The ID of the value to stop polling.
|
||||
* \return True if polling was disabled.
|
||||
*/
|
||||
bool DisablePoll( ValueID const _valueId );
|
||||
bool DisablePoll( ValueID const &_valueId );
|
||||
|
||||
/**
|
||||
* \brief Determine the polling of a device's state.
|
||||
* \param _valueId The ID of the value to check polling.
|
||||
* \return True if polling is active.
|
||||
*/
|
||||
bool isPolled( ValueID const _valueId );
|
||||
bool isPolled( ValueID const &_valueId );
|
||||
|
||||
/**
|
||||
* \brief Set the frequency of polling (0=none, 1=every time through the list, 2-every other time, etc)
|
||||
* \param _valueId The ID of the value whose intensity should be set
|
||||
*/
|
||||
void SetPollIntensity( ValueID const _valueId, uint8 const _intensity );
|
||||
void SetPollIntensity( ValueID const &_valueId, uint8 const _intensity );
|
||||
|
||||
/**
|
||||
* \brief Get the polling intensity of a device's state.
|
||||
* \param _valueId The ID of the value to check polling.
|
||||
* \return Intensity, number of polling for one polling interval.
|
||||
*/
|
||||
uint8 GetPollIntensity( ValueID const &_valueId );
|
||||
|
||||
/*@}*/
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1397,7 +1419,9 @@ namespace OpenZWave
|
|||
}
|
||||
};
|
||||
|
||||
OPENZWAVE_EXPORT_WARNINGS_OFF
|
||||
list<Watcher*> m_watchers; // List of all the registered watchers.
|
||||
OPENZWAVE_EXPORT_WARNINGS_ON
|
||||
Mutex* m_notificationMutex;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenZWave
|
|||
|
||||
/** \brief Message object to be passed to and from devices on the Z-Wave network.
|
||||
*/
|
||||
class Msg
|
||||
class OPENZWAVE_EXPORT Msg
|
||||
{
|
||||
public:
|
||||
enum MessageFlags
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenZWave
|
|||
* A notification object is only ever created or deleted internally by
|
||||
* OpenZWave.
|
||||
*/
|
||||
class Notification
|
||||
class OPENZWAVE_EXPORT Notification
|
||||
{
|
||||
friend class Manager;
|
||||
friend class Driver;
|
||||
|
|
|
@ -70,9 +70,26 @@ Options* Options::Create
|
|||
if( !FileOps::FolderExists( configPath ) )
|
||||
{
|
||||
Log::Create( "", false, true, LogLevel_Debug, LogLevel_Debug, LogLevel_None );
|
||||
/* Try some default directories */
|
||||
if ( FileOps::FolderExists( "config/" ) )
|
||||
{
|
||||
Log::Write( LogLevel_Error, "Cannot find a path to the configuration files at %s, Using config/ instead...", configPath.c_str() );
|
||||
configPath = "config/";
|
||||
} else if (FileOps::FolderExists("/etc/openzwave/" ) )
|
||||
{
|
||||
Log::Write( LogLevel_Error, "Cannot find a path to the configuration files at %s, Using /etc/openzwave/ instead...", configPath.c_str() );
|
||||
configPath = "/etc/openzwave/";
|
||||
#ifdef SYSCONFDIR
|
||||
} else if ( FileOps::FolderExists(SYSCONFDIR ) )
|
||||
{
|
||||
Log::Write( LogLevel_Error, "Cannot find a path to the configuration files at %s, Using %s instead...", configPath.c_str(), SYSCONFDIR);
|
||||
configPath = SYSCONFDIR;
|
||||
#endif
|
||||
} else {
|
||||
Log::Write( LogLevel_Error, "Cannot find a path to the configuration files at %s. Exiting...", configPath.c_str() );
|
||||
exit( 1 );
|
||||
}
|
||||
}
|
||||
FileOps::Destroy();
|
||||
s_instance = new Options( configPath, userPath, _commandLine );
|
||||
|
||||
|
@ -173,6 +190,8 @@ bool Options::AddOptionBool
|
|||
// get (or create) option
|
||||
Option* option = AddOption( _name );
|
||||
|
||||
if (option == NULL) return false;
|
||||
|
||||
// set unique option members
|
||||
option->m_type = Options::OptionType_Bool;
|
||||
option->m_valueBool = _value;
|
||||
|
@ -196,6 +215,8 @@ bool Options::AddOptionInt
|
|||
// get (or create) option
|
||||
Option* option = AddOption( _name );
|
||||
|
||||
if (option == NULL) return false;
|
||||
|
||||
// set unique option members
|
||||
option->m_type = Options::OptionType_Int;
|
||||
option->m_valueInt = _value;
|
||||
|
@ -220,6 +241,8 @@ bool Options::AddOptionString
|
|||
// get (or create) option
|
||||
Option* option = AddOption( _name );
|
||||
|
||||
if (option == NULL) return false;
|
||||
|
||||
// set unique option members
|
||||
option->m_type = Options::OptionType_String;
|
||||
option->m_valueString = _value;
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace OpenZWave
|
|||
* so that no more calls aside from GetOptionAs may be made.
|
||||
* 4) Create the OpenZWave Manager object.
|
||||
*/
|
||||
class Options
|
||||
class OPENZWAVE_EXPORT Options
|
||||
{
|
||||
public:
|
||||
enum OptionType
|
||||
|
@ -239,7 +239,9 @@ namespace OpenZWave
|
|||
Option* AddOption( string const& _name ); // check lock and create (or open existing) option
|
||||
Option* Find( string const& _name );
|
||||
|
||||
OPENZWAVE_EXPORT_WARNINGS_OFF
|
||||
map<string,Option*> m_options; // Map of option names to values.
|
||||
OPENZWAVE_EXPORT_WARNINGS_ON
|
||||
string m_xml; // Path to XML options file.
|
||||
string m_commandLine; // String containing command line options.
|
||||
bool m_locked; // If true, the options are final and AddOption can no longer be called.
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace OpenZWave
|
|||
static uint8 GetAllScenes( uint8** _sceneIds );
|
||||
|
||||
string const& GetLabel()const{ return m_label; }
|
||||
void SetLabel( string const _label ){ m_label = _label; }
|
||||
void SetLabel( string const &_label ){ m_label = _label; }
|
||||
|
||||
bool AddValue( ValueID const& _valueId, string const& _value );
|
||||
bool RemoveValue( ValueID const& _valueId );
|
||||
|
|
|
@ -91,6 +91,8 @@ bool Alarm::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "AlarmCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -167,7 +167,6 @@ bool Association::RequestValue
|
|||
// This command class doesn't work with multiple instances
|
||||
return false;
|
||||
}
|
||||
|
||||
// Request the supported group info
|
||||
Msg* msg = new Msg( "Get Association Groupings", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -326,6 +325,8 @@ void Association::QueryGroup
|
|||
uint32 const _requestFlags
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Get Associations for group %d of node %d", _groupIdx, GetNodeId() );
|
||||
Msg* msg = new Msg( "Get Associations", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -335,8 +336,12 @@ void Association::QueryGroup
|
|||
msg->Append( _groupIdx );
|
||||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, Driver::MsgQueue_Send );
|
||||
return;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "AssociationCmd_Get Not Supported on this node");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <Association::Set>
|
||||
// Add an association between devices
|
||||
|
|
|
@ -115,6 +115,8 @@ void AssociationCommandConfiguration::RequestCommands
|
|||
uint8 const _nodeId
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "AssociationCommandConfigurationCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 4 );
|
||||
|
@ -124,8 +126,10 @@ void AssociationCommandConfiguration::RequestCommands
|
|||
msg->Append( _nodeId );
|
||||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, Driver::MsgQueue_Send );
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "AssociationCommandConfigurationCmd_Get Not Supported on this node");
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <AssociationCommandConfiguration::HandleMsg>
|
||||
// Handle a message from the Z-Wave network
|
||||
|
|
|
@ -155,6 +155,8 @@ bool Basic::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "BasicCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -164,6 +166,10 @@ bool Basic::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "BasicCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -79,7 +79,8 @@ bool Battery::RequestValue
|
|||
// This command class doesn't work with multiple instances
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "BatteryCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -88,6 +89,10 @@ bool Battery::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "BatteryCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -95,6 +95,8 @@ bool Clock::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "ClockCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -104,6 +106,10 @@ bool Clock::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "ClockCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -408,7 +408,7 @@ string CommandClass::ExtractValue
|
|||
if( precision == 0 )
|
||||
{
|
||||
// The precision is zero, so we can just print the number directly into the string.
|
||||
snprintf( numBuf, 12, "%d", (signed long)value );
|
||||
snprintf( numBuf, 12, "%d", (signed int)value );
|
||||
res = numBuf;
|
||||
}
|
||||
else
|
||||
|
@ -416,7 +416,7 @@ string CommandClass::ExtractValue
|
|||
// We'll need to insert a decimal point and include any necessary leading zeros.
|
||||
|
||||
// Fill the buffer with the value padded with leading zeros.
|
||||
snprintf( numBuf, 12, "%011d", (signed long)value );
|
||||
snprintf( numBuf, 12, "%011d", (signed int)value );
|
||||
|
||||
// Calculate the position of the decimal point in the buffer
|
||||
int32 decimal = 10-precision;
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace OpenZWave
|
|||
|
||||
/** \brief Base class for all Z-Wave command classes.
|
||||
*/
|
||||
class CommandClass
|
||||
class OPENZWAVE_EXPORT CommandClass
|
||||
{
|
||||
|
||||
public:
|
||||
|
@ -91,7 +91,7 @@ namespace OpenZWave
|
|||
}
|
||||
uint8 GetInstance( uint8 const _endPoint )
|
||||
{
|
||||
for( map<uint8,uint8>::iterator it = m_endPointMap.begin(); it != m_endPointMap.end(); it++ )
|
||||
for( map<uint8,uint8>::iterator it = m_endPointMap.begin(); it != m_endPointMap.end(); ++it )
|
||||
{
|
||||
if( _endPoint == it->second )
|
||||
{
|
||||
|
@ -136,7 +136,9 @@ namespace OpenZWave
|
|||
uint8 m_nodeId;
|
||||
uint8 m_version;
|
||||
Bitfield m_instances;
|
||||
OPENZWAVE_EXPORT_WARNINGS_OFF
|
||||
map<uint8,uint8> m_endPointMap;
|
||||
OPENZWAVE_EXPORT_WARNINGS_ON
|
||||
bool m_afterMark; // Set to true if the command class is listed after COMMAND_CLASS_MARK, and should not create any values.
|
||||
bool m_createVars; // Do we want to create variables
|
||||
int8 m_overridePrecision; // Override precision when writing values if >=0
|
||||
|
|
|
@ -226,7 +226,8 @@ bool Configuration::RequestValue
|
|||
// This command class doesn't work with multiple instances
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "ConfigurationCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 3 );
|
||||
|
@ -236,8 +237,11 @@ bool Configuration::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "ConfigurationCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <Configuration::Set>
|
||||
// Set the device's
|
||||
|
|
|
@ -95,6 +95,8 @@ bool EnergyProduction::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Requesting the %s value", c_energyParameterNames[_valueEnum] );
|
||||
Msg* msg = new Msg( "EnergyProductionCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
|
@ -106,8 +108,11 @@ bool EnergyProduction::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "EnergyProductionCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <EnergyProduction::HandleMsg>
|
||||
// Handle a message from the Z-Wave network
|
||||
|
|
|
@ -75,6 +75,8 @@ bool Indicator::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "IndicatorCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -84,8 +86,13 @@ bool Indicator::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "IndicatorCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <Indicator::HandleMsg>
|
||||
// Handle a message from the Z-Wave network
|
||||
|
|
|
@ -86,7 +86,8 @@ bool Language::RequestValue
|
|||
// This command class doesn't work with multiple instances
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "LanguageCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -95,6 +96,10 @@ bool Language::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "LanguageCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -75,6 +75,8 @@ bool Lock::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "LockCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -84,8 +86,13 @@ bool Lock::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "LockCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// <Lock::HandleMsg>
|
||||
// Handle a message from the Z-Wave network
|
||||
|
|
|
@ -89,7 +89,8 @@ bool ManufacturerSpecific::RequestValue
|
|||
// This command class doesn't work with multiple instances
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "ManufacturerSpecificCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -98,6 +99,10 @@ bool ManufacturerSpecific::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "ManufacturerSpecificCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
string ManufacturerSpecific::SetProductDetails
|
||||
|
|
|
@ -132,8 +132,7 @@ Meter::Meter
|
|||
uint32 const _homeId,
|
||||
uint8 const _nodeId
|
||||
):
|
||||
CommandClass( _homeId, _nodeId ),
|
||||
m_scale( 0 )
|
||||
CommandClass( _homeId, _nodeId )
|
||||
{
|
||||
SetStaticRequest( StaticRequest_Values );
|
||||
}
|
||||
|
@ -187,6 +186,11 @@ bool Meter::RequestValue
|
|||
)
|
||||
{
|
||||
bool res = false;
|
||||
if ( !IsGetSupported())
|
||||
{
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "MeterCmd_Get Not Supported on this node");
|
||||
return false;
|
||||
}
|
||||
for( uint8 i=0; i<8; ++i )
|
||||
{
|
||||
uint8 baseIndex = i<<2;
|
||||
|
@ -252,8 +256,6 @@ bool Meter::HandleSupportedReport
|
|||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
string msg;
|
||||
string valueLabel;
|
||||
|
||||
msg = c_meterTypes[meterType];
|
||||
msg += ": ";
|
||||
// Create the list of supported scales
|
||||
|
|
|
@ -63,7 +63,6 @@ namespace OpenZWave
|
|||
bool HandleSupportedReport( uint8 const* _data, uint32 const _length, uint32 const _instance = 1 );
|
||||
bool HandleReport( uint8 const* _data, uint32 const _length, uint32 const _instance = 1 );
|
||||
|
||||
uint32 m_scale;
|
||||
};
|
||||
|
||||
} // namespace OpenZWave
|
||||
|
|
|
@ -74,6 +74,8 @@ bool MeterPulse::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "MeterPulseCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -83,6 +85,10 @@ bool MeterPulse::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "MeterPulseCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -400,10 +400,19 @@ void MultiInstance::HandleMultiChannelCapabilityReport
|
|||
uint32 const _length
|
||||
)
|
||||
{
|
||||
|
||||
bool dynamic = ((_data[1] & 0x80)!=0);
|
||||
/* if you having problems with Dynamic Devices not correctly
|
||||
* updating the commandclasses, see this email thread:
|
||||
* https://groups.google.com/d/topic/openzwave/IwepxScRAVo/discussion
|
||||
*/
|
||||
if (!dynamic && m_endPointCommandClasses.size() > 0)
|
||||
return;
|
||||
|
||||
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
uint8 endPoint = _data[1] & 0x7f;
|
||||
bool dynamic = ((_data[1] & 0x80)!=0);
|
||||
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Received MultiChannelCapabilityReport from node %d for endpoint %d", GetNodeId(), endPoint );
|
||||
Log::Write( LogLevel_Info, GetNodeId(), " Endpoint is%sdynamic, and is a %s", dynamic ? " " : " not ", node->GetEndPointDeviceClassLabel( _data[2], _data[3] ).c_str() );
|
||||
|
|
|
@ -247,6 +247,8 @@ bool NodeNaming::RequestValue
|
|||
|
||||
Msg* msg;
|
||||
if( _getTypeEnum == NodeNamingCmd_Get )
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
msg = new Msg( "NodeNamingCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -256,6 +258,10 @@ bool NodeNaming::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "NodeNamingCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if( _getTypeEnum == NodeNamingCmd_LocationGet )
|
||||
|
|
|
@ -119,6 +119,8 @@ bool Powerlevel::RequestValue
|
|||
)
|
||||
{
|
||||
if( _index == 0 )
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "Powerlevel_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
|
@ -129,6 +131,9 @@ bool Powerlevel::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Powerlevel_Get Not Supported on this node");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,8 @@ bool Protection::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "ProtectionCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -93,6 +95,10 @@ bool Protection::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "ProtectionCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -119,7 +119,7 @@ bool SensorAlarm::RequestValue
|
|||
if( _alarmType == 0xff )
|
||||
{
|
||||
// Request the supported alarm types
|
||||
Msg* msg = new Msg( "Request Supported Alarm Types", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
Msg* msg = new Msg( "SensorAlarmCmd_SupportedGet", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -127,11 +127,14 @@ bool SensorAlarm::RequestValue
|
|||
msg->Append( SensorAlarmCmd_SupportedGet );
|
||||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Request the alarm state
|
||||
Msg* msg = new Msg( "Request alarm state", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "SensorAlarmCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 3 );
|
||||
|
@ -140,8 +143,12 @@ bool SensorAlarm::RequestValue
|
|||
msg->Append( _alarmType );
|
||||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "SensorAlarmCmd_Get Not Supported on this node");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -75,6 +75,8 @@ bool SensorBinary::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "SensorBinaryCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -84,6 +86,10 @@ bool SensorBinary::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "SensorBinaryCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -213,6 +213,10 @@ bool SensorMultilevel::RequestValue
|
|||
)
|
||||
{
|
||||
bool res = false;
|
||||
if ( !IsGetSupported() ) {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "SensorMultilevelCmd_Get Not Supported on this node");
|
||||
return false;
|
||||
}
|
||||
if( GetVersion() < 5 )
|
||||
{
|
||||
Msg* msg = new Msg( "SensorMultilevelCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
|
|
|
@ -85,6 +85,8 @@ bool SwitchAll::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "SwitchAllCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -94,6 +96,10 @@ bool SwitchAll::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "SwitchAllCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -76,6 +76,8 @@ bool SwitchBinary::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "SwitchBinaryCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -85,6 +87,10 @@ bool SwitchBinary::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "SwitchBinaryCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -136,6 +136,8 @@ bool SwitchMultilevel::RequestValue
|
|||
)
|
||||
{
|
||||
if( _index == SwitchMultilevelIndex_Level )
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "SwitchMultilevelCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
|
@ -146,6 +148,9 @@ bool SwitchMultilevel::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "SwitchMultilevelCmd_Get Not Supported on this node");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -75,6 +75,8 @@ bool SwitchToggleBinary::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "SwitchToggleBinaryCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
|
@ -84,6 +86,10 @@ bool SwitchToggleBinary::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "SwitchToggleBinaryCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -78,7 +78,9 @@ bool SwitchToggleMultilevel::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
Msg* msg = new Msg( "SwitchToggleMultilevelCmd_StartLevelChange", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "SwitchToggleMultilevelCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -87,6 +89,10 @@ bool SwitchToggleMultilevel::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "SwitchToggleMultilevelCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -69,9 +69,8 @@ void ThermostatFanMode::ReadXML
|
|||
{
|
||||
CommandClass::ReadXML( _ccElement );
|
||||
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
if( GetNodeUnsafe() )
|
||||
{
|
||||
node = node;
|
||||
vector<ValueList::Item> supportedModes;
|
||||
|
||||
TiXmlElement const* supportedModesElement = _ccElement->FirstChildElement( "SupportedModes" );
|
||||
|
@ -117,9 +116,8 @@ void ThermostatFanMode::WriteXML
|
|||
{
|
||||
CommandClass::WriteXML( _ccElement );
|
||||
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
if( GetNodeUnsafe() )
|
||||
{
|
||||
node = node;
|
||||
TiXmlElement* supportedModesElement = new TiXmlElement( "SupportedModes" );
|
||||
_ccElement->LinkEndChild( supportedModesElement );
|
||||
|
||||
|
@ -180,7 +178,7 @@ bool ThermostatFanMode::RequestValue
|
|||
if( _getTypeEnum == ThermostatFanModeCmd_SupportedGet )
|
||||
{
|
||||
// Request the supported modes
|
||||
Msg* msg = new Msg( "Request Supported Thermostat Fan Modes", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
Msg* msg = new Msg( "ThermostatFanModeCmd_SupportedGet", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -192,9 +190,11 @@ bool ThermostatFanMode::RequestValue
|
|||
}
|
||||
|
||||
if( _getTypeEnum == ThermostatFanModeCmd_Get || _getTypeEnum == 0 )
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
// Request the current fan mode
|
||||
Msg* msg = new Msg( "Request Current Thermostat Fan Mode", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
Msg* msg = new Msg( "ThermostatFanModeCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -203,6 +203,9 @@ bool ThermostatFanMode::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "ThermostatFanModeCmd_Get Not Supported on this node");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -295,7 +298,7 @@ bool ThermostatFanMode::SetValue
|
|||
ValueList const* value = static_cast<ValueList const*>(&_value);
|
||||
uint8 state = (uint8)value->GetItem().m_value;
|
||||
|
||||
Msg* msg = new Msg( "Set Thermostat Fan Mode", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true );
|
||||
Msg* msg = new Msg( "ThermostatFanModeCmd_Set", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true );
|
||||
msg->SetInstance( this, _value.GetID().GetInstance() );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 3 );
|
||||
|
|
|
@ -94,8 +94,10 @@ bool ThermostatFanState::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
// Request the current state
|
||||
Msg* msg = new Msg( "Request Current Thermostat Fan State", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
Msg* msg = new Msg( "ThermostatFanStateCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -104,6 +106,10 @@ bool ThermostatFanState::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "ThermostatFanStateCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -75,9 +75,8 @@ void ThermostatMode::ReadXML
|
|||
{
|
||||
CommandClass::ReadXML( _ccElement );
|
||||
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
if( GetNodeUnsafe() )
|
||||
{
|
||||
node = node;
|
||||
vector<ValueList::Item> supportedModes;
|
||||
|
||||
TiXmlElement const* supportedModesElement = _ccElement->FirstChildElement( "SupportedModes" );
|
||||
|
@ -128,9 +127,8 @@ void ThermostatMode::WriteXML
|
|||
|
||||
CommandClass::WriteXML( _ccElement );
|
||||
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
if( GetNodeUnsafe() )
|
||||
{
|
||||
node = node;
|
||||
TiXmlElement* supportedModesElement = new TiXmlElement( "SupportedModes" );
|
||||
_ccElement->LinkEndChild( supportedModesElement );
|
||||
|
||||
|
@ -191,7 +189,7 @@ bool ThermostatMode::RequestValue
|
|||
if( _getTypeEnum == ThermostatModeCmd_SupportedGet )
|
||||
{
|
||||
// Request the supported modes
|
||||
Msg* msg = new Msg( "Request Supported Thermostat Modes", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
Msg* msg = new Msg( "ThermostatModeCmd_SupportedGet", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -203,9 +201,11 @@ bool ThermostatMode::RequestValue
|
|||
}
|
||||
|
||||
if( _getTypeEnum == 0 ) // get current mode
|
||||
{
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
// Request the current mode
|
||||
Msg* msg = new Msg( "Request Current Thermostat Mode", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
Msg* msg = new Msg( "ThermostatModeCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -214,6 +214,10 @@ bool ThermostatMode::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "ThermostatModeCmd_Get Not Supported on this node");
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -232,8 +236,18 @@ bool ThermostatMode::HandleMsg
|
|||
if( ThermostatModeCmd_Report == (ThermostatModeCmd)_data[0] )
|
||||
{
|
||||
uint8 mode = _data[1]&0x1f;
|
||||
bool validMode = false;
|
||||
for (vector<ValueList::Item>::iterator it = m_supportedModes.begin(); it != m_supportedModes.end(); ++it )
|
||||
{
|
||||
ValueList::Item const& item = *it;
|
||||
|
||||
if( mode < m_supportedModes.size() )
|
||||
if (item.m_value == mode) {
|
||||
validMode = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( validMode )
|
||||
{
|
||||
// We have received the thermostat mode from the Z-Wave device
|
||||
if( ValueList* valueList = static_cast<ValueList*>( GetValue( _instance, 0 ) ) )
|
||||
|
@ -308,7 +322,7 @@ bool ThermostatMode::SetValue
|
|||
ValueList const* value = static_cast<ValueList const*>(&_value);
|
||||
uint8 state = (uint8)value->GetItem().m_value;
|
||||
|
||||
Msg* msg = new Msg( "Set Thermostat Mode", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true );
|
||||
Msg* msg = new Msg( "ThermostatModeCmd_Set", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 3 );
|
||||
msg->Append( GetCommandClassId() );
|
||||
|
|
|
@ -93,7 +93,9 @@ bool ThermostatOperatingState::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
Msg* msg = new Msg( "Request Current Thermostat Operating State", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "ThermostatOperatingStateCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -102,6 +104,10 @@ bool ThermostatOperatingState::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "ThermostatOperatingStateCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -174,7 +174,7 @@ bool ThermostatSetpoint::RequestValue
|
|||
if( _setPointIndex == 0xff ) // check for supportedget
|
||||
{
|
||||
// Request the supported setpoints
|
||||
Msg* msg = new Msg( "Request Supported Thermostat Setpoints", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
Msg* msg = new Msg( "ThermostatSetpointCmd_SupportedGet", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -184,13 +184,17 @@ bool ThermostatSetpoint::RequestValue
|
|||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( !IsGetSupported() )
|
||||
{
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "ThermostatSetpointCmd_Get Not Supported on this node");
|
||||
return false;
|
||||
}
|
||||
Value* value = GetValue( 1, _setPointIndex );
|
||||
if( value != NULL )
|
||||
{
|
||||
value->Release();
|
||||
// Request the setpoint value
|
||||
Msg* msg = new Msg( "Request Current Thermostat Setpoint", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
Msg* msg = new Msg( "ThermostatSetpointCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 3 );
|
||||
|
|
|
@ -152,7 +152,11 @@ bool UserCode::RequestValue
|
|||
// This command class doesn't work with multiple instances
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !IsGetSupported() )
|
||||
{
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "UserNumberCmd_Get Not Supported on this node");
|
||||
return false;
|
||||
}
|
||||
if( _userCodeIdx == 0xff )
|
||||
{
|
||||
// Get number of supported user codes.
|
||||
|
|
|
@ -138,7 +138,8 @@ bool Version::RequestValue
|
|||
// This command class doesn't work with multiple instances
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( IsGetSupported() )
|
||||
{
|
||||
Msg* msg = new Msg( "VersionCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( 2 );
|
||||
|
@ -147,6 +148,10 @@ bool Version::RequestValue
|
|||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "VersionCmd_Get Not Supported on this node");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "Notification.h"
|
||||
#include "Mutex.h"
|
||||
#include "ValueInt.h"
|
||||
#include "Options.h"
|
||||
|
||||
using namespace OpenZWave;
|
||||
|
||||
|
@ -62,10 +63,12 @@ WakeUp::WakeUp
|
|||
):
|
||||
CommandClass( _homeId, _nodeId ),
|
||||
m_mutex( new Mutex() ),
|
||||
m_awake( true ),
|
||||
m_pollRequired( false ),
|
||||
m_notification( false )
|
||||
{
|
||||
m_awake = true;
|
||||
Options::Get()->GetOptionAsBool("AssumeAwake", &m_awake);
|
||||
|
||||
SetStaticRequest( StaticRequest_Values );
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ void FileOps::Destroy
|
|||
//-----------------------------------------------------------------------------
|
||||
bool FileOps::FolderExists
|
||||
(
|
||||
string _folderName
|
||||
const string &_folderName
|
||||
)
|
||||
{
|
||||
if( s_instance != NULL )
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace OpenZWave
|
|||
* \param string. Folder name.
|
||||
* \return Bool value indicating existance.
|
||||
*/
|
||||
static bool FolderExists( string _folderName );
|
||||
static bool FolderExists( const string &_folderName );
|
||||
|
||||
private:
|
||||
FileOps();
|
||||
|
|
|
@ -322,7 +322,7 @@ bool HidController::Init
|
|||
memset(serialHex, 0, serialLength + 1);
|
||||
for (size_t i = 0; i < serialLength; ++i)
|
||||
{
|
||||
snprintf(&serialHex[i], serialLength - i + 1, "%hx", hidInfoString[i] & 0x0f);
|
||||
snprintf(&serialHex[i], serialLength - i + 1, "%hx", (unsigned short)(hidInfoString[i] & 0x0f));
|
||||
}
|
||||
Log::Write( LogLevel_Info, " Serial #: %ls --> %s", hidInfoString, serialHex );
|
||||
delete [] serialHex;
|
||||
|
|
|
@ -268,7 +268,7 @@ void Log::QueueClear
|
|||
//-----------------------------------------------------------------------------
|
||||
void Log::SetLogFileName
|
||||
(
|
||||
string _filename
|
||||
const string &_filename
|
||||
)
|
||||
{
|
||||
if( s_instance && s_dologging && s_instance->m_pImpl )
|
||||
|
@ -294,6 +294,7 @@ Log::Log
|
|||
):
|
||||
m_logMutex( new Mutex() )
|
||||
{
|
||||
if (NULL == m_pImpl)
|
||||
m_pImpl = new LogImpl( _filename, _bAppend, _bConsoleOutput, _saveLevel, _queueLevel, _dumpTrigger );
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace OpenZWave
|
|||
virtual void QueueDump() = 0;
|
||||
virtual void QueueClear() = 0;
|
||||
virtual void SetLoggingState( LogLevel _saveLevel, LogLevel _queueLevel, LogLevel _dumpTrigger ) = 0;
|
||||
virtual void SetLogFileName( string _filename ) = 0;
|
||||
virtual void SetLogFileName( const string &_filename ) = 0;
|
||||
};
|
||||
|
||||
/** \brief Implements a platform-independent log...written to the console and, optionally, a file.
|
||||
|
@ -139,7 +139,7 @@ namespace OpenZWave
|
|||
* in the controlling application, to create timestamped log file names.
|
||||
* \param _filename Name of the new (or existing) file to use for log output.
|
||||
*/
|
||||
static void SetLogFileName( string _filename );
|
||||
static void SetLogFileName( const string &_filename );
|
||||
|
||||
/**
|
||||
* Write an entry to the log.
|
||||
|
|
|
@ -206,7 +206,7 @@ void Stream::LogData
|
|||
(
|
||||
uint8* _buffer,
|
||||
uint32 _length,
|
||||
string _function
|
||||
const string &_function
|
||||
)
|
||||
{
|
||||
if( !_length ) return;
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace OpenZWave
|
|||
* \param _size number of valid bytes currently in the buffer
|
||||
* \param _function string containing text to display before the data
|
||||
*/
|
||||
void LogData( uint8* _buffer, uint32 _size, string _function );
|
||||
void LogData( uint8* _buffer, uint32 _size, const string &_function );
|
||||
|
||||
/**
|
||||
* Used by the Wait class to test whether the buffer contains sufficient data.
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace OpenZWave
|
|||
|
||||
/** \brief Implements a platform-independent TimeStamp.
|
||||
*/
|
||||
class TimeStamp
|
||||
class OPENZWAVE_EXPORT TimeStamp
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <stdio.h>
|
||||
#include "Defs.h"
|
||||
#include "Wait.h"
|
||||
#include "WaitImpl.h" // Platform-specific implementation of a Wait object
|
||||
|
|
|
@ -89,7 +89,7 @@ void EventImpl::Set
|
|||
err = pthread_cond_broadcast( &m_condition );
|
||||
if( err != 0 )
|
||||
{
|
||||
fprintf(stderr, "EventImpl::Set cond broadcast error %d (%s)\n", errno, err );
|
||||
fprintf(stderr, "EventImpl::Set cond broadcast error %d (%d)\n", errno, err );
|
||||
assert( 0 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <pthread.h>
|
||||
#include "Defs.h"
|
||||
#include "LogImpl.h"
|
||||
|
||||
|
@ -248,7 +249,7 @@ string LogImpl::GetTimeStampString
|
|||
char buf[100];
|
||||
snprintf( buf, sizeof(buf), "%04d-%02d-%02d %02d:%02d:%02d.%03d ",
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec, tv.tv_usec / 1000 );
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec / 1000 );
|
||||
string str = buf;
|
||||
return str;
|
||||
}
|
||||
|
@ -288,7 +289,7 @@ string LogImpl::GetThreadId
|
|||
)
|
||||
{
|
||||
char buf[20];
|
||||
snprintf( buf, sizeof(buf), "%08x ", pthread_self() );
|
||||
snprintf( buf, sizeof(buf), "%08lx ", (long unsigned int)pthread_self() );
|
||||
string str = buf;
|
||||
return str;
|
||||
}
|
||||
|
@ -299,7 +300,7 @@ string LogImpl::GetThreadId
|
|||
//-----------------------------------------------------------------------------
|
||||
void LogImpl::SetLogFileName
|
||||
(
|
||||
string _filename
|
||||
const string &_filename
|
||||
)
|
||||
{
|
||||
m_filename = _filename;
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <list>
|
||||
#include "Log.h"
|
||||
|
||||
namespace OpenZWave
|
||||
|
@ -49,7 +50,7 @@ namespace OpenZWave
|
|||
void QueueDump();
|
||||
void QueueClear();
|
||||
void SetLoggingState( LogLevel _saveLevel, LogLevel _queueLevel, LogLevel _dumpTrigger );
|
||||
void SetLogFileName( string _filename );
|
||||
void SetLogFileName( const string &_filename );
|
||||
|
||||
string GetTimeStampString();
|
||||
string GetNodeString( uint8 const _nodeId );
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue