Permalink
Browse files

updated OpenZWave to rev.525

  • Loading branch information...
1 parent dd56a08 commit f76d0c54143738f9ca1c45c3554e6665f7a0b235 @ekarak ekarak committed May 5, 2012
Showing with 65 additions and 13 deletions.
  1. +3 −6 Main.cpp
  2. +4 −2 Makefile
  3. +5 −0 gen-cpp/RemoteManager_server.cpp.orig
  4. +1 −5 gen-cpp/RemoteManager_server.cpp.patch
  5. +51 −0 gen-rb/remote_manager.rb
  6. +1 −0 ozw.thrift
  7. BIN ozwd
View
9 Main.cpp
@@ -78,18 +78,15 @@ static list<NodeInfo*> g_nodes;
// OpenZWave includes
#include "Notification.h"
-
-// Stromp client
-#include "BoostStomp.hpp"
-
static uint32 g_homeId = 0;
static bool g_initFailed = false;
//
static boost::condition_variable initCond ;
-static boost::mutex initMutex;
+static boost::mutex initMutex;
-// STOMP statics
+// Stromp client
+#include "BoostStomp.hpp"
static STOMP::BoostStomp* stomp_client;
static string* notifications_topic = new string("/queue/zwave/monitor");
View
6 Makefile
@@ -47,8 +47,10 @@ LIBZWAVE_STATIC := $(OPENZWAVE)/cpp/lib/linux/libopenzwave.a
LIBZWAVE_DYNAMIC := $(OPENZWAVE)/cpp/lib/linux/libopenzwave.so
LIBUSB := -ludev
LIBBOOST := -lboost_thread -lboost_program_options -lboost_filesystem -lboost_system
+LIBBOOST_STATIC := -lboost_thread -lboost_program_options -lboost_filesystem -lboost_system
LIBTHRIFT := -lthrift
LIBBOOSTSTOMP := -lbooststomp
+LIBBOOSTSTOMP_STATIC := $(BOOSTSTOMP)/libbooststomp.a
# for Mac OS X comment out above 2 lines and uncomment next 2 lines
#LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/mac/*.a)
@@ -93,8 +95,8 @@ openzwave: $(LIBZWAVE_STATIC) $(LIBZWAVE_DYNAMIC)
booststomp:
cd $(BOOSTSTOMP); make
-#ozwd.static: Main.o BoostStomp.o gen-cpp/RemoteManager.o gen-cpp/ozw_constants.o gen-cpp/ozw_types.o $(LIBZWAVE_STATIC)
-# $(LD) -static -static-libgcc -o $@ $(LDFLAGS) Main.o BoostStomp.o gen-cpp/RemoteManager.o gen-cpp/ozw_constants.o gen-cpp/ozw_types.o $(LIBS) $(LIBZWAVE_STATIC)
+ozwd.static: Main.o booststomp gen-cpp/RemoteManager.o gen-cpp/ozw_constants.o gen-cpp/ozw_types.o $(LIBZWAVE_STATIC)
+ $(CXX) -static -static-libgcc -o $@ $(LDFLAGS) Main.o gen-cpp/RemoteManager.o gen-cpp/ozw_constants.o gen-cpp/ozw_types.o $(LIBZWAVE_STATIC) $(LIBBOOSTSTOMP_STATIC) $(LIBBOOST_STATIC) -lpthread -ludev -lthrift -lrt
ozwd: Main.o booststomp gen-cpp/RemoteManager.o gen-cpp/ozw_constants.o gen-cpp/ozw_types.o $(LIBZWAVE_DYNAMIC)
$(CXX) -o $@ $(LDFLAGS) Main.o gen-cpp/RemoteManager.o gen-cpp/ozw_constants.o gen-cpp/ozw_types.o $(LIBS) $(LIBZWAVE_DYNAMIC)
View
5 gen-cpp/RemoteManager_server.cpp.orig
@@ -1046,6 +1046,11 @@ class RemoteManagerHandler : virtual public RemoteManagerIf {
printf("SendAllValues\n");
}
+ void ping() {
+ // Your implementation goes here
+ printf("ping\n");
+ }
+
};
// int main(int argc, char **argv) {
View
6 gen-cpp/RemoteManager_server.cpp.patch
@@ -220,17 +220,13 @@
}
};
---- 1070,1082 ----
+--- 1070,1078 ----
}
void SendAllValues() {
! g_criticalSection.lock();
! send_all_values();
! g_criticalSection.unlock();
-! }
-!
-! void ping() {
-! // pong...
}
};
View
51 gen-rb/remote_manager.rb
@@ -2026,6 +2026,20 @@ def recv_SendAllValues()
return
end
+ def ping()
+ send_ping()
+ recv_ping()
+ end
+
+ def send_ping()
+ send_message('ping', Ping_args)
+ end
+
+ def recv_ping()
+ result = receive_message(Ping_result)
+ return
+ end
+
end
class Processor
@@ -2983,6 +2997,13 @@ def process_SendAllValues(seqid, iprot, oprot)
write_result(result, oprot, 'SendAllValues', seqid)
end
+ def process_ping(seqid, iprot, oprot)
+ args = read_args(iprot, Ping_args)
+ result = Ping_result.new()
+ @handler.ping()
+ write_result(result, oprot, 'ping', seqid)
+ end
+
end
# HELPER FUNCTIONS AND STRUCTURES
@@ -7559,6 +7580,36 @@ def validate
::Thrift::Struct.generate_accessors self
end
+ class Ping_args
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+
+ FIELDS = {
+
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ end
+
+ ::Thrift::Struct.generate_accessors self
+ end
+
+ class Ping_result
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+
+ FIELDS = {
+
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ end
+
+ ::Thrift::Struct.generate_accessors self
+ end
+
end
end
View
1 ozw.thrift
@@ -666,4 +666,5 @@ service RemoteManager {
// ----------------------- ekarak: and a little extra candy server for missing functionality from OZW
void SendAllValues();
+ void ping();
}
View
BIN ozwd
Binary file not shown.

0 comments on commit f76d0c5

Please sign in to comment.