diff --git a/Makefile b/Makefile index a3c2625..ec73875 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,9 @@ RANLIB := ranlib # Change for DEBUG or RELEASE TARGET := DEBUG -DEBUG_CFLAGS := -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -Wall -Wno-format -g -DDEBUG -Werror -O0 -DDEBUG_BOOSTSTOMP +# TODO: Restore the -Werror flag after removing calls to the deprecated +# Manager::BeginControllerCommand method. +DEBUG_CFLAGS := -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -Wall -Wno-format -g -DDEBUG -O0 -DDEBUG_BOOSTSTOMP RELEASE_CFLAGS := -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -Wall -Wno-unknown-pragmas -Wno-format -O3 -DNDEBUG DEBUG_LDFLAGS := -g @@ -53,7 +55,7 @@ INCLUDES := -I $(OPENZWAVE_INC) -I $(OPENZWAVE_INC)/command_classes/ -I $(OPENZW #GNUTLS := -lgnutls LIBZWAVE_STATIC := $(OPENZWAVE_LIB)/libopenzwave.a -LIBZWAVE_DYNAMIC := $(OPENZWAVE_LIB)/libopenzwave.so.1.0 +LIBZWAVE_DYNAMIC := $(OPENZWAVE_LIB)/libopenzwave.so.1.3 LIBZWAVE := -lopenzwave LIBUSB := -ludev @@ -61,8 +63,8 @@ LIBUSB := -ludev #LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/mac/*.a) #LIBUSB := -framework IOKit -framework CoreFoundation -LIBBOOST := -lboost_thread-mt -lboost_program_options -lboost_system -lboost_filesystem -lpthread -LIBBOOST_STATIC := -lboost_thread-mt -lboost_program_options -lboost_system -lboost_filesystem +LIBBOOST := -lboost_thread -lboost_program_options -lboost_system -lboost_filesystem -lpthread +LIBBOOST_STATIC := -lboost_thread -lboost_program_options -lboost_system -lboost_filesystem LIBTHRIFT := -lthrift LIBBOOSTSTOMP := -lbooststomp LIBBOOSTSTOMP_STATIC := libbooststomp.a @@ -107,8 +109,7 @@ openzwave: cd $(OPENZWAVE); make openzwave-install: openzwave - cd $(OPENZWAVE)/cpp/lib/linux; cp libopenzwave.so libopenzwave.so.1.0 - cd $(OPENZWAVE); sudo make -f debian/Makefile install + cd $(OPENZWAVE); sudo make install booststomp: #cd $(BOOSTSTOMP); make diff --git a/RemoteManager_server.cpp.patch b/RemoteManager_server.cpp.patch new file mode 100644 index 0000000..05eed61 --- /dev/null +++ b/RemoteManager_server.cpp.patch @@ -0,0 +1,194 @@ +--- gen-cpp/RemoteManager_server.cpp.orig 2015-12-14 01:08:55.315767324 -0800 ++++ gen-cpp/RemoteManager_server.cpp 2015-12-14 01:16:56.983717848 -0800 +@@ -1,11 +1,11 @@ + // Automatically generated OpenZWave::Manager_server wrapper +-// (c) 2011 Elias Karakoulakis ++// (c) 2011-2012 Elias Karakoulakis + + #include "RemoteManager.h" +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include + + using namespace ::apache::thrift; + using namespace ::apache::thrift::protocol; +@@ -17,7 +17,17 @@ + using namespace ::OpenZWave; + + void BeginControllerCommand_callback(OpenZWave::Driver::ControllerState arg1, OpenZWave::Driver::ControllerError arg2, void* arg3) { +- // FIXME: fill in the blanks (sorry!) ++ g_criticalSection.lock(); ++ // ++ STOMP::hdrmap headers; ++ headers["ControllerState"] = to_string(arg1, std::hex); ++ if (arg2 != OpenZWave::Driver::ControllerError_None ) { ++ headers["ControllerError"] = to_string(arg2, std::hex); ++ } ++ string empty = "" ; ++ stomp_client->send(*notifications_topic, headers, empty); ++ // ++ g_criticalSection.unlock(); + } + + class RemoteManagerHandler : virtual public RemoteManagerIf { +@@ -283,10 +293,15 @@ + } + + void GetNodeNeighbors(UInt32_ListByte& _return, const int32_t _homeId, const int8_t _nodeId) { ++ uint8* arr; + Manager* mgr = Manager::Get(); + g_criticalSection.lock(); +- _return.retval = mgr->GetNodeNeighbors((::uint32 const) _homeId, (::uint8 const) _nodeId, (::uint8**) &_return._nodeNeighbors); ++ _return.retval = mgr->GetNodeNeighbors((::uint32 const) _homeId, (::uint8 const) _nodeId, (::uint8**) &arr); + g_criticalSection.unlock(); ++ if (_return.retval > 0) { ++ for (int i=0; i<_return.retval; i++) _return._nodeNeighbors.push_back(arr[i]); ++ delete arr; ++ } + } + + void GetNodeManufacturerName(std::string& _return, const int32_t _homeId, const int8_t _nodeId) { +@@ -571,11 +586,15 @@ + g_criticalSection.unlock(); + } + +- void GetValueListItems(Bool_ListString& _return, const RemoteValueID& _id) { ++ void GetValueListItems(Bool_ListString& _return, const RemoteValueID& _id) { ++ std::vector o_values; + Manager* mgr = Manager::Get(); + g_criticalSection.lock(); +- _return.retval = mgr->GetValueListItems(_id.toValueID(), (std::vector >*) &_return.o_value); ++ _return.retval = mgr->GetValueListItems(_id.toValueID(), &o_values); + g_criticalSection.unlock(); ++ if (_return.retval > 0) { ++ for (int i=0; i< _return.retval; i++) _return.o_value.push_back(std::string(o_values[i])); ++ } + } + + void GetValueFloatPrecision(Bool_UInt8& _return, const RemoteValueID& _id) { +@@ -604,7 +623,7 @@ + bool SetValue_UInt8_UInt8(const RemoteValueID& _id, const std::vector & _value, const int8_t _length) { + Manager* mgr = Manager::Get(); + g_criticalSection.lock(); +- bool function_result = mgr->SetValue(_id.toValueID(), (::uint8 const*) &_value, (::uint8 const) _length); ++ bool function_result = mgr->SetValue(_id.toValueID(), (const uint8*) _value.data(), _value.size()); + g_criticalSection.unlock(); + return(function_result); + } +@@ -658,10 +677,10 @@ + } + + void SetChangeVerified(const RemoteValueID& _id, const bool _verify) { +- Manager* mgr = Manager::Get(); +- g_criticalSection.lock(); +- mgr->SetChangeVerified(_id.toValueID(), (bool) _verify); +- g_criticalSection.unlock(); ++ Manager* mgr = Manager::Get(); ++ g_criticalSection.lock(); ++ mgr->SetChangeVerified(_id.toValueID(), (bool) _verify); ++ g_criticalSection.unlock(); + } + + bool PressButton(const RemoteValueID& _id) { +@@ -762,11 +781,16 @@ + return(function_result); + } + +- void GetAssociations_uint8(GetAssociationsReturnStruct& _return, const int32_t _homeId, const int8_t _nodeId, const int8_t _groupIdx) { ++ void GetAssociations(GetAssociationsReturnStruct& _return, const int32_t _homeId, const int8_t _nodeId, const int8_t _groupIdx) { ++ uint8* o_associations; + Manager* mgr = Manager::Get(); + g_criticalSection.lock(); +- _return.retval = mgr->GetAssociations((::uint32 const) _homeId, (::uint8 const) _nodeId, (::uint8 const) _groupIdx, (::uint8**) &_return.o_associations); ++ _return.retval = mgr->GetAssociations((::uint32 const) _homeId, (::uint8 const) _nodeId, (::uint8 const) _groupIdx, (::uint8**) &o_associations); + g_criticalSection.unlock(); ++ if (_return.retval > 0) { ++ for (int i=0; i<_return.retval; i++) _return.o_associations.push_back(o_associations[i]); ++ delete o_associations; ++ } + } + + int8_t GetMaxAssociations(const int32_t _homeId, const int8_t _nodeId, const int8_t _groupIdx) { +@@ -784,17 +808,17 @@ + g_criticalSection.unlock(); + } + +- void AddAssociation(const int32_t _homeId, const int8_t _nodeId, const int8_t _groupIdx, const int8_t _targetNodeId, const int8_t _instance) { ++ void AddAssociation(const int32_t _homeId, const int8_t _nodeId, const int8_t _groupIdx, const int8_t _targetNodeId) { + Manager* mgr = Manager::Get(); + g_criticalSection.lock(); +- mgr->AddAssociation((::uint32 const) _homeId, (::uint8 const) _nodeId, (::uint8 const) _groupIdx, (::uint8 const) _targetNodeId, (::uint8 const) _instance); ++ mgr->AddAssociation((::uint32 const) _homeId, (::uint8 const) _nodeId, (::uint8 const) _groupIdx, (::uint8 const) _targetNodeId); + g_criticalSection.unlock(); + } + +- void RemoveAssociation(const int32_t _homeId, const int8_t _nodeId, const int8_t _groupIdx, const int8_t _targetNodeId, const int8_t _instance) { ++ void RemoveAssociation(const int32_t _homeId, const int8_t _nodeId, const int8_t _groupIdx, const int8_t _targetNodeId) { + Manager* mgr = Manager::Get(); + g_criticalSection.lock(); +- mgr->RemoveAssociation((::uint32 const) _homeId, (::uint8 const) _nodeId, (::uint8 const) _groupIdx, (::uint8 const) _targetNodeId, (::uint8 const) _instance); ++ mgr->RemoveAssociation((::uint32 const) _homeId, (::uint8 const) _nodeId, (::uint8 const) _groupIdx, (::uint8 const) _targetNodeId); + g_criticalSection.unlock(); + } + +@@ -865,10 +889,15 @@ + } + + void GetAllScenes(GetAllScenesReturnStruct& _return) { ++ uint8* _sceneIds; + Manager* mgr = Manager::Get(); + g_criticalSection.lock(); +- _return.retval = mgr->GetAllScenes((::uint8**) &_return._sceneIds); ++ _return.retval = mgr->GetAllScenes((::uint8**) &_sceneIds); + g_criticalSection.unlock(); ++ if (_return.retval>0) { ++ for (int i=0; i<_return.retval; i++) _return._sceneIds.push_back(_sceneIds[i]); ++ delete(_sceneIds); ++ } + } + + void RemoveAllScenes(const int32_t _homeId) { +@@ -967,10 +996,12 @@ + } + + void SceneGetValues(SceneGetValuesReturnStruct& _return, const int8_t _sceneId) { ++ std::vector o_values; + Manager* mgr = Manager::Get(); + g_criticalSection.lock(); +- _return.retval = mgr->SceneGetValues((::uint8 const) _sceneId, _return.o_value.toValueID()); ++ _return.retval = mgr->SceneGetValues((::uint8 const) _sceneId, &o_values); + g_criticalSection.unlock(); ++ for (int i=0; i< _return.retval; i++) _return.o_value.push_back(RemoteValueID(o_values[i])); + } + + void SceneGetValueAsBool(Bool_Bool& _return, const int8_t _sceneId, const RemoteValueID& _valueId) { +@@ -1138,13 +1169,13 @@ + } + + void SendAllValues() { +- // Your implementation goes here +- printf("SendAllValues\n"); ++ g_criticalSection.lock(); ++ send_all_values(); ++ g_criticalSection.unlock(); + } + + void ping() { +- // Your implementation goes here +- printf("ping\n"); ++ // Dummy method to keep Thrift connection alive over NAT routers + } + + }; +@@ -1162,4 +1193,4 @@ + // return 0; + // } + // +-// +\ No newline at end of file ++// diff --git a/gen-js/RemoteManager.js b/gen-js/RemoteManager.js index 4741ecc..3b50a48 100644 --- a/gen-js/RemoteManager.js +++ b/gen-js/RemoteManager.js @@ -10913,7 +10913,7 @@ OpenZWave.RemoteManager_GetNumGroups_result.prototype.write = function(output) { return; }; -OpenZWave.RemoteManager_GetAssociations_args = function(args) { +OpenZWave.RemoteManager_GetAssociations_uint8_args = function(args) { this._homeId = null; this._nodeId = null; this._groupIdx = null; @@ -10929,8 +10929,8 @@ OpenZWave.RemoteManager_GetAssociations_args = function(args) { } } }; -OpenZWave.RemoteManager_GetAssociations_args.prototype = {}; -OpenZWave.RemoteManager_GetAssociations_args.prototype.read = function(input) { +OpenZWave.RemoteManager_GetAssociations_uint8_args.prototype = {}; +OpenZWave.RemoteManager_GetAssociations_uint8_args.prototype.read = function(input) { input.readStructBegin(); while (true) { @@ -10973,8 +10973,8 @@ OpenZWave.RemoteManager_GetAssociations_args.prototype.read = function(input) { return; }; -OpenZWave.RemoteManager_GetAssociations_args.prototype.write = function(output) { - output.writeStructBegin('RemoteManager_GetAssociations_args'); +OpenZWave.RemoteManager_GetAssociations_uint8_args.prototype.write = function(output) { + output.writeStructBegin('RemoteManager_GetAssociations_uint8_args'); if (this._homeId !== null && this._homeId !== undefined) { output.writeFieldBegin('_homeId', Thrift.Type.I32, 1); output.writeI32(this._homeId); @@ -10995,7 +10995,7 @@ OpenZWave.RemoteManager_GetAssociations_args.prototype.write = function(output) return; }; -OpenZWave.RemoteManager_GetAssociations_result = function(args) { +OpenZWave.RemoteManager_GetAssociations_uint8_result = function(args) { this.success = null; if (args) { if (args.success !== undefined) { @@ -11003,8 +11003,8 @@ OpenZWave.RemoteManager_GetAssociations_result = function(args) { } } }; -OpenZWave.RemoteManager_GetAssociations_result.prototype = {}; -OpenZWave.RemoteManager_GetAssociations_result.prototype.read = function(input) { +OpenZWave.RemoteManager_GetAssociations_uint8_result.prototype = {}; +OpenZWave.RemoteManager_GetAssociations_uint8_result.prototype.read = function(input) { input.readStructBegin(); while (true) { @@ -11037,8 +11037,8 @@ OpenZWave.RemoteManager_GetAssociations_result.prototype.read = function(input) return; }; -OpenZWave.RemoteManager_GetAssociations_result.prototype.write = function(output) { - output.writeStructBegin('RemoteManager_GetAssociations_result'); +OpenZWave.RemoteManager_GetAssociations_uint8_result.prototype.write = function(output) { + output.writeStructBegin('RemoteManager_GetAssociations_uint8_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); this.success.write(output); @@ -11324,6 +11324,7 @@ OpenZWave.RemoteManager_AddAssociation_args = function(args) { this._nodeId = null; this._groupIdx = null; this._targetNodeId = null; + this._instance = 0; if (args) { if (args._homeId !== undefined) { this._homeId = args._homeId; @@ -11337,6 +11338,9 @@ OpenZWave.RemoteManager_AddAssociation_args = function(args) { if (args._targetNodeId !== undefined) { this._targetNodeId = args._targetNodeId; } + if (args._instance !== undefined) { + this._instance = args._instance; + } } }; OpenZWave.RemoteManager_AddAssociation_args.prototype = {}; @@ -11381,6 +11385,13 @@ OpenZWave.RemoteManager_AddAssociation_args.prototype.read = function(input) { input.skip(ftype); } break; + case 5: + if (ftype == Thrift.Type.BYTE) { + this._instance = input.readByte().value; + } else { + input.skip(ftype); + } + break; default: input.skip(ftype); } @@ -11412,6 +11423,11 @@ OpenZWave.RemoteManager_AddAssociation_args.prototype.write = function(output) { output.writeByte(this._targetNodeId); output.writeFieldEnd(); } + if (this._instance !== null && this._instance !== undefined) { + output.writeFieldBegin('_instance', Thrift.Type.BYTE, 5); + output.writeByte(this._instance); + output.writeFieldEnd(); + } output.writeFieldStop(); output.writeStructEnd(); return; @@ -11450,6 +11466,7 @@ OpenZWave.RemoteManager_RemoveAssociation_args = function(args) { this._nodeId = null; this._groupIdx = null; this._targetNodeId = null; + this._instance = 0; if (args) { if (args._homeId !== undefined) { this._homeId = args._homeId; @@ -11463,6 +11480,9 @@ OpenZWave.RemoteManager_RemoveAssociation_args = function(args) { if (args._targetNodeId !== undefined) { this._targetNodeId = args._targetNodeId; } + if (args._instance !== undefined) { + this._instance = args._instance; + } } }; OpenZWave.RemoteManager_RemoveAssociation_args.prototype = {}; @@ -11507,6 +11527,13 @@ OpenZWave.RemoteManager_RemoveAssociation_args.prototype.read = function(input) input.skip(ftype); } break; + case 5: + if (ftype == Thrift.Type.BYTE) { + this._instance = input.readByte().value; + } else { + input.skip(ftype); + } + break; default: input.skip(ftype); } @@ -11538,6 +11565,11 @@ OpenZWave.RemoteManager_RemoveAssociation_args.prototype.write = function(output output.writeByte(this._targetNodeId); output.writeFieldEnd(); } + if (this._instance !== null && this._instance !== undefined) { + output.writeFieldBegin('_instance', Thrift.Type.BYTE, 5); + output.writeByte(this._instance); + output.writeFieldEnd(); + } output.writeFieldStop(); output.writeStructEnd(); return; @@ -20315,14 +20347,14 @@ OpenZWave.RemoteManagerClient.prototype.recv_GetNumGroups = function() { } throw 'GetNumGroups failed: unknown result'; }; -OpenZWave.RemoteManagerClient.prototype.GetAssociations = function(_homeId, _nodeId, _groupIdx) { - this.send_GetAssociations(_homeId, _nodeId, _groupIdx); - return this.recv_GetAssociations(); +OpenZWave.RemoteManagerClient.prototype.GetAssociations_uint8 = function(_homeId, _nodeId, _groupIdx) { + this.send_GetAssociations_uint8(_homeId, _nodeId, _groupIdx); + return this.recv_GetAssociations_uint8(); }; -OpenZWave.RemoteManagerClient.prototype.send_GetAssociations = function(_homeId, _nodeId, _groupIdx) { - this.output.writeMessageBegin('GetAssociations', Thrift.MessageType.CALL, this.seqid); - var args = new OpenZWave.RemoteManager_GetAssociations_args(); +OpenZWave.RemoteManagerClient.prototype.send_GetAssociations_uint8 = function(_homeId, _nodeId, _groupIdx) { + this.output.writeMessageBegin('GetAssociations_uint8', Thrift.MessageType.CALL, this.seqid); + var args = new OpenZWave.RemoteManager_GetAssociations_uint8_args(); args._homeId = _homeId; args._nodeId = _nodeId; args._groupIdx = _groupIdx; @@ -20331,7 +20363,7 @@ OpenZWave.RemoteManagerClient.prototype.send_GetAssociations = function(_homeId, return this.output.getTransport().flush(); }; -OpenZWave.RemoteManagerClient.prototype.recv_GetAssociations = function() { +OpenZWave.RemoteManagerClient.prototype.recv_GetAssociations_uint8 = function() { var ret = this.input.readMessageBegin(); var fname = ret.fname; var mtype = ret.mtype; @@ -20342,14 +20374,14 @@ OpenZWave.RemoteManagerClient.prototype.recv_GetAssociations = function() { this.input.readMessageEnd(); throw x; } - var result = new OpenZWave.RemoteManager_GetAssociations_result(); + var result = new OpenZWave.RemoteManager_GetAssociations_uint8_result(); result.read(this.input); this.input.readMessageEnd(); if (null !== result.success) { return result.success; } - throw 'GetAssociations failed: unknown result'; + throw 'GetAssociations_uint8 failed: unknown result'; }; OpenZWave.RemoteManagerClient.prototype.GetMaxAssociations = function(_homeId, _nodeId, _groupIdx) { this.send_GetMaxAssociations(_homeId, _nodeId, _groupIdx); @@ -20423,18 +20455,19 @@ OpenZWave.RemoteManagerClient.prototype.recv_GetGroupLabel = function() { } throw 'GetGroupLabel failed: unknown result'; }; -OpenZWave.RemoteManagerClient.prototype.AddAssociation = function(_homeId, _nodeId, _groupIdx, _targetNodeId) { - this.send_AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId); +OpenZWave.RemoteManagerClient.prototype.AddAssociation = function(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) { + this.send_AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance); this.recv_AddAssociation(); }; -OpenZWave.RemoteManagerClient.prototype.send_AddAssociation = function(_homeId, _nodeId, _groupIdx, _targetNodeId) { +OpenZWave.RemoteManagerClient.prototype.send_AddAssociation = function(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) { this.output.writeMessageBegin('AddAssociation', Thrift.MessageType.CALL, this.seqid); var args = new OpenZWave.RemoteManager_AddAssociation_args(); args._homeId = _homeId; args._nodeId = _nodeId; args._groupIdx = _groupIdx; args._targetNodeId = _targetNodeId; + args._instance = _instance; args.write(this.output); this.output.writeMessageEnd(); return this.output.getTransport().flush(); @@ -20457,18 +20490,19 @@ OpenZWave.RemoteManagerClient.prototype.recv_AddAssociation = function() { return; }; -OpenZWave.RemoteManagerClient.prototype.RemoveAssociation = function(_homeId, _nodeId, _groupIdx, _targetNodeId) { - this.send_RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId); +OpenZWave.RemoteManagerClient.prototype.RemoveAssociation = function(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) { + this.send_RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance); this.recv_RemoveAssociation(); }; -OpenZWave.RemoteManagerClient.prototype.send_RemoveAssociation = function(_homeId, _nodeId, _groupIdx, _targetNodeId) { +OpenZWave.RemoteManagerClient.prototype.send_RemoveAssociation = function(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) { this.output.writeMessageBegin('RemoveAssociation', Thrift.MessageType.CALL, this.seqid); var args = new OpenZWave.RemoteManager_RemoveAssociation_args(); args._homeId = _homeId; args._nodeId = _nodeId; args._groupIdx = _groupIdx; args._targetNodeId = _targetNodeId; + args._instance = _instance; args.write(this.output); this.output.writeMessageEnd(); return this.output.getTransport().flush(); diff --git a/gen-py/OpenZWave/RemoteManager-remote b/gen-py/OpenZWave/RemoteManager-remote index cdae098..6ac468b 100755 --- a/gen-py/OpenZWave/RemoteManager-remote +++ b/gen-py/OpenZWave/RemoteManager-remote @@ -121,11 +121,11 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' void RequestConfigParam(i32 _homeId, byte _nodeId, byte _param)' print ' void RequestAllConfigParams(i32 _homeId, byte _nodeId)' print ' byte GetNumGroups(i32 _homeId, byte _nodeId)' - print ' GetAssociationsReturnStruct GetAssociations(i32 _homeId, byte _nodeId, byte _groupIdx)' + print ' GetAssociationsReturnStruct GetAssociations_uint8(i32 _homeId, byte _nodeId, byte _groupIdx)' print ' byte GetMaxAssociations(i32 _homeId, byte _nodeId, byte _groupIdx)' print ' string GetGroupLabel(i32 _homeId, byte _nodeId, byte _groupIdx)' - print ' void AddAssociation(i32 _homeId, byte _nodeId, byte _groupIdx, byte _targetNodeId)' - print ' void RemoveAssociation(i32 _homeId, byte _nodeId, byte _groupIdx, byte _targetNodeId)' + print ' void AddAssociation(i32 _homeId, byte _nodeId, byte _groupIdx, byte _targetNodeId, byte _instance)' + print ' void RemoveAssociation(i32 _homeId, byte _nodeId, byte _groupIdx, byte _targetNodeId, byte _instance)' print ' void ResetController(i32 _homeId)' print ' void SoftReset(i32 _homeId)' print ' bool BeginControllerCommand(i32 _homeId, DriverControllerCommand _command, bool _highPower, byte _nodeId, byte _arg)' @@ -812,11 +812,11 @@ elif cmd == 'GetNumGroups': sys.exit(1) pp.pprint(client.GetNumGroups(eval(args[0]),eval(args[1]),)) -elif cmd == 'GetAssociations': +elif cmd == 'GetAssociations_uint8': if len(args) != 3: - print 'GetAssociations requires 3 args' + print 'GetAssociations_uint8 requires 3 args' sys.exit(1) - pp.pprint(client.GetAssociations(eval(args[0]),eval(args[1]),eval(args[2]),)) + pp.pprint(client.GetAssociations_uint8(eval(args[0]),eval(args[1]),eval(args[2]),)) elif cmd == 'GetMaxAssociations': if len(args) != 3: @@ -831,16 +831,16 @@ elif cmd == 'GetGroupLabel': pp.pprint(client.GetGroupLabel(eval(args[0]),eval(args[1]),eval(args[2]),)) elif cmd == 'AddAssociation': - if len(args) != 4: - print 'AddAssociation requires 4 args' + if len(args) != 5: + print 'AddAssociation requires 5 args' sys.exit(1) - pp.pprint(client.AddAssociation(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) + pp.pprint(client.AddAssociation(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) elif cmd == 'RemoveAssociation': - if len(args) != 4: - print 'RemoveAssociation requires 4 args' + if len(args) != 5: + print 'RemoveAssociation requires 5 args' sys.exit(1) - pp.pprint(client.RemoveAssociation(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) + pp.pprint(client.RemoveAssociation(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) elif cmd == 'ResetController': if len(args) != 1: diff --git a/gen-py/OpenZWave/RemoteManager.py b/gen-py/OpenZWave/RemoteManager.py index 45ae66e..ab4c104 100644 --- a/gen-py/OpenZWave/RemoteManager.py +++ b/gen-py/OpenZWave/RemoteManager.py @@ -778,7 +778,7 @@ def GetNumGroups(self, _homeId, _nodeId): """ pass - def GetAssociations(self, _homeId, _nodeId, _groupIdx): + def GetAssociations_uint8(self, _homeId, _nodeId, _groupIdx): """ Parameters: - _homeId @@ -805,23 +805,25 @@ def GetGroupLabel(self, _homeId, _nodeId, _groupIdx): """ pass - def AddAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId): + def AddAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId, _instance): """ Parameters: - _homeId - _nodeId - _groupIdx - _targetNodeId + - _instance """ pass - def RemoveAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId): + def RemoveAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId, _instance): """ Parameters: - _homeId - _nodeId - _groupIdx - _targetNodeId + - _instance """ pass @@ -4239,19 +4241,19 @@ def recv_GetNumGroups(self, ): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "GetNumGroups failed: unknown result"); - def GetAssociations(self, _homeId, _nodeId, _groupIdx): + def GetAssociations_uint8(self, _homeId, _nodeId, _groupIdx): """ Parameters: - _homeId - _nodeId - _groupIdx """ - self.send_GetAssociations(_homeId, _nodeId, _groupIdx) - return self.recv_GetAssociations() + self.send_GetAssociations_uint8(_homeId, _nodeId, _groupIdx) + return self.recv_GetAssociations_uint8() - def send_GetAssociations(self, _homeId, _nodeId, _groupIdx): - self._oprot.writeMessageBegin('GetAssociations', TMessageType.CALL, self._seqid) - args = GetAssociations_args() + def send_GetAssociations_uint8(self, _homeId, _nodeId, _groupIdx): + self._oprot.writeMessageBegin('GetAssociations_uint8', TMessageType.CALL, self._seqid) + args = GetAssociations_uint8_args() args._homeId = _homeId args._nodeId = _nodeId args._groupIdx = _groupIdx @@ -4259,19 +4261,19 @@ def send_GetAssociations(self, _homeId, _nodeId, _groupIdx): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_GetAssociations(self, ): + def recv_GetAssociations_uint8(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = GetAssociations_result() + result = GetAssociations_uint8_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetAssociations failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetAssociations_uint8 failed: unknown result"); def GetMaxAssociations(self, _homeId, _nodeId, _groupIdx): """ @@ -4341,24 +4343,26 @@ def recv_GetGroupLabel(self, ): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "GetGroupLabel failed: unknown result"); - def AddAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId): + def AddAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId, _instance): """ Parameters: - _homeId - _nodeId - _groupIdx - _targetNodeId + - _instance """ - self.send_AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId) + self.send_AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) self.recv_AddAssociation() - def send_AddAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId): + def send_AddAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId, _instance): self._oprot.writeMessageBegin('AddAssociation', TMessageType.CALL, self._seqid) args = AddAssociation_args() args._homeId = _homeId args._nodeId = _nodeId args._groupIdx = _groupIdx args._targetNodeId = _targetNodeId + args._instance = _instance args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() @@ -4375,24 +4379,26 @@ def recv_AddAssociation(self, ): self._iprot.readMessageEnd() return - def RemoveAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId): + def RemoveAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId, _instance): """ Parameters: - _homeId - _nodeId - _groupIdx - _targetNodeId + - _instance """ - self.send_RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId) + self.send_RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) self.recv_RemoveAssociation() - def send_RemoveAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId): + def send_RemoveAssociation(self, _homeId, _nodeId, _groupIdx, _targetNodeId, _instance): self._oprot.writeMessageBegin('RemoveAssociation', TMessageType.CALL, self._seqid) args = RemoveAssociation_args() args._homeId = _homeId args._nodeId = _nodeId args._groupIdx = _groupIdx args._targetNodeId = _targetNodeId + args._instance = _instance args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() @@ -5983,7 +5989,7 @@ def __init__(self, handler): self._processMap["RequestConfigParam"] = Processor.process_RequestConfigParam self._processMap["RequestAllConfigParams"] = Processor.process_RequestAllConfigParams self._processMap["GetNumGroups"] = Processor.process_GetNumGroups - self._processMap["GetAssociations"] = Processor.process_GetAssociations + self._processMap["GetAssociations_uint8"] = Processor.process_GetAssociations_uint8 self._processMap["GetMaxAssociations"] = Processor.process_GetMaxAssociations self._processMap["GetGroupLabel"] = Processor.process_GetGroupLabel self._processMap["AddAssociation"] = Processor.process_AddAssociation @@ -7129,13 +7135,13 @@ def process_GetNumGroups(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() - def process_GetAssociations(self, seqid, iprot, oprot): - args = GetAssociations_args() + def process_GetAssociations_uint8(self, seqid, iprot, oprot): + args = GetAssociations_uint8_args() args.read(iprot) iprot.readMessageEnd() - result = GetAssociations_result() - result.success = self._handler.GetAssociations(args._homeId, args._nodeId, args._groupIdx) - oprot.writeMessageBegin("GetAssociations", TMessageType.REPLY, seqid) + result = GetAssociations_uint8_result() + result.success = self._handler.GetAssociations_uint8(args._homeId, args._nodeId, args._groupIdx) + oprot.writeMessageBegin("GetAssociations_uint8", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -7167,7 +7173,7 @@ def process_AddAssociation(self, seqid, iprot, oprot): args.read(iprot) iprot.readMessageEnd() result = AddAssociation_result() - self._handler.AddAssociation(args._homeId, args._nodeId, args._groupIdx, args._targetNodeId) + self._handler.AddAssociation(args._homeId, args._nodeId, args._groupIdx, args._targetNodeId, args._instance) oprot.writeMessageBegin("AddAssociation", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() @@ -7178,7 +7184,7 @@ def process_RemoveAssociation(self, seqid, iprot, oprot): args.read(iprot) iprot.readMessageEnd() result = RemoveAssociation_result() - self._handler.RemoveAssociation(args._homeId, args._nodeId, args._groupIdx, args._targetNodeId) + self._handler.RemoveAssociation(args._homeId, args._nodeId, args._groupIdx, args._targetNodeId, args._instance) oprot.writeMessageBegin("RemoveAssociation", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() @@ -19924,7 +19930,7 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -class GetAssociations_args: +class GetAssociations_uint8_args: """ Attributes: - _homeId @@ -19977,7 +19983,7 @@ def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return - oprot.writeStructBegin('GetAssociations_args') + oprot.writeStructBegin('GetAssociations_uint8_args') if self._homeId is not None: oprot.writeFieldBegin('_homeId', TType.I32, 1) oprot.writeI32(self._homeId) @@ -20008,7 +20014,7 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -class GetAssociations_result: +class GetAssociations_uint8_result: """ Attributes: - success @@ -20045,7 +20051,7 @@ def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return - oprot.writeStructBegin('GetAssociations_result') + oprot.writeStructBegin('GetAssociations_uint8_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) @@ -20361,6 +20367,7 @@ class AddAssociation_args: - _nodeId - _groupIdx - _targetNodeId + - _instance """ thrift_spec = ( @@ -20369,13 +20376,15 @@ class AddAssociation_args: (2, TType.BYTE, '_nodeId', None, None, ), # 2 (3, TType.BYTE, '_groupIdx', None, None, ), # 3 (4, TType.BYTE, '_targetNodeId', None, None, ), # 4 + (5, TType.BYTE, '_instance', None, 0, ), # 5 ) - def __init__(self, _homeId=None, _nodeId=None, _groupIdx=None, _targetNodeId=None,): + def __init__(self, _homeId=None, _nodeId=None, _groupIdx=None, _targetNodeId=None, _instance=thrift_spec[5][4],): self._homeId = _homeId self._nodeId = _nodeId self._groupIdx = _groupIdx self._targetNodeId = _targetNodeId + self._instance = _instance def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -20406,6 +20415,11 @@ def read(self, iprot): self._targetNodeId = iprot.readByte(); else: iprot.skip(ftype) + elif fid == 5: + if ftype == TType.BYTE: + self._instance = iprot.readByte(); + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -20432,6 +20446,10 @@ def write(self, oprot): oprot.writeFieldBegin('_targetNodeId', TType.BYTE, 4) oprot.writeByte(self._targetNodeId) oprot.writeFieldEnd() + if self._instance is not None: + oprot.writeFieldBegin('_instance', TType.BYTE, 5) + oprot.writeByte(self._instance) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -20499,6 +20517,7 @@ class RemoveAssociation_args: - _nodeId - _groupIdx - _targetNodeId + - _instance """ thrift_spec = ( @@ -20507,13 +20526,15 @@ class RemoveAssociation_args: (2, TType.BYTE, '_nodeId', None, None, ), # 2 (3, TType.BYTE, '_groupIdx', None, None, ), # 3 (4, TType.BYTE, '_targetNodeId', None, None, ), # 4 + (5, TType.BYTE, '_instance', None, 0, ), # 5 ) - def __init__(self, _homeId=None, _nodeId=None, _groupIdx=None, _targetNodeId=None,): + def __init__(self, _homeId=None, _nodeId=None, _groupIdx=None, _targetNodeId=None, _instance=thrift_spec[5][4],): self._homeId = _homeId self._nodeId = _nodeId self._groupIdx = _groupIdx self._targetNodeId = _targetNodeId + self._instance = _instance def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -20544,6 +20565,11 @@ def read(self, iprot): self._targetNodeId = iprot.readByte(); else: iprot.skip(ftype) + elif fid == 5: + if ftype == TType.BYTE: + self._instance = iprot.readByte(); + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -20570,6 +20596,10 @@ def write(self, oprot): oprot.writeFieldBegin('_targetNodeId', TType.BYTE, 4) oprot.writeByte(self._targetNodeId) oprot.writeFieldEnd() + if self._instance is not None: + oprot.writeFieldBegin('_instance', TType.BYTE, 5) + oprot.writeByte(self._instance) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() diff --git a/gen-py/OpenZWave/values.py b/gen-py/OpenZWave/values.py new file mode 100644 index 0000000..a6e6ca1 --- /dev/null +++ b/gen-py/OpenZWave/values.py @@ -0,0 +1,32 @@ +import ctypes +import RemoteManager + +_DEFAULT_COMMAND_CLASS_ID = 0x25 # COMMAND_CLASS_SWITCH_BINARY +_DEFAULT_INSTANCE_ID = 1 +_DEFAULT_VALUE_INDEX = 0 +_DEFAULT_TYPE = RemoteManager.RemoteValueType.ValueType_Bool + +def unpackValueID(homeId, valueId): + """Convert a value ID to a RemoveValueID + + This conversion has a reference implementation at + https://github.com/OpenZWave/open-zwave/blob/master/cpp/src/value_classes/ValueID.h.""" + return RemoteManager.RemoteValueID( + _homeId=ctypes.c_int32(homeId).value, + _nodeId=(valueId & 0xFF000000) >> 24, + _genre=(valueId & 0x00C00000) >> 22, + _commandClassId=(valueId & 0x003FC000) >> 14, + _instance=(valueId & 0xFF00000000000000) >> 56, + _valueIndex=(valueId & 0x00000FF0) >> 4, + _type=valueId & 0x0000000F) + +def getSwitchValueID(homeId, nodeId): + """Create a value ID from the node ID of a switch""" + return RemoteManager.RemoteValueID( + _homeId=ctypes.c_int32(homeId).value, + _nodeId=nodeId, + _genre=RemoteManager.RemoteValueGenre.ValueGenre_User, + _commandClassId=_DEFAULT_COMMAND_CLASS_ID, + _instance=_DEFAULT_INSTANCE_ID, + _valueIndex=_DEFAULT_VALUE_INDEX, + _type=_DEFAULT_TYPE) diff --git a/gen-rb/remote_manager.rb b/gen-rb/remote_manager.rb index b64208a..fcf4e40 100644 --- a/gen-rb/remote_manager.rb +++ b/gen-rb/remote_manager.rb @@ -1462,19 +1462,19 @@ def recv_GetNumGroups() raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetNumGroups failed: unknown result') end - def GetAssociations(_homeId, _nodeId, _groupIdx) - send_GetAssociations(_homeId, _nodeId, _groupIdx) - return recv_GetAssociations() + def GetAssociations_uint8(_homeId, _nodeId, _groupIdx) + send_GetAssociations_uint8(_homeId, _nodeId, _groupIdx) + return recv_GetAssociations_uint8() end - def send_GetAssociations(_homeId, _nodeId, _groupIdx) - send_message('GetAssociations', GetAssociations_args, :_homeId => _homeId, :_nodeId => _nodeId, :_groupIdx => _groupIdx) + def send_GetAssociations_uint8(_homeId, _nodeId, _groupIdx) + send_message('GetAssociations_uint8', GetAssociations_uint8_args, :_homeId => _homeId, :_nodeId => _nodeId, :_groupIdx => _groupIdx) end - def recv_GetAssociations() - result = receive_message(GetAssociations_result) + def recv_GetAssociations_uint8() + result = receive_message(GetAssociations_uint8_result) return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetAssociations failed: unknown result') + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetAssociations_uint8 failed: unknown result') end def GetMaxAssociations(_homeId, _nodeId, _groupIdx) @@ -1507,13 +1507,13 @@ def recv_GetGroupLabel() raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetGroupLabel failed: unknown result') end - def AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId) - send_AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId) + def AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) + send_AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) recv_AddAssociation() end - def send_AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId) - send_message('AddAssociation', AddAssociation_args, :_homeId => _homeId, :_nodeId => _nodeId, :_groupIdx => _groupIdx, :_targetNodeId => _targetNodeId) + def send_AddAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) + send_message('AddAssociation', AddAssociation_args, :_homeId => _homeId, :_nodeId => _nodeId, :_groupIdx => _groupIdx, :_targetNodeId => _targetNodeId, :_instance => _instance) end def recv_AddAssociation() @@ -1521,13 +1521,13 @@ def recv_AddAssociation() return end - def RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId) - send_RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId) + def RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) + send_RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) recv_RemoveAssociation() end - def send_RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId) - send_message('RemoveAssociation', RemoveAssociation_args, :_homeId => _homeId, :_nodeId => _nodeId, :_groupIdx => _groupIdx, :_targetNodeId => _targetNodeId) + def send_RemoveAssociation(_homeId, _nodeId, _groupIdx, _targetNodeId, _instance) + send_message('RemoveAssociation', RemoveAssociation_args, :_homeId => _homeId, :_nodeId => _nodeId, :_groupIdx => _groupIdx, :_targetNodeId => _targetNodeId, :_instance => _instance) end def recv_RemoveAssociation() @@ -2921,11 +2921,11 @@ def process_GetNumGroups(seqid, iprot, oprot) write_result(result, oprot, 'GetNumGroups', seqid) end - def process_GetAssociations(seqid, iprot, oprot) - args = read_args(iprot, GetAssociations_args) - result = GetAssociations_result.new() - result.success = @handler.GetAssociations(args._homeId, args._nodeId, args._groupIdx) - write_result(result, oprot, 'GetAssociations', seqid) + def process_GetAssociations_uint8(seqid, iprot, oprot) + args = read_args(iprot, GetAssociations_uint8_args) + result = GetAssociations_uint8_result.new() + result.success = @handler.GetAssociations_uint8(args._homeId, args._nodeId, args._groupIdx) + write_result(result, oprot, 'GetAssociations_uint8', seqid) end def process_GetMaxAssociations(seqid, iprot, oprot) @@ -2945,14 +2945,14 @@ def process_GetGroupLabel(seqid, iprot, oprot) def process_AddAssociation(seqid, iprot, oprot) args = read_args(iprot, AddAssociation_args) result = AddAssociation_result.new() - @handler.AddAssociation(args._homeId, args._nodeId, args._groupIdx, args._targetNodeId) + @handler.AddAssociation(args._homeId, args._nodeId, args._groupIdx, args._targetNodeId, args._instance) write_result(result, oprot, 'AddAssociation', seqid) end def process_RemoveAssociation(seqid, iprot, oprot) args = read_args(iprot, RemoveAssociation_args) result = RemoveAssociation_result.new() - @handler.RemoveAssociation(args._homeId, args._nodeId, args._groupIdx, args._targetNodeId) + @handler.RemoveAssociation(args._homeId, args._nodeId, args._groupIdx, args._targetNodeId, args._instance) write_result(result, oprot, 'RemoveAssociation', seqid) end @@ -6546,7 +6546,7 @@ def validate ::Thrift::Struct.generate_accessors self end - class GetAssociations_args + class GetAssociations_uint8_args include ::Thrift::Struct, ::Thrift::Struct_Union _HOMEID = 1 _NODEID = 2 @@ -6566,7 +6566,7 @@ def validate ::Thrift::Struct.generate_accessors self end - class GetAssociations_result + class GetAssociations_uint8_result include ::Thrift::Struct, ::Thrift::Struct_Union SUCCESS = 0 @@ -6660,12 +6660,14 @@ class AddAssociation_args _NODEID = 2 _GROUPIDX = 3 _TARGETNODEID = 4 + _INSTANCE = 5 FIELDS = { _HOMEID => {:type => ::Thrift::Types::I32, :name => '_homeId'}, _NODEID => {:type => ::Thrift::Types::BYTE, :name => '_nodeId'}, _GROUPIDX => {:type => ::Thrift::Types::BYTE, :name => '_groupIdx'}, - _TARGETNODEID => {:type => ::Thrift::Types::BYTE, :name => '_targetNodeId'} + _TARGETNODEID => {:type => ::Thrift::Types::BYTE, :name => '_targetNodeId'}, + _INSTANCE => {:type => ::Thrift::Types::BYTE, :name => '_instance', :default => 0} } def struct_fields; FIELDS; end @@ -6697,12 +6699,14 @@ class RemoveAssociation_args _NODEID = 2 _GROUPIDX = 3 _TARGETNODEID = 4 + _INSTANCE = 5 FIELDS = { _HOMEID => {:type => ::Thrift::Types::I32, :name => '_homeId'}, _NODEID => {:type => ::Thrift::Types::BYTE, :name => '_nodeId'}, _GROUPIDX => {:type => ::Thrift::Types::BYTE, :name => '_groupIdx'}, - _TARGETNODEID => {:type => ::Thrift::Types::BYTE, :name => '_targetNodeId'} + _TARGETNODEID => {:type => ::Thrift::Types::BYTE, :name => '_targetNodeId'}, + _INSTANCE => {:type => ::Thrift::Types::BYTE, :name => '_instance', :default => 0} } def struct_fields; FIELDS; end diff --git a/ozw.thrift b/ozw.thrift index 0c5e3c5..e869f7b 100644 --- a/ozw.thrift +++ b/ozw.thrift @@ -593,7 +593,8 @@ service RemoteManager { //uint32 GetAssociations( uint32 const _homeId, uint8 const _nodeId, uint8 const _groupIdx, uint8** o_associations ); // ekarak: return list of associations instead - GetAssociationsReturnStruct GetAssociations( 1:i32 _homeId, 2:byte _nodeId, 3:byte _groupIdx); + GetAssociationsReturnStruct GetAssociations_uint8( 1:i32 _homeId, 2:byte _nodeId, 3:byte _groupIdx); + //uint32 GetAssociations( uint32 const _homeId, uint8 const _nodeId, uint8 const _groupIdx, InstanceAssociation** o_associations ); //uint8 GetMaxAssociations( uint32 const _homeId, uint8 const _nodeId, uint8 const _groupIdx ); byte GetMaxAssociations( 1:i32 _homeId, 2:byte _nodeId, 3:byte _groupIdx ); @@ -601,11 +602,11 @@ service RemoteManager { //string GetGroupLabel( uint32 const _homeId, uint8 const _nodeId, uint8 const _groupIdx ); string GetGroupLabel( 1:i32 _homeId, 2:byte _nodeId, 3:byte _groupIdx ); - //void AddAssociation( uint32 const _homeId, uint8 const _nodeId, uint8 const _groupIdx, uint8 const _targetNodeId ); - void AddAssociation( 1:i32 _homeId, 2:byte _nodeId, 3:byte _groupIdx, 4:byte _targetNodeId ); + //void AddAssociation( uint32 const _homeId, uint8 const _nodeId, uint8 const _groupIdx, uint8 const _targetNodeId, uint8 const _instance = 0x00 ); + void AddAssociation( 1:i32 _homeId, 2:byte _nodeId, 3:byte _groupIdx, 4:byte _targetNodeId, 5:byte _instance = 0 ); - //void RemoveAssociation( uint32 const _homeId, uint8 const _nodeId, uint8 const _groupIdx, uint8 const _targetNodeId ); - void RemoveAssociation( 1:i32 _homeId, 2:byte _nodeId, 3:byte _groupIdx, 4:byte _targetNodeId ); + //void RemoveAssociation( uint32 const _homeId, uint8 const _nodeId, uint8 const _groupIdx, uint8 const _targetNodeId, uint8 const _instance = 0x00 ); + void RemoveAssociation( 1:i32 _homeId, 2:byte _nodeId, 3:byte _groupIdx, 4:byte _targetNodeId, 5:byte _instance = 0 ); //----------------------------------------------------------------------------- // Controller commands