From 3b971f2f2fc34dc01705c6b34483521e867054f8 Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Wed, 9 Mar 2022 02:10:10 +0000 Subject: [PATCH] before onvifobserve changed to singlthreading mode --- Projects/argus/argus.vpj | 909 +++++++++--------- Projects/argus/makefile | 240 +++-- lib/alg/generic/md5.cpp | 9 +- lib/alg/generic/md5.h | 1 + lib/components/base/basicEvent.h | 43 +- lib/components/base/basicThread.cpp | 10 +- lib/data/media/video/videoAVLIBSource.cpp | 41 +- lib/data/media/video/videoAVLIBSource.h | 4 +- lib/data/protocol/protocol.h | 74 +- lib/data/protocol/protocolDefender.cpp | 15 +- lib/data/protocol/protocolLGS2D.cpp | 14 +- lib/data/protocol/protocolMAVLINK.cpp | 73 +- lib/data/protocol/protocolMAVLINK.h | 8 +- lib/data/protocol/protocolPTZ.h | 3 + lib/data/protocol/protocolPTZ_PELCO.cpp | 51 +- lib/data/protocol/protocolPTZ_PELCO.h | 62 +- lib/data/protocol/protocolPTZ_VISCA.cpp | 44 +- lib/data/protocol/protocolPTZ_VISCA.h | 58 +- lib/data/protocol/protocolZLMEDIA.cpp | 14 +- lib/data/transport/transportSerial.cpp | 2 +- lib/data/transport/transportSerial.h | 2 + lib/hardware/uart/serialPort.cpp | 10 +- lib/hardware/uart/serialPort.h | 7 +- lib/hardware/uart/serialSOL.cpp | 6 +- lib/rgoose/rgooseCamera.cpp | 340 ++++--- lib/rgoose/rgooseCamera.h | 76 +- lib/rgoose/rgooseDBConnector.cpp | 184 +++- lib/rgoose/rgooseDBConnector.h | 10 +- lib/rgoose/rgooseHardwareManager.cpp | 47 +- .../rgooseHardwareResourceSerialProvider.cpp | 52 +- .../rgooseHardwareResourceSerialProvider.h | 10 +- lib/rgoose/rgooseKernel.cpp | 12 +- lib/rgoose/rgooseKernel.h | 1 + lib/rgoose/rgooseModuleEmbedVideo.cpp | 97 +- lib/rgoose/rgooseModuleEmbedVideo.h | 4 +- lib/rgoose/rgooseModuleFlyHunter.cpp | 2 +- lib/rgoose/rgooseModuleKafka.cpp | 19 +- lib/rgoose/rgooseModuleOnvifObserver.cpp | 221 +++-- lib/rgoose/rgooseModuleOnvifObserver.h | 45 +- lib/rgoose/rgooseModuleZLMedia.cpp | 4 +- lib/rgoose/rgooseNode2D.cpp | 49 +- lib/rgoose/rgooseNodeFactory.cpp | 2 + lib/rgoose/rgooseNodePTZCamControl.cpp | 9 + lib/rgoose/rgooseNodeStaticCamControl.cpp | 6 +- lib/rgoose/rgooseTypes.h | 1 + 45 files changed, 1715 insertions(+), 1176 deletions(-) diff --git a/Projects/argus/argus.vpj b/Projects/argus/argus.vpj index 1e7fbdba..7a998c3e 100644 --- a/Projects/argus/argus.vpj +++ b/Projects/argus/argus.vpj @@ -1,457 +1,458 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Version="10.0" + VendorName="SlickEdit" + TemplateName="GNU C/C++" + WorkingDir="." + BuildSystem="automakefile" + BuildMakeFile="makefile"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/argus/makefile b/Projects/argus/makefile index 215b6bc3..d5526fb1 100644 --- a/Projects/argus/makefile +++ b/Projects/argus/makefile @@ -71,12 +71,11 @@ COMMON_OBJ=$(OUTDIR)/ArgusBackend.o $(OUTDIR)/base64.o \ $(OUTDIR)/rgooseNodePTZCamControl.o \ $(OUTDIR)/rgooseNodeStaticCamControl.o \ $(OUTDIR)/rgooseServerModule.o $(OUTDIR)/rgooseTargetFilter.o \ - $(OUTDIR)/serialPort.o $(OUTDIR)/serialSOL.o $(OUTDIR)/serverPort.o \ - $(OUTDIR)/servletChannelWS.o $(OUTDIR)/servletClientHandlerWS.o \ - $(OUTDIR)/servletWS.o $(OUTDIR)/ssdpAnnouncer.o \ - $(OUTDIR)/Transform.o $(OUTDIR)/transportSerial.o \ - $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \ - $(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/xmlParser.o + $(OUTDIR)/serverPort.o $(OUTDIR)/servletChannelWS.o \ + $(OUTDIR)/servletClientHandlerWS.o $(OUTDIR)/servletWS.o \ + $(OUTDIR)/ssdpAnnouncer.o $(OUTDIR)/Transform.o \ + $(OUTDIR)/transportSerial.o $(OUTDIR)/transportSocket.o \ + $(OUTDIR)/utm.o $(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/xmlParser.o OBJ=$(COMMON_OBJ) $(CFG_OBJ) ALL_OBJ=$(OUTDIR)/ArgusBackend.o $(OUTDIR)/base64.o \ $(OUTDIR)/basicCameraInfo.o $(OUTDIR)/basicDualThread.o \ @@ -122,89 +121,87 @@ ALL_OBJ=$(OUTDIR)/ArgusBackend.o $(OUTDIR)/base64.o \ $(OUTDIR)/rgooseNodePTZCamControl.o \ $(OUTDIR)/rgooseNodeStaticCamControl.o \ $(OUTDIR)/rgooseServerModule.o $(OUTDIR)/rgooseTargetFilter.o \ - $(OUTDIR)/serialPort.o $(OUTDIR)/serialSOL.o $(OUTDIR)/serverPort.o \ - $(OUTDIR)/servletChannelWS.o $(OUTDIR)/servletClientHandlerWS.o \ - $(OUTDIR)/servletWS.o $(OUTDIR)/ssdpAnnouncer.o \ - $(OUTDIR)/Transform.o $(OUTDIR)/transportSerial.o \ - $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \ - $(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/xmlParser.o -lpthread \ - -lmysqlclient -lssl -lcurl -lm -lcrypto -lconfig -lz -lv4l1 -lv4l2 \ - -lhidapi-libusb `pkg-config libavcodec libavdevice libavfilter \ - libavformat libavutil libpostproc libswresample libswscale --libs` \ - -latomic `pkg-config --libs openssl opencv4 rdkafka++` + $(OUTDIR)/serverPort.o $(OUTDIR)/servletChannelWS.o \ + $(OUTDIR)/servletClientHandlerWS.o $(OUTDIR)/servletWS.o \ + $(OUTDIR)/ssdpAnnouncer.o $(OUTDIR)/Transform.o \ + $(OUTDIR)/transportSerial.o $(OUTDIR)/transportSocket.o \ + $(OUTDIR)/utm.o $(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/xmlParser.o \ + -lpthread -lmysqlclient -lssl -lcurl -lm -lcrypto -lconfig -lz \ + -lv4l1 -lv4l2 -lhidapi-libusb `pkg-config libavcodec libavdevice \ + libavfilter libavformat libavutil libpostproc libswresample \ + libswscale --libs` -latomic `pkg-config --libs openssl opencv4 \ + rdkafka++` COMPILE=g++ -c -x c++ "-DDEBUG" "-D__STDC_CONSTANT_MACROS" "-D_CLIENT_APPLICATION_" "-D_OPENCV_" -O0 -g3 -ggdb -std=c++11 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale --cflags` -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $< LINK=g++ -O0 -g3 -ggdb -o "$(OUTFILE)" $(ALL_OBJ) # Pattern rules -$(OUTDIR)/%.o : ../../lib/data/transport/%.cpp - $(COMPILE) - -$(OUTDIR)/%.o : ../../lib/data/protocol/%.cpp - $(COMPILE) - -$(OUTDIR)/%.o : ../../lib/alg/lgs/%.cpp +$(OUTDIR)/%.o : ../../lib/rgoose/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/ssdp/%.cpp +$(OUTDIR)/%.o : ../../lib/components/object/%.cpp $(COMPILE) $(OUTDIR)/%.o : ../../lib/App/argus/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/rgoose/%.cpp +$(OUTDIR)/%.o : ../../lib/data/json/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/ponvif/%.cpp +$(OUTDIR)/%.o : ../../lib/data/transport/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/alg/generic/%.cpp +$(OUTDIR)/%.o : ../../lib/data/protocol/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/components/base/%.cpp +$(OUTDIR)/%.o : ../../lib/data/net/%.cpp $(COMPILE) $(OUTDIR)/%.o : ../../lib/data/media/video/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/hardware/uart/%.cpp +$(OUTDIR)/%.o : ../../lib/data/servletWS/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/hardware/sensors/lrf/%.cpp +$(OUTDIR)/%.o : ../../lib/alg/lgs/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/components/object/%.cpp +$(OUTDIR)/%.o : ../../lib/data/ssdp/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/servletWS/%.cpp +$(OUTDIR)/%.o : ../../lib/data/mysql/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/net/%.cpp +$(OUTDIR)/%.o : ../../lib/components/base/%.cpp $(COMPILE) $(OUTDIR)/%.o : ../../lib/data/curl/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/mysql/%.cpp +$(OUTDIR)/%.o : ../../lib/alg/generic/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/json/%.cpp +$(OUTDIR)/%.o : ../../lib/data/ponvif/%.cpp $(COMPILE) $(OUTDIR)/%.o : ../../lib/data/NginxMediaServer/%.cpp $(COMPILE) +$(OUTDIR)/%.o : ../../lib/hardware/sensors/lrf/%.cpp + $(COMPILE) + # Build rules all: $(OUTFILE) -$(OUTFILE): $(OUTDIR) $(OBJ) +$(OUTFILE): $(OUTDIR) $(OBJ) $(LINK) $(OUTDIR): $(MKDIR) -p "$(OUTDIR)" # Rebuild this project -rebuild: cleanall all +rebuild: cleanall + @$(MAKE) -f "$(strip $(MAKEFILE_LIST))" $(MAKEFLAGS) all # Clean this project clean: @@ -272,12 +269,11 @@ COMMON_OBJ=$(OUTDIR)/ArgusBackend.o $(OUTDIR)/base64.o \ $(OUTDIR)/rgooseNodePTZCamControl.o \ $(OUTDIR)/rgooseNodeStaticCamControl.o \ $(OUTDIR)/rgooseServerModule.o $(OUTDIR)/rgooseTargetFilter.o \ - $(OUTDIR)/serialPort.o $(OUTDIR)/serialSOL.o $(OUTDIR)/serverPort.o \ - $(OUTDIR)/servletChannelWS.o $(OUTDIR)/servletClientHandlerWS.o \ - $(OUTDIR)/servletWS.o $(OUTDIR)/ssdpAnnouncer.o \ - $(OUTDIR)/Transform.o $(OUTDIR)/transportSerial.o \ - $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \ - $(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/xmlParser.o + $(OUTDIR)/serverPort.o $(OUTDIR)/servletChannelWS.o \ + $(OUTDIR)/servletClientHandlerWS.o $(OUTDIR)/servletWS.o \ + $(OUTDIR)/ssdpAnnouncer.o $(OUTDIR)/Transform.o \ + $(OUTDIR)/transportSerial.o $(OUTDIR)/transportSocket.o \ + $(OUTDIR)/utm.o $(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/xmlParser.o OBJ=$(COMMON_OBJ) $(CFG_OBJ) ALL_OBJ=$(OUTDIR)/ArgusBackend.o $(OUTDIR)/base64.o \ $(OUTDIR)/basicCameraInfo.o $(OUTDIR)/basicDualThread.o \ @@ -323,89 +319,87 @@ ALL_OBJ=$(OUTDIR)/ArgusBackend.o $(OUTDIR)/base64.o \ $(OUTDIR)/rgooseNodePTZCamControl.o \ $(OUTDIR)/rgooseNodeStaticCamControl.o \ $(OUTDIR)/rgooseServerModule.o $(OUTDIR)/rgooseTargetFilter.o \ - $(OUTDIR)/serialPort.o $(OUTDIR)/serialSOL.o $(OUTDIR)/serverPort.o \ - $(OUTDIR)/servletChannelWS.o $(OUTDIR)/servletClientHandlerWS.o \ - $(OUTDIR)/servletWS.o $(OUTDIR)/ssdpAnnouncer.o \ - $(OUTDIR)/Transform.o $(OUTDIR)/transportSerial.o \ - $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \ - $(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/xmlParser.o -lpthread \ - -lmysqlclient -lssl -lcurl -lm -lcrypto -lconfig -lz -lv4l1 -lv4l2 \ - -lhidapi-libusb `pkg-config libavcodec libavdevice libavfilter \ - libavformat libavutil libpostproc libswresample libswscale --libs` \ - -latomic `pkg-config --libs openssl libssl opencv4 rdkafka++` + $(OUTDIR)/serverPort.o $(OUTDIR)/servletChannelWS.o \ + $(OUTDIR)/servletClientHandlerWS.o $(OUTDIR)/servletWS.o \ + $(OUTDIR)/ssdpAnnouncer.o $(OUTDIR)/Transform.o \ + $(OUTDIR)/transportSerial.o $(OUTDIR)/transportSocket.o \ + $(OUTDIR)/utm.o $(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/xmlParser.o \ + -lpthread -lmysqlclient -lssl -lcurl -lm -lcrypto -lconfig -lz \ + -lv4l1 -lv4l2 -lhidapi-libusb `pkg-config libavcodec libavdevice \ + libavfilter libavformat libavutil libpostproc libswresample \ + libswscale --libs` -latomic `pkg-config --libs openssl libssl \ + opencv4 rdkafka++` COMPILE=g++ -c -x c++ "-D__STDC_CONSTANT_MACROS" "-D_CLIENT_APPLICATION_" "-D_OPENCV_" -O3 -std=c++11 -Wno-write-strings -I../../lib/include `pkg-config libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale --cflags` -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $< LINK=g++ -O3 -o "$(OUTFILE)" $(ALL_OBJ) # Pattern rules -$(OUTDIR)/%.o : ../../lib/data/transport/%.cpp - $(COMPILE) - -$(OUTDIR)/%.o : ../../lib/data/protocol/%.cpp - $(COMPILE) - -$(OUTDIR)/%.o : ../../lib/alg/lgs/%.cpp +$(OUTDIR)/%.o : ../../lib/rgoose/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/ssdp/%.cpp +$(OUTDIR)/%.o : ../../lib/components/object/%.cpp $(COMPILE) $(OUTDIR)/%.o : ../../lib/App/argus/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/rgoose/%.cpp +$(OUTDIR)/%.o : ../../lib/data/json/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/ponvif/%.cpp +$(OUTDIR)/%.o : ../../lib/data/transport/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/alg/generic/%.cpp +$(OUTDIR)/%.o : ../../lib/data/protocol/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/components/base/%.cpp +$(OUTDIR)/%.o : ../../lib/data/net/%.cpp $(COMPILE) $(OUTDIR)/%.o : ../../lib/data/media/video/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/hardware/uart/%.cpp +$(OUTDIR)/%.o : ../../lib/data/servletWS/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/hardware/sensors/lrf/%.cpp +$(OUTDIR)/%.o : ../../lib/alg/lgs/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/components/object/%.cpp +$(OUTDIR)/%.o : ../../lib/data/ssdp/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/servletWS/%.cpp +$(OUTDIR)/%.o : ../../lib/data/mysql/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/net/%.cpp +$(OUTDIR)/%.o : ../../lib/components/base/%.cpp $(COMPILE) $(OUTDIR)/%.o : ../../lib/data/curl/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/mysql/%.cpp +$(OUTDIR)/%.o : ../../lib/alg/generic/%.cpp $(COMPILE) -$(OUTDIR)/%.o : ../../lib/data/json/%.cpp +$(OUTDIR)/%.o : ../../lib/data/ponvif/%.cpp $(COMPILE) $(OUTDIR)/%.o : ../../lib/data/NginxMediaServer/%.cpp $(COMPILE) +$(OUTDIR)/%.o : ../../lib/hardware/sensors/lrf/%.cpp + $(COMPILE) + # Build rules all: $(OUTFILE) -$(OUTFILE): $(OUTDIR) $(OBJ) +$(OUTFILE): $(OUTDIR) $(OBJ) $(LINK) $(OUTDIR): $(MKDIR) -p "$(OUTDIR)" # Rebuild this project -rebuild: cleanall all +rebuild: cleanall + @$(MAKE) -f "$(strip $(MAKEFILE_LIST))" $(MAKEFLAGS) all # Clean this project clean: @@ -415,3 +409,101 @@ clean: # Clean this project and all dependencies cleanall: clean endif + +# +# include dependencies: +# +$(OUTDIR)/ArgusBackend.o: ../../lib/App/argus/ArgusBackend.cpp ../../lib/App/argus/ArgusBackend.h ../../lib/components/base/basicSettings.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicMemoryOperation.h ../../lib/components/object/objectFileLoggingService.h ../../lib/components/object/objectConsoleLoggingService.h ../../lib/data/net/netServer.h ../../lib/data/mysql/database_class.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseKernel.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEngine.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseIPCamera.h ../../lib/rgoose/rgooseNodeFactory.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleFactory.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseHardwareManager.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h +$(OUTDIR)/base64.o: ../../lib/alg/generic/base64.cpp ../../lib/alg/generic/base64.h +$(OUTDIR)/basicCameraInfo.o: ../../lib/components/base/basicCameraInfo.cpp ../../lib/components/base/basicCameraInfo.h +$(OUTDIR)/basicDualThread.o: ../../lib/components/base/basicDualThread.cpp ../../lib/components/base/basicDualThread.h +$(OUTDIR)/basicEngine.o: ../../lib/components/base/basicEngine.cpp ../../lib/components/base/basicEngine.h +$(OUTDIR)/basicEvent.o: ../../lib/components/base/basicEvent.cpp ../../lib/components/base/basicEvent.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h +$(OUTDIR)/basicEventHandler.o: ../../lib/components/base/basicEventHandler.cpp ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicEventHeap.h +$(OUTDIR)/basicEventHeap.o: ../../lib/components/base/basicEventHeap.cpp ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h +$(OUTDIR)/basicFunctionality.o: ../../lib/components/base/basicFunctionality.cpp ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicLogCollection.h +$(OUTDIR)/basicLIBAV.o: ../../lib/components/base/basicLIBAV.cpp ../../lib/components/base/basicLIBAV.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h +$(OUTDIR)/basicLogCollection.o: ../../lib/components/base/basicLogCollection.cpp ../../lib/components/base/basicLogCollection.h ../../lib/alg/generic/heapDebug.h +$(OUTDIR)/basicLoggingService.o: ../../lib/components/base/basicLoggingService.cpp ../../lib/components/base/basicLoggingService.h +$(OUTDIR)/basicMediaDestination.o: ../../lib/components/base/basicMediaDestination.cpp ../../lib/components/base/basicMediaDestination.h +$(OUTDIR)/basicMediaSource.o: ../../lib/components/base/basicMediaSource.cpp ../../lib/components/base/basicMediaSource.h +$(OUTDIR)/basicMutex.o: ../../lib/components/base/basicMutex.cpp ../../lib/components/base/basicMutex.h +$(OUTDIR)/basicObject.o: ../../lib/components/base/basicObject.cpp ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h +$(OUTDIR)/basicPosition.o: ../../lib/components/base/basicPosition.cpp ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h +$(OUTDIR)/basicRing.o: ../../lib/components/base/basicRing.cpp ../../lib/components/base/basicRing.h +$(OUTDIR)/basicSettings.o: ../../lib/components/base/basicSettings.cpp ../../lib/components/base/basicSettings.h +$(OUTDIR)/basicSettingsProvider.o: ../../lib/components/base/basicSettingsProvider.cpp ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h +$(OUTDIR)/basicThread.o: ../../lib/components/base/basicThread.cpp ../../lib/components/base/basicThread.h +$(OUTDIR)/basicTimeStamp.o: ../../lib/components/base/basicTimeStamp.cpp ../../lib/components/base/basicTimeStamp.h +$(OUTDIR)/basicTransport.o: ../../lib/components/base/basicTransport.cpp ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/protocol/protocol.h +$(OUTDIR)/basicTypes.o: ../../lib/components/base/basicTypes.cpp ../../lib/components/base/basicTypes.h +$(OUTDIR)/clientPort.o: ../../lib/data/net/clientPort.cpp ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h +$(OUTDIR)/curlRequest.o: ../../lib/data/curl/curlRequest.cpp ../../lib/data/curl/curlRequest.h +$(OUTDIR)/curlRequestsManager.o: ../../lib/data/curl/curlRequestsManager.cpp ../../lib/data/curl/curlRequestsManager.h +$(OUTDIR)/database_class.o: ../../lib/data/mysql/database_class.cpp ../../lib/data/mysql/database_class.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicMutex.h +$(OUTDIR)/heapDebug.o: ../../lib/alg/generic/heapDebug.cpp ../../lib/alg/generic/heapDebug.h +$(OUTDIR)/json_reader.o: ../../lib/data/json/json_reader.cpp ../../lib/data/json/json_tool.h +$(OUTDIR)/json_value.o: ../../lib/data/json/json_value.cpp ../../lib/data/json/json_valueiterator.inl +$(OUTDIR)/json_writer.o: ../../lib/data/json/json_writer.cpp ../../lib/data/json/json_tool.h +$(OUTDIR)/libzip.o: ../../lib/alg/generic/libzip.cpp ../../lib/alg/generic/libzip.h +$(OUTDIR)/lrf_3d.o: ../../lib/hardware/sensors/lrf/lrf_3d.cpp ../../lib/hardware/sensors/lrf/lrf_3d.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/protocol/protocolLGS3D_client.h ../../lib/data/protocol/protocolLGS3D.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolLGS_data.h ../../lib/alg/lgs/detectorStructures.h ../../lib/hardware/soc/general/3DLRF.h +$(OUTDIR)/mask.o: ../../lib/alg/lgs/mask.cpp ../../lib/alg/lgs/mask.h +$(OUTDIR)/md5.o: ../../lib/alg/generic/md5.cpp ../../lib/alg/generic/md5.h +$(OUTDIR)/mediaNginxStreamingProxyManager.o: ../../lib/data/NginxMediaServer/mediaNginxStreamingProxyManager.cpp ../../lib/data/NginxMediaServer/mediaNginxStreamingProxyManager.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicMutex.h +$(OUTDIR)/objectConsoleLoggingService.o: ../../lib/components/object/objectConsoleLoggingService.cpp ../../lib/components/object/objectConsoleLoggingService.h +$(OUTDIR)/objectFileLoggingService.o: ../../lib/components/object/objectFileLoggingService.cpp ../../lib/components/object/objectFileLoggingService.h +$(OUTDIR)/objectSystemAnchor.o: ../../lib/components/object/objectSystemAnchor.cpp ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicLogCollection.h +$(OUTDIR)/onvifMediaObserver.o: ../../lib/data/protocol/onvifMediaObserver.cpp ../../lib/data/protocol/onvifMediaObserver.h +$(OUTDIR)/ponvif.o: ../../lib/data/ponvif/ponvif.cpp ../../lib/data/ponvif/ponvif.h ../../lib/data/protocol/xmlParser.h ../../lib/alg/generic/base64.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/data/curl/curlRequestsManager.h +$(OUTDIR)/protocol.o: ../../lib/data/protocol/protocol.cpp ../../lib/data/protocol/protocol.h +$(OUTDIR)/protocolDefender.o: ../../lib/data/protocol/protocolDefender.cpp ../../lib/data/protocol/protocolDefender.h ../../lib/alg/generic/md5.h ../../lib/data/json/json_tool.h +$(OUTDIR)/protocolEuropeanGeneral.o: ../../lib/data/protocol/protocolEuropeanGeneral.cpp ../../lib/data/protocol/protocolEuropeanGeneral.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/md5.h +$(OUTDIR)/protocolHTTP.o: ../../lib/data/protocol/protocolHTTP.cpp ../../lib/data/protocol/protocolHTTP.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/curl/curlRequestsManager.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h +$(OUTDIR)/protocolKAFKA.o: ../../lib/data/protocol/protocolKAFKA.cpp ../../lib/data/protocol/protocolKAFKA.h ../../lib/data/protocol/protocolEuropeanGeneral.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/md5.h ../../lib/data/json/json_tool.h +$(OUTDIR)/protocolLGS2D.o: ../../lib/data/protocol/protocolLGS2D.cpp ../../lib/data/protocol/protocolLGS2D.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolLGS_data.h ../../lib/alg/lgs/detectorStructures.h ../../lib/alg/lgs/mask.h +$(OUTDIR)/protocolLGS3D.o: ../../lib/data/protocol/protocolLGS3D.cpp ../../lib/data/protocol/protocolLGS3D.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolLGS_data.h +$(OUTDIR)/protocolLGS3D_client.o: ../../lib/data/protocol/protocolLGS3D_client.cpp ../../lib/data/protocol/protocolLGS3D_client.h ../../lib/data/protocol/protocolLGS3D.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolLGS_data.h ../../lib/alg/lgs/detectorStructures.h +$(OUTDIR)/protocolMAVLINK.o: ../../lib/data/protocol/protocolMAVLINK.cpp ../../lib/data/protocol/protocolMAVLINK.h ../../lib/data/protocol/protocol.h ../../lib/data/mavlink/ardupilotmega/mavlink.h ../../lib/hardware/uart/serialPort.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h +$(OUTDIR)/protocolPTZ.o: ../../lib/data/protocol/protocolPTZ.cpp ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h +$(OUTDIR)/protocolPTZ_ONVIF.o: ../../lib/data/protocol/protocolPTZ_ONVIF.cpp ../../lib/data/protocol/protocolPTZ_ONVIF.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/ponvif/ponvif.h ../../lib/data/protocol/xmlParser.h ../../lib/alg/generic/base64.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/data/curl/curlRequestsManager.h ../../lib/data/onvif/include/onvifclient.hpp ../../lib/hardware/uart/serialPort.h +$(OUTDIR)/protocolPTZ_PELCO.o: ../../lib/data/protocol/protocolPTZ_PELCO.cpp ../../lib/data/protocol/protocolPTZ_PELCO.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/hardware/uart/serialPort.h +$(OUTDIR)/protocolPTZ_VISCA.o: ../../lib/data/protocol/protocolPTZ_VISCA.cpp ../../lib/data/protocol/protocolPTZ_VISCA.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/hardware/uart/serialPort.h +$(OUTDIR)/protocolSafeShore.o: ../../lib/data/protocol/protocolSafeShore.cpp ../../lib/data/protocol/protocolSafeShore.h ../../lib/alg/generic/md5.h +$(OUTDIR)/protocolZLMEDIA.o: ../../lib/data/protocol/protocolZLMEDIA.cpp ../../lib/data/protocol/protocolZLMEDIA.h ../../lib/data/protocol/protocolHTTP.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/curl/curlRequestsManager.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/data/json/json_tool.h +$(OUTDIR)/rgooseCamera.o: ../../lib/rgoose/rgooseCamera.cpp ../../lib/rgoose/rgooseCamera.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicMutex.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/media/video/videoAVLIBSource.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/components/base/basicCameraInfo.h ../../lib/components/object/objectSystemAnchor.h ../../lib/hardware/uart/serialPort.h ../../lib/hardware/uart/serialSOL.h ../../lib/data/protocol/protocolPTZ_VISCA.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/protocol/protocolPTZ_ONVIF.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/ponvif/ponvif.h ../../lib/data/protocol/xmlParser.h ../../lib/alg/generic/base64.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/data/curl/curlRequestsManager.h ../../lib/data/onvif/include/onvifclient.hpp ../../lib/data/protocol/protocolPTZ_PELCO.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/rgoose/rgooseKernel.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEngine.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseIPCamera.h ../../lib/rgoose/rgooseNodeFactory.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleFactory.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseHardwareManager.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleEmbedVideo.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicMediaDestination.h +$(OUTDIR)/rgooseDBConnector.o: ../../lib/rgoose/rgooseDBConnector.cpp ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h +$(OUTDIR)/rgooseFilterAPF.o: ../../lib/rgoose/rgooseFilterAPF.cpp ../../lib/rgoose/rgooseFilterAPF.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicThread.h +$(OUTDIR)/rgooseHardwareManager.o: ../../lib/rgoose/rgooseHardwareManager.cpp ../../lib/rgoose/rgooseHardwareManager.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseKernel.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEngine.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseIPCamera.h ../../lib/rgoose/rgooseNodeFactory.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleFactory.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseHardwareManager.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseHardwareResourceSerialProvider.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicDualThread.h ../../lib/rgoose/rgooseHardwareResourceNetworkProvider.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/hardware/hid/hid_dc.h ../../lib/alg/generic/heapDebug.h +$(OUTDIR)/rgooseHardwareResource.o: ../../lib/rgoose/rgooseHardwareResource.cpp ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h +$(OUTDIR)/rgooseHardwareResourceDryContactProvider.o: ../../lib/rgoose/rgooseHardwareResourceDryContactProvider.cpp ../../lib/rgoose/rgooseHardwareResourceDryContactProvider.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h +$(OUTDIR)/rgooseHardwareResourceNetworkProvider.o: ../../lib/rgoose/rgooseHardwareResourceNetworkProvider.cpp ../../lib/rgoose/rgooseHardwareResourceNetworkProvider.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h +$(OUTDIR)/rgooseHardwareResourceSerialProvider.o: ../../lib/rgoose/rgooseHardwareResourceSerialProvider.cpp ../../lib/rgoose/rgooseHardwareResourceSerialProvider.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicDualThread.h ../../lib/data/protocol/protocol.h +$(OUTDIR)/rgooseKernel.o: ../../lib/rgoose/rgooseKernel.cpp ../../lib/rgoose/rgooseKernel.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEngine.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseIPCamera.h ../../lib/rgoose/rgooseNodeFactory.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleFactory.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseHardwareManager.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseFilterAPF.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicThread.h +$(OUTDIR)/rgooseModule.o: ../../lib/rgoose/rgooseModule.cpp ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseKernel.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEngine.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseIPCamera.h ../../lib/rgoose/rgooseNodeFactory.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleFactory.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseHardwareManager.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h +$(OUTDIR)/rgooseModuleEmbedVideo.o: ../../lib/rgoose/rgooseModuleEmbedVideo.cpp ../../lib/rgoose/rgooseModuleEmbedVideo.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicMediaDestination.h ../../lib/rgoose/rgooseHardwareResourceNetworkProvider.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/alg/generic/base64.h +$(OUTDIR)/rgooseModuleFactory.o: ../../lib/rgoose/rgooseModuleFactory.cpp ../../lib/rgoose/rgooseModuleFactory.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseModuleZLMedia.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicMutex.h ../../lib/data/protocol/protocolZLMEDIA.h ../../lib/data/protocol/protocolHTTP.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/curl/curlRequestsManager.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleUSBRelay.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleKafka.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/data/protocol/protocolKAFKA.h ../../lib/data/protocol/protocolEuropeanGeneral.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/rgoose/rgooseModuleFlyHunter.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/data/protocol/protocolMAVLINK.h ../../lib/data/protocol/protocol.h ../../lib/data/mavlink/ardupilotmega/mavlink.h ../../lib/hardware/uart/serialPort.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/rgoose/rgooseModuleSSDP.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseModuleOnvifObserver.h ../../lib/data/protocol/xmlParser.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseModuleEmbedVideo.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicMediaDestination.h ../../lib/alg/generic/heapDebug.h +$(OUTDIR)/rgooseModuleFlyHunter.o: ../../lib/rgoose/rgooseModuleFlyHunter.cpp ../../lib/rgoose/rgooseModuleFlyHunter.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/data/protocol/protocolMAVLINK.h ../../lib/data/protocol/protocol.h ../../lib/data/mavlink/ardupilotmega/mavlink.h ../../lib/hardware/uart/serialPort.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h +$(OUTDIR)/rgooseModuleKafka.o: ../../lib/rgoose/rgooseModuleKafka.cpp ../../lib/rgoose/rgooseModuleKafka.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/data/protocol/protocolKAFKA.h ../../lib/data/protocol/protocolEuropeanGeneral.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/data/json/json_tool.h +$(OUTDIR)/rgooseModuleOnvifObserver.o: ../../lib/rgoose/rgooseModuleOnvifObserver.cpp ../../lib/rgoose/rgooseModuleOnvifObserver.h ../../lib/data/protocol/xmlParser.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseKernel.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEngine.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseIPCamera.h ../../lib/rgoose/rgooseNodeFactory.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleFactory.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseHardwareManager.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseHardwareResourceNetworkProvider.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h +$(OUTDIR)/rgooseModuleSSDP.o: ../../lib/rgoose/rgooseModuleSSDP.cpp ../../lib/rgoose/rgooseModuleSSDP.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHeap.h +$(OUTDIR)/rgooseModuleUSBRelay.o: ../../lib/rgoose/rgooseModuleUSBRelay.cpp ../../lib/rgoose/rgooseModuleUSBRelay.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h +$(OUTDIR)/rgooseModuleZLMedia.o: ../../lib/rgoose/rgooseModuleZLMedia.cpp ../../lib/rgoose/rgooseModuleZLMedia.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicMutex.h ../../lib/data/protocol/protocolZLMEDIA.h ../../lib/data/protocol/protocolHTTP.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/curl/curlRequestsManager.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseKernel.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEngine.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseIPCamera.h ../../lib/rgoose/rgooseNodeFactory.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleFactory.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseHardwareManager.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/alg/generic/md5.h +$(OUTDIR)/rgooseNode.o: ../../lib/rgoose/rgooseNode.cpp ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h +$(OUTDIR)/rgooseNode2D.o: ../../lib/rgoose/rgooseNode2D.cpp ../../lib/rgoose/rgooseNode2D.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/data/protocol/protocolLGS2D.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolLGS_data.h ../../lib/alg/lgs/detectorStructures.h ../../lib/alg/lgs/mask.h ../../lib/rgoose/rgooseHardwareResourceSerialProvider.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicDualThread.h ../../lib/rgoose/rgooseKernel.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEngine.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseIPCamera.h ../../lib/rgoose/rgooseNodeFactory.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseModuleFactory.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicMutex.h ../../lib/rgoose/rgooseHardwareManager.h ../../lib/rgoose/rgooseHardwareResource.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h +$(OUTDIR)/rgooseNode3D.o: ../../lib/rgoose/rgooseNode3D.cpp ../../lib/rgoose/rgooseNode3D.h ../../lib/hardware/sensors/lrf/lrf_3d.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/protocol/protocolLGS3D_client.h ../../lib/data/protocol/protocolLGS3D.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolLGS_data.h ../../lib/alg/lgs/detectorStructures.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h +$(OUTDIR)/rgooseNodeFactory.o: ../../lib/rgoose/rgooseNodeFactory.cpp ../../lib/rgoose/rgooseNodeFactory.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseIPCamera.h ../../lib/rgoose/rgooseNode3D.h ../../lib/hardware/sensors/lrf/lrf_3d.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/protocol/protocolLGS3D_client.h ../../lib/data/protocol/protocolLGS3D.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolLGS_data.h ../../lib/alg/lgs/detectorStructures.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/rgoose/rgooseNode2D.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/data/protocol/protocolLGS2D.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolLGS_data.h ../../lib/alg/lgs/detectorStructures.h ../../lib/alg/lgs/mask.h ../../lib/rgoose/rgooseNodePTZCamControl.h ../../lib/rgoose/rgooseCamera.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicMutex.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/media/video/videoAVLIBSource.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseNodeStaticCamControl.h ../../lib/rgoose/rgooseCamera.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicMutex.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/media/video/videoAVLIBSource.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicEventHeap.h ../../lib/alg/generic/heapDebug.h +$(OUTDIR)/rgooseNodePTZCamControl.o: ../../lib/rgoose/rgooseNodePTZCamControl.cpp ../../lib/rgoose/rgooseNodePTZCamControl.h ../../lib/rgoose/rgooseCamera.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicMutex.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/media/video/videoAVLIBSource.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicEventHeap.h +$(OUTDIR)/rgooseNodeStaticCamControl.o: ../../lib/rgoose/rgooseNodeStaticCamControl.cpp ../../lib/rgoose/rgooseNodeStaticCamControl.h ../../lib/rgoose/rgooseCamera.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicMutex.h ../../lib/data/protocol/protocolPTZ.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/media/video/videoAVLIBSource.h ../../lib/components/base/basicEventHeap.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseNode.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/utm.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicEventHeap.h +$(OUTDIR)/rgooseServerModule.o: ../../lib/rgoose/rgooseServerModule.cpp ../../lib/rgoose/rgooseServerModule.h ../../lib/rgoose/rgooseDBConnector.h ../../lib/rgoose/rgooseTypes.h ../../lib/rgoose/rgooseModule.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicStatus.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicEvent.h +$(OUTDIR)/rgooseTargetFilter.o: ../../lib/rgoose/rgooseTargetFilter.cpp ../../lib/rgoose/rgooseTargetFilter.h ../../lib/components/base/basicEvent.h +$(OUTDIR)/serverPort.o: ../../lib/data/net/serverPort.cpp ../../lib/data/net/serverPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h +$(OUTDIR)/servletChannelWS.o: ../../lib/data/servletWS/servletChannelWS.cpp ../../lib/data/servletWS/servletChannelWS.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h +$(OUTDIR)/servletClientHandlerWS.o: ../../lib/data/servletWS/servletClientHandlerWS.cpp ../../lib/data/servletWS/servletClientHandlerWS.h ../../lib/components/base/basicThread.h ../../lib/alg/generic/libzip.h ../../lib/data/servletWS/servletWS.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/base64.h +$(OUTDIR)/servletWS.o: ../../lib/data/servletWS/servletWS.cpp ../../lib/data/servletWS/servletWS.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h +$(OUTDIR)/ssdpAnnouncer.o: ../../lib/data/ssdp/ssdpAnnouncer.cpp ../../lib/data/ssdp/ssdpAnnouncer.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h +$(OUTDIR)/Transform.o: ../../lib/alg/generic/Transform.cpp ../../lib/alg/generic/Transform.h ../../lib/components/base/basicLogCollection.h +$(OUTDIR)/transportSerial.o: ../../lib/data/transport/transportSerial.cpp ../../lib/data/transport/transportSerial.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/protocol/protocol.h +$(OUTDIR)/transportSocket.o: ../../lib/data/transport/transportSocket.cpp ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicTransport.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/data/protocol/protocol.h +$(OUTDIR)/utm.o: ../../lib/alg/generic/utm.cpp ../../lib/alg/generic/utm.h +$(OUTDIR)/videoAVLIBSource.o: ../../lib/data/media/video/videoAVLIBSource.cpp ../../lib/data/media/video/videoAVLIBSource.h +$(OUTDIR)/xmlParser.o: ../../lib/data/protocol/xmlParser.cpp ../../lib/data/protocol/xmlParser.h diff --git a/lib/alg/generic/md5.cpp b/lib/alg/generic/md5.cpp index b3428fd5..164e7ea9 100644 --- a/lib/alg/generic/md5.cpp +++ b/lib/alg/generic/md5.cpp @@ -100,7 +100,14 @@ char* MD5String(char* szString) return PrintMD5(alg.Digest()); } - +// MD5Binary: Performs the MD5 algorithm on a byte array, returning +// the results as a char*. +char * MD5Binary( u_char *bin, size_t len ){ + md5 alg; + alg.Update( bin, len ); + alg.Finalize(); + return PrintMD5(alg.Digest()); +}; // MD5File: Performs the MD5 algorithm on a file (binar or text), // returning the results as a char*. Returns NULL if it fails. char* MD5File(char* szFilename) diff --git a/lib/alg/generic/md5.h b/lib/alg/generic/md5.h index 07c39293..bed73785 100644 --- a/lib/alg/generic/md5.h +++ b/lib/alg/generic/md5.h @@ -42,6 +42,7 @@ typedef unsigned char u_char; char* PrintMD5(u_char md5Digest[16]); char* MD5String(char* szString); +char* MD5Binary( u_char *bin, size_t len ); char* MD5File(char* szFilename); class md5{ diff --git a/lib/components/base/basicEvent.h b/lib/components/base/basicEvent.h index 031b5583..1ee1621a 100644 --- a/lib/components/base/basicEvent.h +++ b/lib/components/base/basicEvent.h @@ -28,24 +28,24 @@ #define NODE_ID(X) (0x4000FFFF&X) typedef enum E_basicEventTypeID { - EVT_NOINIT = 0, - EVT_READY = 1, - EVT_ALARM = 2, - EVT_COMMAND = 3, - EVT_KEY = 4, - EVT_JOYSTICK = 5, - EVT_STUDY = 6, - EVT_BUSY = 7, - EVT_FLIP = 8, - EVT_SCAN = 9, - EVT_TARGET_1D = 10, // CLD - No Target Cords, using Device Cords as Target - EVT_TARGET_3D_WHITE = 11, // 3D System - Range Angle Width - EVT_TARGET_3D_BLACK = 12, // 3D System - Range Angle Width - EVT_TARGET_2D_WHITE = 13, // 2D System - Range Azimuth Elevation [Width] - EVT_TARGET_2D_BLACK = 14, // 2D System - Range Azimuth Elevation [Width] - EVT_CAPTURE_START = 15, - EVT_CAPTURE_END = 16, - EVT_CAPTURE_DONE = 17, + EVT_NOINIT = 0, + EVT_READY = 1, + EVT_ALARM = 2, + EVT_COMMAND = 3, + EVT_KEY = 4, + EVT_JOYSTICK = 5, + EVT_STUDY = 6, + EVT_BUSY = 7, + EVT_FLIP = 8, + EVT_SCAN = 9, + EVT_TARGET_1D = 10, // CLD - No Target Cords, using Device Cords as Target + EVT_TARGET_3D_WHITE = 11, // 3D System - Range Angle Width + EVT_TARGET_3D_BLACK = 12, // 3D System - Range Angle Width + EVT_TARGET_2D_WHITE = 13, // 2D System - Range Azimuth Elevation [Width] + EVT_TARGET_2D_BLACK = 14, // 2D System - Range Azimuth Elevation [Width] + EVT_CAPTURE_START = 15, + EVT_CAPTURE_END = 16, + EVT_CAPTURE_DONE = 17, EVT_FH_MISSION_BEGIN = 18, // FH_CTRL_DATA EVT_FH_CANCEL_ACTION = 19, // FH_CTRL_DATA @@ -63,9 +63,10 @@ typedef enum E_basicEventTypeID { EVT_FH_LANDED = 31, // NO Data EVT_FH_BUSY = 32, // FH_CTRL_DATA - EVT_CAMERA_DM = 33, - EVT_ERROR = 34, - EVT_COUNT = 35 + EVT_CAMERA_DM = 33, + EVT_CAMERA_ON_POSITION = 34, + EVT_ERROR = 35, + EVT_COUNT = 36 } basicEventTypeID; diff --git a/lib/components/base/basicThread.cpp b/lib/components/base/basicThread.cpp index c47f5dc5..a710a91b 100644 --- a/lib/components/base/basicThread.cpp +++ b/lib/components/base/basicThread.cpp @@ -66,23 +66,23 @@ void basicThread::m_fThreadProc( void ){ void basicThread::waitThreadEnd(bool forced){ if( m_bThreadStatus > TH_WORKING || m_bThreadStatus < TH_ARMED ) return; if( forced ) m_bThreadStatus = TH_ENDED; - while (m_bThreadStatus != TH_EXIT) SLEEP(1);//DEFAULT_THREAD_SLEEP_TIME); + while (m_bThreadStatus != TH_EXIT) SLEEP( DEFAULT_THREAD_SLEEP_TIME ); #if defined( __linux__ ) || defined(WIN_PTHREAD) pthread_join(m_sThreadHandler, NULL); #else - WaitForSingleObject(m_hThreadHandle, 2000); + WaitForSingleObject(m_hThreadHandle, DEFAULT_THREAD_SLEEP_TIME); CloseHandle(m_hThreadHandle); #endif }; bool basicThread::uninit( void ){ if( m_bThreadStatus == TH_PRE_INIT ) return true; - while( m_bThreadStatus < TH_WORKING ) SLEEP(1); + while( m_bThreadStatus < TH_WORKING ) SLEEP( DEFAULT_THREAD_SLEEP_TIME ); m_bThreadStatus = TH_ENDED; - while( m_bThreadStatus < TH_EXIT ) SLEEP(1); + while( m_bThreadStatus < TH_EXIT ) SLEEP( DEFAULT_THREAD_SLEEP_TIME ); #if defined( __linux__ ) || defined(WIN_PTHREAD) pthread_join(m_sThreadHandler, NULL); #else - WaitForSingleObject(m_hThreadHandle, 2000); + WaitForSingleObject(m_hThreadHandle, DEFAULT_THREAD_SLEEP_TIME); CloseHandle(m_hThreadHandle); #endif return true; diff --git a/lib/data/media/video/videoAVLIBSource.cpp b/lib/data/media/video/videoAVLIBSource.cpp index 4b45eef1..07a8be10 100644 --- a/lib/data/media/video/videoAVLIBSource.cpp +++ b/lib/data/media/video/videoAVLIBSource.cpp @@ -230,7 +230,8 @@ bool videoAVLIBSource::_stop(void){ bool videoAVLIBSource::_open(char *URI, bool ShowDeviceMenu, float framerate, int inputPin, int width, int height, bool scaled, int s_width, int s_height ){ if (m_pVideoState == NULL) return false; - if (m_pVideoState->m_bStatus == MS_INIT){ + if (m_bThreadStatus > TH_PRE_INIT ) return false; + if (m_pVideoState->m_bStatus == MS_INIT) { char Buffer[1024] = {0}; char tChar[128] = {0}; sprintf( m_pCookie, "%s", MD5String(URI) ); @@ -524,24 +525,29 @@ bool videoAVLIBSource::_open(char *URI, bool ShowDeviceMenu, float framerate, in #ifdef PROCESS_YUV420P m_pOut_buffer = (uint8_t *) av_malloc( av_image_get_buffer_size( AV_PIX_FMT_YUV420P, m_nWidth , m_nHeight , BUFFER_ALIGN )); //avpicture_fill((AVPicture *) m_pFrameYUV, m_pOut_buffer, AV_PIX_FMT_YUV420P, m_nWidth, m_nHeight ); - av_image_fill_arrays(m_pFrameYUV->data, m_pFrameYUV->linesize, m_pOut_buffer, AV_PIX_FMT_YUV420P, m_nWidth, m_nHeight, 1); + av_image_fill_arrays( m_pFrameYUV->data, m_pFrameYUV->linesize, m_pOut_buffer, AV_PIX_FMT_YUV420P, m_nWidth, m_nHeight, BUFFER_ALIGN); m_pFrameYUV->width = m_nWidth; m_pFrameYUV->height = m_nHeight; #endif #ifdef PROCESS_BGR24 m_pOut_buffer = (uint8_t *) av_malloc( av_image_get_buffer_size( AV_PIX_FMT_BGR24, m_nWidth , m_nHeight , BUFFER_ALIGN )); - avpicture_fill( (AVPicture *) m_pFrameBGR, m_pOut_buffer, AV_PIX_FMT_BGR24, m_nWidth, m_nHeight ); - //av_image_fill_arrays(m_pFrameBGR->data, m_pFrameBGR->linesize, m_pOut_buffer, AV_PIX_FMT_BGR24, m_nWidth, m_nHeight, 1); + if( m_pOut_buffer == NULL ) return false; + //avpicture_fill((AVPicture *)m_pFrameBGR, m_pOut_buffer, AV_PIX_FMT_BGR24, m_nWidth, m_nHeight); + av_image_fill_arrays ( m_pFrameBGR->data, m_pFrameBGR->linesize, m_pOut_buffer, AV_PIX_FMT_BGR24, m_nWidth, m_nHeight, BUFFER_ALIGN); + m_pFrameBGR->width = m_nWidth; + m_pFrameBGR->height = m_nHeight; //m_pMat = cv::Mat( m_nHeight, m_nWidth, CV_8UC3, cv::Scalar(255) ); //m_pOMat = cv::Mat( m_nHeight, m_nWidth, CV_8UC3, cv::Scalar(255) ); #endif m_pPacket = (AVPacket *) av_malloc( sizeof(AVPacket) ); - // Printout FF + if ( m_pPacket == NULL ) return false; + // Printout FF //av_dump_format(m_pFormatCtx,0,filepath,0); #ifdef PROCESS_YUV420P //Col Depth 12bpp img_convert_ctx = sws_getContext(m_pVideoState->m_pCodecCtx->width, m_pVideoState->m_pCodecCtx->height, m_pVideoState->m_pCodecCtx->pix_fmt, m_nWidth, m_nHeight, AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL ); - //Col Depth 16bpp + if ( img_convert_ctx == NULL ) return false; + //Col Depth 16bpp //img_convert_ctx = sws_getContext(m_pVideoState->m_pCodecCtx->width, m_pVideoState->m_pCodecCtx->height, m_pVideoState->m_pCodecCtx->pix_fmt, m_nWidth, m_nHeight, AV_PIX_FMT_YUYV422, SWS_BICUBIC, NULL, NULL, NULL); #endif #ifdef PROCESS_BGR24 @@ -557,10 +563,13 @@ bool videoAVLIBSource::_open(char *URI, bool ShowDeviceMenu, float framerate, in NULL, NULL ); + if ( img_convert_ctx == NULL ) return false; //img_convert_ctx = sws_getContext(m_pVideoState->m_pCodecCtx->width, m_pVideoState->m_pCodecCtx->height, m_pVideoState->m_pCodecCtx->pix_fmt, m_nWidth, m_nHeight, AV_PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL); #endif m_pVideoState->m_bStatus = MS_ALOCATED; // All seems to be good -> allocating mem - if( m_bThreadStatus < TH_WORKING ) return init(); + + LOG("Allocation Done->Start Thread!"); + return init(); }; return false; }; @@ -598,11 +607,14 @@ void videoAVLIBSource::m_fThreadProc( void ){ m_pVideoState->m_bStatus = MS_STOPED; while( m_pMediaDestination == NULL && m_bThreadStatus == TH_WORKING ){ SLEEP(20); +#ifdef DEBUG + LOG("Waiting Destination"); +#endif }; #ifdef DEBUG LOG("Presentation Started."); #endif - //m_pVideoState->m_bStatus = MS_PRESENT; + m_pVideoState->m_bStatus = MS_PRESENT; av_read_play( m_pVideoState->m_pFormatCtx ); while( m_pVideoState->m_bStatus < MS_CLOSING && m_bThreadStatus != TH_ENDED ){ @@ -721,6 +733,19 @@ int save_frame_as_jpeg(AVCodecContext *pCodecCtx, AVFrame *pFrame, int FrameNo) } */ +bool videoAVLIBSource::isFinished( void ){ + if ( m_pVideoState ) { + char tT[64]; + LOG("VideoState OK"); + sprintf( tT, "VS=%d ? 8", m_pVideoState->m_bStatus ); + LOG( tT ); + return (m_pVideoState->m_bStatus == MS_CLOSED); + } else { + LOG("No VideoState Object!"); + }; + return true; +}; + #undef TLOG #undef TLOG_ERROR #undef LOG diff --git a/lib/data/media/video/videoAVLIBSource.h b/lib/data/media/video/videoAVLIBSource.h index b3a6edc9..89c144f3 100644 --- a/lib/data/media/video/videoAVLIBSource.h +++ b/lib/data/media/video/videoAVLIBSource.h @@ -41,8 +41,8 @@ class videoAVLIBSource : public basicMediaSource, public basicThread { public: bool _open( CSTR URI, bool ShowDeviceMenu = false, float framerate=-1.f, int inputPin = -1, int width = -1, int height = -1 , bool scaled=false, int s_width=-1, int s_height=-1 ); bool _close( void ); - bool _stop( void ); - bool isFinished( void ){ return !(m_bThreadStatusm_bStatus; }; return 0; }; videoAVLIBSource( void *opaque=NULL ); videoAVLIBSource( CSTR URI, void *opaque=NULL ); diff --git a/lib/data/protocol/protocol.h b/lib/data/protocol/protocol.h index 22faae99..91478e80 100644 --- a/lib/data/protocol/protocol.h +++ b/lib/data/protocol/protocol.h @@ -13,63 +13,63 @@ #define PROTO_QUEUE_MAX_PACKAGES 32 #define PROTOCOL_PARSER_BUFFER_SIZE 102400 -#ifdef DEBUG +#ifdef DEBUG_EXTRA #ifndef DUBUG_COMMUNICATION - //#define DUBUG_COMMUNICATION + #define DUBUG_COMMUNICATION #endif #endif typedef struct S_protocolPackage{ - U8 *m_pData; - size_t m_nCode; - size_t m_nSize; + U8 * m_pData; + size_t m_nCode; + size_t m_nSize; } protocolPackage; typedef std::vector< protocolPackage *> packagePoll; -class protocolParser { +class protocolParser{ private: basicLogCollection * m_pLog; U8 * m_pParserBuffer; - size_t m_nParserDataCount; - bool m_bBufferAltered; - basicMutex m_mBufferProtectorMutex; + size_t m_nParserDataCount; + bool m_bBufferAltered; + basicMutex m_mBufferProtectorMutex; #ifdef PROTOCOL_PARSER_IN_THREAD #if defined( __linux__ ) || defined(WIN_PTHREAD) - pthread_t m_sParserThreadHandler; - static void *m_fParserThreadEntryPoint(void *); + pthread_t m_sParserThreadHandler; + static void * m_fParserThreadEntryPoint(void *); #else - HANDLE m_hParserThreadHandle; - DWORD m_dwThreadID; - static DWORD WINAPI m_fParserThreadEntryPoint( LPVOID lpParameter ); + HANDLE m_hParserThreadHandle; + DWORD m_dwThreadID; + static DWORD WINAPI m_fParserThreadEntryPoint( LPVOID lpParameter ); #endif - thredStatus m_bParserThreadStatus; - void m_fParserThreadProc(void); - void waitParserThreadEnd( bool forced = false ); + thredStatus m_bParserThreadStatus; + void m_fParserThreadProc(void); + void waitParserThreadEnd( bool forced = false ); #endif protected: - basicTransport *m_oDataTransport; - CONNECTION_STATUS m_eConnectionStatus; - U8 m_bStatus; - packagePoll m_vPackagePool; - virtual int packetChecker(U8 *Buffer, size_t BufferSize){ return 0;}; - virtual protocolPackage *packetExtractor(U8 *Buffer, size_t BufferSize){ return NULL; }; - virtual bool packetHandler( protocolPackage *Package ){ return false; }; - virtual void dataEraser(U8*& tPtr); - void (*m_pCustomHandler)( protocolPackage *pPp ); + basicTransport * m_oDataTransport; + CONNECTION_STATUS m_eConnectionStatus; + U8 m_bStatus; + packagePoll m_vPackagePool; + virtual int packetChecker(U8 *Buffer, size_t BufferSize){ return 0;}; + virtual protocolPackage * packetExtractor(U8 *Buffer, size_t BufferSize){ return NULL; }; + virtual bool packetHandler( protocolPackage *Package ){ return false; }; + virtual void dataEraser(U8*& tPtr); + void (*m_pCustomHandler)( protocolPackage *pPp ); public: protocolParser(); - virtual ~protocolParser(); - virtual bool create(void); - bool parse( U8 *Buffer, size_t BufferSize ); - bool getPackage( U8 **Package, size_t *Size ); - bool setHandlerProcedure( void (*PacketHandler)( protocolPackage *pPp ) ){ - m_pCustomHandler = PacketHandler; return true; - }; - void setConnectionStatus( CONNECTION_STATUS cStatus ); - CONNECTION_STATUS getConnectionStatus( void ); - bool setTransport(basicTransport* ptrTransport, bool check_if_allready = true); - basicTransport* getCurrentTransport( void ); + virtual ~protocolParser(); + virtual bool create(void); + bool parse( U8 *Buffer, size_t BufferSize ); + bool getPackage( U8 **Package, size_t *Size ); + bool setHandlerProcedure( void (*PacketHandler)( protocolPackage *pPp ) ){ + m_pCustomHandler = PacketHandler; return true; + }; + void setConnectionStatus( CONNECTION_STATUS cStatus ); + CONNECTION_STATUS getConnectionStatus( void ); + bool setTransport(basicTransport* ptrTransport, bool check_if_allready = true); + basicTransport * getCurrentTransport( void ); }; #endif diff --git a/lib/data/protocol/protocolDefender.cpp b/lib/data/protocol/protocolDefender.cpp index b042b09e..f748d5ea 100644 --- a/lib/data/protocol/protocolDefender.cpp +++ b/lib/data/protocol/protocolDefender.cpp @@ -616,15 +616,26 @@ bool protocolDefender::packetHandler( protocolPackage *Package ){ if( Package->m_nCode != 200 ) return false; try{ Json::Value root; +#ifdef OLD_WAY_JSON Json::Reader reader; - if( !reader.parse( (char *)Package->m_pData, root ) ){ + if( !reader.parse( (char *)Package->m_pData, root ) ){ LOG_ERROR( "Error parsing the string" ); return true; }; +#else + JSONCPP_STRING err; + Json::CharReaderBuilder builder; + const std::unique_ptr reader(builder.newCharReader()); + if (!reader->parse((char *)Package->m_pData, (char *)Package->m_pData + Package->m_nSize, &root, &err)) { + LOG_ERROR( "Error parsing the string" ); + LOG_ERROR( err.c_str() ); + return true; + }; +#endif if (root.size()) { Json::Value tVal; tVal = root["mitigation"]["parameters"]["cmd"]; - if (tVal != NULL) { + if(!tVal.isNull()) { #ifdef DEBUG LOG("MITIGATION MESSAGE!"); #endif diff --git a/lib/data/protocol/protocolLGS2D.cpp b/lib/data/protocol/protocolLGS2D.cpp index a5cda6d8..347bca35 100644 --- a/lib/data/protocol/protocolLGS2D.cpp +++ b/lib/data/protocol/protocolLGS2D.cpp @@ -47,21 +47,25 @@ int protocolLGS_2D::FinishUpPackage( uint8_t *Buffer, size_t Size, uint8_t Devic int protocolLGS_2D::packetChecker(U8 *Buffer, size_t BufferSize ){ #ifdef DUBUG_COMMUNICATION - char tmp[32]; + char tmp[128]; int i; for( i=0;i< BufferSize; i++ ) { - sprintf( tmp, " 0x%02X", Buffer[i] ); + sprintf( tmp, "%03d: 0x%02X", i, Buffer[i] ); LOG(tmp); }; #endif if( Buffer[0] == 0x55 ){ if (BufferSize > 4) { if (((Buffer[SIZE_IDX] & MASTER_TAG) == ACCEPT_TAG) && (Buffer[DEV_ID_IDX] == m_bDeviceID || Buffer[DEV_ID_IDX] == 0)) { - size_t pLength = Buffer[SIZE_IDX] & 0x7F; + size_t pLength = Buffer[SIZE_IDX] & 0x7F; if (BufferSize >= (pLength + 3)) { U8 pCheckSum; pCheckSum = checksum8(Buffer, pLength + 2); - if( Buffer[pLength+3] == pCheckSum ) { +#ifdef DUBUG_COMMUNICATION + sprintf( tmp, "PSize:%d CkekIDX:%d CH: %02X CC: %02X", pLength, pLength+2, Buffer[pLength+2], pCheckSum ); + LOG( tmp ); +#endif + if( Buffer[pLength+2] == pCheckSum ) { #ifdef DUBUG_COMMUNICATION LOG((CSTR)"PacketChecker: Packet Is Recognized (0)"); #endif @@ -109,7 +113,7 @@ protocolPackage *protocolLGS_2D::packetExtractor(U8 *Buffer, size_t BufferSize ) if (BufferSize >= (pLength + 3)) { U8 pCheckSum; pCheckSum = checksum8(Buffer, pLength + 2); - if( Buffer[pLength+3] == pCheckSum ) { + if( Buffer[pLength+2] == pCheckSum ) { RetVal = (protocolPackage *) malloc(sizeof(protocolPackage)); if( RetVal == NULL ) return NULL; RetVal->m_pData = (U8*)malloc(pLength + 3); diff --git a/lib/data/protocol/protocolMAVLINK.cpp b/lib/data/protocol/protocolMAVLINK.cpp index 3379950f..349cc087 100644 --- a/lib/data/protocol/protocolMAVLINK.cpp +++ b/lib/data/protocol/protocolMAVLINK.cpp @@ -15,7 +15,6 @@ static inline uint16_t x25_crc_calculate( uint8_t *pBuffer, size_t length ){ }; protocolMAVLINK::protocolMAVLINK(config_setting_t* m_pSettings):protocolParser(){ - m_pUART = NULL; m_nUAV_PreArmIssues = 0; m_bUAV_PreArmIssues = m_bUAV_Online = m_bPendingRequest = false; m_bCID = 0; @@ -23,40 +22,38 @@ protocolMAVLINK::protocolMAVLINK(config_setting_t* m_pSettings):protocolParser() m_bUAVID = 1; m_nIssuedCMD = -1; m_nIssuedCMDStatus = -1; - m_nComSpeed = 57600; m_pLog = basicLogCollection::getInstance(); - memset(m_pComPortName, 0, 64); memset(&m_sHeartBit, 0, sizeof(m_sHeartBit)); if ( m_pSettings != NULL) { config_setting_t * pSetting; - pSetting = config_setting_get_member(m_pSettings, "UART_PORT"); - if (pSetting == NULL) { - pSetting = config_setting_add(m_pSettings, "UART_PORT", CONFIG_TYPE_STRING); - sprintf(m_pComPortName, "COM4"); - if (pSetting != NULL) { - config_setting_set_string(pSetting, m_pComPortName); - basicSettingsProvider::getInstance()->compromise(); - }; - } else { - sprintf(m_pComPortName, "%s", config_setting_get_string(pSetting)); - }; - pSetting = config_setting_get_member(m_pSettings, "UART_SPEED"); - if (pSetting == NULL) { - pSetting = config_setting_add(m_pSettings, "UART_SPEED", CONFIG_TYPE_INT); - if (pSetting != NULL) { - config_setting_set_int(pSetting, m_nComSpeed); - basicSettingsProvider::getInstance()->compromise(); - }; - } else { - m_nComSpeed = config_setting_get_int(pSetting); - }; + //pSetting = config_setting_get_member(m_pSettings, "UART_PORT"); + //if (pSetting == NULL) { + // pSetting = config_setting_add(m_pSettings, "UART_PORT", CONFIG_TYPE_STRING); + // sprintf(m_pComPortName, "COM4"); + // if (pSetting != NULL) { + // config_setting_set_string(pSetting, m_pComPortName); + // basicSettingsProvider::getInstance()->compromise(); + // }; + //} else { + // sprintf(m_pComPortName, "%s", config_setting_get_string(pSetting)); + //}; + //pSetting = config_setting_get_member(m_pSettings, "UART_SPEED"); + //if (pSetting == NULL) { + // pSetting = config_setting_add(m_pSettings, "UART_SPEED", CONFIG_TYPE_INT); + // if (pSetting != NULL) { + // config_setting_set_int(pSetting, m_nComSpeed); + // basicSettingsProvider::getInstance()->compromise(); + // }; + //} else { + // m_nComSpeed = config_setting_get_int(pSetting); + //}; basicSettingsProvider::getInstance()->validate(); }; }; protocolMAVLINK::~protocolMAVLINK(){ - if(m_pUART!=NULL)delete(m_pUART); + //if(m_pUART!=NULL)delete(m_pUART); }; bool protocolMAVLINK::setUartDevice(CSTR a) { @@ -84,16 +81,10 @@ bool protocolMAVLINK::setUartDevice(CSTR a) { }; bool protocolMAVLINK::create() { - m_pUART = new serialPort( m_pComPortName, m_nComSpeed ); - if (m_pUART != NULL) { - LOG("Sucessfuly Created UART Line"); - m_pUART->addRecipient((protocolParser*)this); - m_nTimeOut = getMilliseconds() + TO_UAV_DISCONNECTION_MS; - } else { - char tBuffer[256]; - sprintf(tBuffer, "Error creating UART Line %d@%s", m_nComSpeed, m_pComPortName); - LOG_ERROR(tBuffer); - }; + if ( m_oDataTransport == NULL ) { + LOG_ERROR("Transport Not Assigned!"); + return false; + }; return protocolParser::create(); }; @@ -1101,7 +1092,7 @@ bool protocolMAVLINK::sendMavCommand(int component, MAV_CMD command, bool showEr m_nIssuedCMD = command; m_nIssuedCMDStatus = -1; m_bPendingRequest = true; - return m_pUART->sendData(output_buffer, len); + return m_oDataTransport->sendData(output_buffer, len); }; return false; }; @@ -1228,7 +1219,7 @@ bool protocolMAVLINK::broadcastReboot(void) { ); uint8_t output_buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t len = mavlink_msg_to_send_buffer(output_buffer, &tPacket); - return m_pUART->sendData(output_buffer, len); + return m_oDataTransport->sendData(output_buffer, len); }; return false; }; @@ -1255,7 +1246,7 @@ bool protocolMAVLINK::broadcastShutdown(void) { ); uint8_t output_buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t len = mavlink_msg_to_send_buffer(output_buffer, &tPacket); - return m_pUART->sendData(output_buffer, len); + return m_oDataTransport->sendData(output_buffer, len); }; return false; }; @@ -1282,7 +1273,7 @@ bool protocolMAVLINK::setTargetPosition(float x, float y, float z, float yaw){ ); uint8_t output_buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t len = mavlink_msg_to_send_buffer(output_buffer, &tPacket); - return m_pUART->sendData(output_buffer, len); + return m_oDataTransport->sendData(output_buffer, len); }; return false; }; @@ -1358,7 +1349,7 @@ bool protocolMAVLINK::setMode(int mode) { mavlink_msg_set_mode_pack(m_bSID, MAV_COMP_ID_AUTOPILOT1, &msg, (uint8_t)m_bUAVID, newMode, (uint16_t)m_sHeartBit.custom_mode); uint8_t output_buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t len = mavlink_msg_to_send_buffer(output_buffer, &msg); - return m_pUART->sendData(output_buffer, len); + return m_oDataTransport->sendData(output_buffer, len); }; return false; @@ -1405,7 +1396,7 @@ bool protocolMAVLINK::setModeArm(uint8_t newBaseMode, uint32_t newCustomMode) { #endif // DEBUG uint8_t output_buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t len = mavlink_msg_to_send_buffer(output_buffer, &msg); - return m_pUART->sendData(output_buffer, len); + return m_oDataTransport->sendData(output_buffer, len); } else { #ifdef DEBUG char tBuff[256]; diff --git a/lib/data/protocol/protocolMAVLINK.h b/lib/data/protocol/protocolMAVLINK.h index 3614416c..aaf43e14 100644 --- a/lib/data/protocol/protocolMAVLINK.h +++ b/lib/data/protocol/protocolMAVLINK.h @@ -61,9 +61,9 @@ enum Mode { class protocolMAVLINK: public protocolParser { private: basicLogCollection * m_pLog; - char m_pComPortName[64]; - serialPort * m_pUART; - uint32_t m_nComSpeed; + //char m_pComPortName[64]; + //serialPort * m_pUART; + //uint32_t m_nComSpeed; /* Mavlink communication Params */ uint8_t m_bCID; // Channel ID uint8_t m_bSID; // System ID @@ -149,7 +149,7 @@ class protocolMAVLINK: public protocolParser { explicit protocolMAVLINK(config_setting_t* Settings = NULL); virtual ~protocolMAVLINK(); virtual bool create(void); - CSTR getUartDevice(void) { return (CSTR)m_pComPortName; }; + //CSTR getUartDevice(void) { return (CSTR)m_pComPortName; }; int getLastCmdStatus(void); /* Protocol Outbond Messages */ bool broadcastReboot(void); diff --git a/lib/data/protocol/protocolPTZ.h b/lib/data/protocol/protocolPTZ.h index ad64cff5..af52e554 100644 --- a/lib/data/protocol/protocolPTZ.h +++ b/lib/data/protocol/protocolPTZ.h @@ -75,6 +75,7 @@ class protocolPTZ: public protocolParser { CAM_WB_MODE m_eWB_Mode; CAM_EXP_MODE m_eExp_Mode; U8 m_bLastCommandIssued; + U8 m_bProtocolDeviceID; bool m_bPowerSave_Mode; bool m_bAutoFocus_Mode; bool m_bBackLight_Mode; @@ -117,6 +118,8 @@ class protocolPTZ: public protocolParser { virtual bool setTiltPos( double dTilt ){ return true; }; virtual bool setZoom( double nZoom ){ return true; }; + void setProtocolDeviceID( U8 device_id ){ m_bProtocolDeviceID = device_id; }; + virtual double getPan( void ){ return m_dPan; }; virtual double getTilt( void ){ return m_dTilt; }; virtual double getZoom( void ){ return m_dZoom; }; diff --git a/lib/data/protocol/protocolPTZ_PELCO.cpp b/lib/data/protocol/protocolPTZ_PELCO.cpp index 26ebeac1..81e2b75a 100644 --- a/lib/data/protocol/protocolPTZ_PELCO.cpp +++ b/lib/data/protocol/protocolPTZ_PELCO.cpp @@ -1,5 +1,4 @@ #include "protocolPTZ_PELCO.h" -#include "../../hardware/uart/serialPort.h" #define LOG( X ) m_pLog->Log( "Proto[PELCO]", this, X ) #define LOG_ERROR( X ) m_pLog->Log( "Proto[PELCO]", this, _LOG_ERROR, X ) @@ -9,7 +8,7 @@ protocolPTZ_PELCO::protocolPTZ_PELCO(config_setting_t *Settings): protocolPTZ(), m_pSettings = Settings; m_bReplyRequired = false; m_bDPlusEna = false; - m_bCAM_ID = 1; + m_bProtocolDeviceID = 1; m_bLastCommandIssued = CMD_PTZ_NOOP; }; @@ -18,7 +17,7 @@ protocolPTZ_PELCO::protocolPTZ_PELCO( uint8_t CAM_ID ): protocolPTZ(), m_mInquir m_pSettings = NULL; m_bReplyRequired = false; m_bDPlusEna = false; - m_bCAM_ID = CAM_ID; + m_bProtocolDeviceID = CAM_ID; m_bLastCommandIssued = CMD_PTZ_NOOP; }; @@ -28,7 +27,7 @@ protocolPTZ_PELCO::~protocolPTZ_PELCO(){ U8 protocolPTZ_PELCO::finishUpPackage(U8 *pBuffer){ U8 nChecksum = 0; pBuffer[SYNC_IDX] = 0xFF; - pBuffer[ADR_IDX] = m_bCAM_ID; + pBuffer[ADR_IDX] = m_bProtocolDeviceID; for (U8 i = ADR_IDX; i < CHKSUM_IDX; i++) nChecksum += pBuffer[i]; pBuffer[CHKSUM_IDX] = nChecksum; return 7; @@ -37,7 +36,7 @@ U8 protocolPTZ_PELCO::finishUpPackage(U8 *pBuffer){ int protocolPTZ_PELCO::packetChecker(U8* Buffer, size_t BufferSize) { if( Buffer[0] == 0xFF ) { if( BufferSize > 1 ){ - if( Buffer[1] == 0x00 || Buffer[1] == m_bCAM_ID ) { + if( Buffer[1] == 0x00 || Buffer[1] == m_bProtocolDeviceID ) { U8 tChSumm; // Check 4 Bytes Responce if( BufferSize > 3 ){ @@ -110,7 +109,9 @@ protocolPackage *protocolPTZ_PELCO::packetExtractor(unsigned char *Buffer, size_ bool protocolPTZ_PELCO::packetHandler(protocolPackage *Package){ U8 Com_Mode; U8 Cat_Code; +#ifdef DEBUG_EXTRA LOG( "PacketHandler: Packet Is Handling"); +#endif Com_Mode = Package->m_pData[1]; Cat_Code = Package->m_pData[2]; @@ -123,11 +124,15 @@ bool protocolPTZ_PELCO::packetHandler(protocolPackage *Package){ bool protocolPTZ_PELCO::create( void ){ config_setting_t *pSetting; int tPort, tSpeed; - if (!protocolPTZ::create()) { - LOG("basic Failed!"); + m_bStatus = 0; + + if ( !protocolPTZ::create() ) return false; + + if ( m_oDataTransport == NULL ) { + LOG_ERROR("Transport Not Assigned!"); return false; }; - m_bStatus = 0; + if( m_pSettings != NULL ) { pSetting = config_setting_get_member(m_pSettings, PPTZ_TAG_COM_PORT); if (pSetting == NULL) return false; @@ -137,12 +142,12 @@ bool protocolPTZ_PELCO::create( void ){ tSpeed = config_setting_get_int(pSetting); pSetting = config_setting_get_member(m_pSettings, PPTZ_TAG_CAM_ID); if (pSetting == NULL) return false; - m_bCAM_ID = (U8)config_setting_get_int(pSetting); + m_bProtocolDeviceID = (U8)config_setting_get_int(pSetting); pSetting = config_setting_get_member(m_pSettings, PELCO_D_PLUS_ENABLE); if (pSetting != NULL) { m_bDPlusEna = (bool)config_setting_get_bool(pSetting); }; - +/* char tBuf[16]; #ifdef __linux__ sprintf( tBuf,"/dev/ttyS%d",tPort); @@ -157,12 +162,10 @@ bool protocolPTZ_PELCO::create( void ){ return true; }; }; + */ }; - if( m_oDataTransport!= NULL ) { - m_bStatus = 1; - return true; - } else LOG_ERROR("Transport Not Assigned!"); - return false; + m_bStatus = 1; + return true; }; bool protocolPTZ_PELCO::initCamera(void){ @@ -185,7 +188,7 @@ bool protocolPTZ_PELCO::getPowerSaveMode( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bCAM_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1]=0x09; Buffer[2]=0x04; Buffer[3]=0x00; @@ -203,7 +206,7 @@ bool protocolPTZ_PELCO::startZoomWide( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bCAM_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -218,7 +221,7 @@ bool protocolPTZ_PELCO::startZoomTele( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bCAM_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -233,7 +236,7 @@ bool protocolPTZ_PELCO::startZoomWide( double nSpeed ){ U8 Buffer[16]; if (m_bStatus == 0) return false; //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bCAM_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -250,7 +253,7 @@ bool protocolPTZ_PELCO::startZoomTele( double nSpeed ){ U8 Buffer[16]; if (m_bStatus == 0) return false; //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bCAM_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -267,7 +270,7 @@ bool protocolPTZ_PELCO::stopZoom( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bCAM_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -282,7 +285,7 @@ bool protocolPTZ_PELCO::stopZoom( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bCAM_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1]=0x09; Buffer[2]=0x04; Buffer[3]=0x47; @@ -413,7 +416,7 @@ bool protocolPTZ_PELCO::goAbsolute( float dPan, float dTilt, float dZoom) { U8 Buffer[16]; U8 Param1, Param2; memset(Buffer, 0, 16 ); - Buffer[0] = 0x80 + m_bCAM_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1] = 0x01; Buffer[2] = 0x06; Buffer[3] = 0x02; @@ -468,7 +471,7 @@ bool protocolPTZ_PELCO::setOSD( bool nMode ){ U8 Buffer[16]; if (m_bStatus == 0) return false; //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bCAM_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x06; Buffer[3]=0x06; diff --git a/lib/data/protocol/protocolPTZ_PELCO.h b/lib/data/protocol/protocolPTZ_PELCO.h index 0ed40bf1..571a2d78 100644 --- a/lib/data/protocol/protocolPTZ_PELCO.h +++ b/lib/data/protocol/protocolPTZ_PELCO.h @@ -17,48 +17,48 @@ class protocolPTZ_PELCO: public protocolPTZ{ private: - U8 m_bCAM_ID; + //U8 m_bCAM_ID; basicLogCollection * m_pLog; bool m_bDPlusEna; basicMutex m_mInquiryMutex; - config_setting_t *m_pSettings; + config_setting_t * m_pSettings; U8 finishUpPackage(U8 *pBuffer); protected: - protocolPackage *packetExtractor( unsigned char *Buffer, size_t BufferSize ); - int packetChecker( U8 *Buffer, size_t BufferSize ); - bool packetHandler( protocolPackage *Package ); + protocolPackage * packetExtractor( unsigned char *Buffer, size_t BufferSize ); + int packetChecker( U8 *Buffer, size_t BufferSize ); + bool packetHandler( protocolPackage *Package ); public: - explicit protocolPTZ_PELCO( config_setting_t *Settings = NULL ); - explicit protocolPTZ_PELCO( uint8_t CAM_ID ); - virtual ~protocolPTZ_PELCO(); - virtual bool create( void ); - virtual bool initCamera( void ); + explicit protocolPTZ_PELCO( config_setting_t *Settings = NULL ); + explicit protocolPTZ_PELCO( uint8_t CAM_ID ); + virtual ~protocolPTZ_PELCO(); + virtual bool create( void ); + virtual bool initCamera( void ); - virtual bool setPowerSaveMode( bool nMode ); - virtual bool setAutoFocus( bool nMode ); - virtual bool getPowerSaveMode( void ); + virtual bool setPowerSaveMode( bool nMode ); + virtual bool setAutoFocus( bool nMode ); + virtual bool getPowerSaveMode( void ); - virtual bool startZoomWide( void ); - virtual bool startZoomTele( void ); - virtual bool startZoomWide( double nSpeed ); - virtual bool startZoomTele( double nSpeed ); - virtual bool stopZoom( void ); + virtual bool startZoomWide( void ); + virtual bool startZoomTele( void ); + virtual bool startZoomWide( double nSpeed ); + virtual bool startZoomTele( double nSpeed ); + virtual bool stopZoom( void ); - virtual bool setPanPos( double dPan ); - virtual bool setTiltPos( double dTilt ); - virtual bool setZoom( double dZoom ); + virtual bool setPanPos( double dPan ); + virtual bool setTiltPos( double dTilt ); + virtual bool setZoom( double dZoom ); /* - virtual bool setPTZSpeed(double pSpeed, double tSpeed, double zSpeed); - virtual bool setPSpeed(double Speed); - virtual bool setTSpeed(double Speed); - virtual bool setZSpeed(double Speed); - virtual bool setFSpeed(double Speed); + virtual bool setPTZSpeed(double pSpeed, double tSpeed, double zSpeed); + virtual bool setPSpeed(double Speed); + virtual bool setTSpeed(double Speed); + virtual bool setZSpeed(double Speed); + virtual bool setFSpeed(double Speed); */ - virtual bool resetPTZDrive( void ); - virtual bool goHomePosition( void ); - virtual bool move(uint32_t MoveMatrix); - virtual bool goAbsolute( float dPan, float dTilt, float dZoom); - virtual bool setOSD( bool nMode ); + virtual bool resetPTZDrive( void ); + virtual bool goHomePosition( void ); + virtual bool move(uint32_t MoveMatrix); + virtual bool goAbsolute( float dPan, float dTilt, float dZoom); + virtual bool setOSD( bool nMode ); }; diff --git a/lib/data/protocol/protocolPTZ_VISCA.cpp b/lib/data/protocol/protocolPTZ_VISCA.cpp index 08c3650d..850532eb 100644 --- a/lib/data/protocol/protocolPTZ_VISCA.cpp +++ b/lib/data/protocol/protocolPTZ_VISCA.cpp @@ -1,5 +1,4 @@ #include "protocolPTZ_VISCA.h" -#include "../../hardware/uart/serialPort.h" #define LOG( X ) m_pLog->Log( "Proto[VISCA]", this, X ) #define LOG_ERROR( X ) m_pLog->Log( "Proto[VISCA]", this, _LOG_ERROR, X ) @@ -7,7 +6,7 @@ protocolPTZ_VISCA::protocolPTZ_VISCA(config_setting_t *Settings): protocolPTZ(), m_mInquiryMutex(){ m_pLog = basicLogCollection::getInstance(); m_pSettings = Settings; - m_bLANC_ID = 1; + m_bProtocolDeviceID = 1; m_bLastCommandIssued = CMD_PTZ_NOOP; memset( m_aSlots, 0 , 10 ); }; @@ -15,7 +14,7 @@ protocolPTZ_VISCA::protocolPTZ_VISCA(config_setting_t *Settings): protocolPTZ(), protocolPTZ_VISCA::protocolPTZ_VISCA( uint8_t CAM_ID ): protocolPTZ(), m_mInquiryMutex(){ m_pLog = basicLogCollection::getInstance(); m_pSettings = NULL; - m_bLANC_ID = CAM_ID; + m_bProtocolDeviceID = CAM_ID; m_bLastCommandIssued = CMD_PTZ_NOOP; memset( m_aSlots, 0 , 10 ); }; @@ -24,7 +23,7 @@ protocolPTZ_VISCA::~protocolPTZ_VISCA(){ }; int protocolPTZ_VISCA::packetChecker( unsigned char *Buffer, size_t BufferSize ){ - if( ( Buffer[0] & 0xF0 ) == ( 0x80 | m_bLANC_ID << 4 ) || ( Buffer[0] & 0xF0 ) == 0x80 ) { + if( ( Buffer[0] & 0xF0 ) == ( 0x80 | m_bProtocolDeviceID << 4 ) || ( Buffer[0] & 0xF0 ) == 0x80 ) { if( ( Buffer[0] & 0x0F ) == 0x00 || Buffer[0] == 0x88 ) { if( BufferSize > 1 ) { if( BufferSize < 16 ) { @@ -130,6 +129,7 @@ bool protocolPTZ_VISCA::packetHandler(protocolPackage *Package){ bool protocolPTZ_VISCA::create( void ){ if( !protocolPTZ::create() ) return false; + if( m_oDataTransport == NULL ) return false; if( m_pSettings != NULL ) { config_setting_t *pSetting; int tPort, tSpeed; @@ -142,7 +142,8 @@ bool protocolPTZ_VISCA::create( void ){ tSpeed = config_setting_get_int(pSetting); pSetting = config_setting_get_member(m_pSettings, PPTZ_TAG_CAM_ID); if (pSetting == NULL) return false; - m_bLANC_ID = (U8)config_setting_get_int(pSetting); + m_bProtocolDeviceID = (U8)config_setting_get_int(pSetting); + /* char tBuf[16]; #ifdef __linux__ sprintf( tBuf,"/dev/ttyS%d",tPort); @@ -156,8 +157,9 @@ bool protocolPTZ_VISCA::create( void ){ return true; }; }; + */ }; - if( m_oDataTransport == NULL ) return false; + m_bStatus = 1; return true; }; @@ -200,7 +202,7 @@ bool protocolPTZ_VISCA::setPowerSaveMode( bool nMode ){ //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; m_bPowerSave_Mode = !nMode; m_bLastCommandIssued =( m_bPowerSave_Mode )?CMD_PTZ_POWER_ON:CMD_PTZ_POWER_OFF; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x00; @@ -214,7 +216,7 @@ bool protocolPTZ_VISCA::getPowerSaveMode( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x09; Buffer[2]=0x04; Buffer[3]=0x00; @@ -232,7 +234,7 @@ bool protocolPTZ_VISCA::startZoomWide( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -246,7 +248,7 @@ bool protocolPTZ_VISCA::startZoomTele( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -260,7 +262,7 @@ bool protocolPTZ_VISCA::startZoomWide( double nSpeed ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -276,7 +278,7 @@ bool protocolPTZ_VISCA::startZoomTele( double nSpeed ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -292,7 +294,7 @@ bool protocolPTZ_VISCA::stopZoom( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x07; @@ -308,7 +310,7 @@ bool protocolPTZ_VISCA::setZoom( double nZoom ){ if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; Param = ((U16)( 0x03FF * nZoom )) & 0x03FF; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x04; Buffer[3]=0x47; @@ -326,7 +328,7 @@ double protocolPTZ_VISCA::getZoom( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x09; Buffer[2]=0x04; Buffer[3]=0x47; @@ -345,7 +347,7 @@ bool protocolPTZ_VISCA::resetPTZDrive( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x06; Buffer[3]=0x05; @@ -358,7 +360,7 @@ bool protocolPTZ_VISCA::goHomePosition( void ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x06; Buffer[3]=0x04; @@ -374,7 +376,7 @@ bool protocolPTZ_VISCA::move(uint32_t MoveMatrix){ if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; Param1 = (U8)(m_dPanSpeed * 24.0) & 0xFF; Param2 = (U8)(m_dTiltSpeed * 20.0) & 0xFF; - Buffer[0] = 0x80 + m_bLANC_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1] = 0x01; Buffer[2] = 0x06; Buffer[3] = 0x01; @@ -404,7 +406,7 @@ bool protocolPTZ_VISCA::goAbsolute( float dPan, float dTilt, float dZoom){ U8 Param1, Param2; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bLANC_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1] = 0x01; Buffer[2] = 0x06; Buffer[3] = 0x02; @@ -432,7 +434,7 @@ bool protocolPTZ_VISCA::setAutoFocus(bool nMode){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0] = 0x80 + m_bLANC_ID; + Buffer[0] = 0x80 + m_bProtocolDeviceID; Buffer[1] = 0x01; Buffer[2] = 0x04; Buffer[3] = 0x38; @@ -446,7 +448,7 @@ bool protocolPTZ_VISCA::setOSD( bool nMode ){ U8 Buffer[16]; if (m_bStatus == 0) return false; if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false; - Buffer[0]=0x80+m_bLANC_ID; + Buffer[0]=0x80+m_bProtocolDeviceID; Buffer[1]=0x01; Buffer[2]=0x06; Buffer[3]=0x06; diff --git a/lib/data/protocol/protocolPTZ_VISCA.h b/lib/data/protocol/protocolPTZ_VISCA.h index 943a979e..b4a17b34 100644 --- a/lib/data/protocol/protocolPTZ_VISCA.h +++ b/lib/data/protocol/protocolPTZ_VISCA.h @@ -6,41 +6,41 @@ class protocolPTZ_VISCA: public protocolPTZ{ private: basicLogCollection * m_pLog; - U8 m_aSlots[10]; - U8 m_bLANC_ID; - basicMutex m_mInquiryMutex; - config_setting_t *m_pSettings; + U8 m_aSlots[10]; + //U8 m_bLANC_ID; + basicMutex m_mInquiryMutex; + config_setting_t * m_pSettings; /* Internal Methods */ - bool sendIfClear(void); - bool setPowerSaveMode(bool nMode); - bool getPowerSaveMode(void); - bool startZoomWide(void); - bool startZoomTele(void); - bool startZoomWide(double nSpeed); - bool startZoomTele(double nSpeed); - bool stopZoom(void); - bool resetPTZDrive(void); - bool goHomePosition(void); + bool sendIfClear(void); + bool setPowerSaveMode(bool nMode); + bool getPowerSaveMode(void); + bool startZoomWide(void); + bool startZoomTele(void); + bool startZoomWide(double nSpeed); + bool startZoomTele(double nSpeed); + bool stopZoom(void); + bool resetPTZDrive(void); + bool goHomePosition(void); protected: - protocolPackage *packetExtractor( unsigned char *Buffer, size_t BufferSize ); - int packetChecker( U8 *Buffer, size_t BufferSize ); - //bool packetHandler( unsigned char *Buffer, size_t BufferSize ); - bool packetHandler( protocolPackage *Package ); + protocolPackage * packetExtractor( unsigned char *Buffer, size_t BufferSize ); + int packetChecker( U8 *Buffer, size_t BufferSize ); + //bool packetHandler( unsigned char *Buffer, size_t BufferSize ); + bool packetHandler( protocolPackage *Package ); public: - explicit protocolPTZ_VISCA(config_setting_t *Settings = NULL); - explicit protocolPTZ_VISCA( uint8_t CAM_ID ); - ~protocolPTZ_VISCA(); + explicit protocolPTZ_VISCA(config_setting_t *Settings = NULL); + explicit protocolPTZ_VISCA( uint8_t CAM_ID ); + virtual ~protocolPTZ_VISCA(); /* Implemen Generic PTZ Interface */ - virtual bool create(void); - virtual bool initCamera(void); - virtual bool setAutoFocus(bool nMode); - virtual bool setZoom(double nZoom); - virtual double getZoom(void); - virtual bool move(uint32_t MoveMatrix); - virtual bool goAbsolute( float dPan, float dTilt, float dZoom); - virtual bool setOSD(bool nMode); + virtual bool create(void); + virtual bool initCamera(void); + virtual bool setAutoFocus(bool nMode); + virtual bool setZoom(double nZoom); + virtual double getZoom(void); + virtual bool move(uint32_t MoveMatrix); + virtual bool goAbsolute( float dPan, float dTilt, float dZoom); + virtual bool setOSD(bool nMode); }; diff --git a/lib/data/protocol/protocolZLMEDIA.cpp b/lib/data/protocol/protocolZLMEDIA.cpp index d5165c6d..ded3db2c 100644 --- a/lib/data/protocol/protocolZLMEDIA.cpp +++ b/lib/data/protocol/protocolZLMEDIA.cpp @@ -92,12 +92,24 @@ bool protocolZLMEDIA::packetHandler( protocolPackage *Package ){ m_bServerIsPresent = true; try{ Json::Value root; +#ifdef OLD_WAY_JSON Json::Reader reader; - if( !reader.parse( (char *)Package->m_pData, root ) ){ + if( !reader.parse( (char *)Package->m_pData, root ) ){ LOG_ERROR( "Error parsing the string" ); m_bSessionOnGo = false; return false; }; +#else + JSONCPP_STRING err; + Json::CharReaderBuilder builder; + const std::unique_ptr reader(builder.newCharReader()); + if (!reader->parse((char *)Package->m_pData, (char *)Package->m_pData + Package->m_nSize, &root, &err)) { + LOG_ERROR( "Error parsing the string" ); + LOG_ERROR( err.c_str() ); + m_bSessionOnGo = false; + return false; + }; +#endif for( Json::Value::const_iterator outer = root.begin() ; outer != root.end() ; outer++ ){ for( Json::Value::const_iterator inner = (*outer).begin() ; inner!= (*outer).end() ; inner++ ){ char tBuffer[256]; diff --git a/lib/data/transport/transportSerial.cpp b/lib/data/transport/transportSerial.cpp index d89d18ab..6399d1bd 100644 --- a/lib/data/transport/transportSerial.cpp +++ b/lib/data/transport/transportSerial.cpp @@ -27,7 +27,7 @@ void transportSerial::m_fThreadAProc( void ){ m_bThreadAStatus = TH_WORKING; uint32_t nSleepTime = 1; #ifdef DEBUG_COMMUNICATION - LOG("Output Thread Started"); + LOG("Output Thread Started "); #endif while( m_bThreadAStatus < TH_ENDED ) { m_mBufferProtectorMutex.lock(); diff --git a/lib/data/transport/transportSerial.h b/lib/data/transport/transportSerial.h index b0f8a8c8..63bd7eca 100644 --- a/lib/data/transport/transportSerial.h +++ b/lib/data/transport/transportSerial.h @@ -4,6 +4,8 @@ #include "../../components/base/basicDualThread.h" #include "../../components/base/basicTransport.h" +#define DEBUG_COMMUNICATION + #define MAXIMAL_SERIAL_PACKET_LENGTH 1024 class transportSerial: public basicTransport, public basicDualThread { diff --git a/lib/hardware/uart/serialPort.cpp b/lib/hardware/uart/serialPort.cpp index f2de46c4..494ce88b 100644 --- a/lib/hardware/uart/serialPort.cpp +++ b/lib/hardware/uart/serialPort.cpp @@ -372,7 +372,7 @@ int serialPort::sendBlock( unsigned char *Data, int DataSize ){ // RetVal = 0; // }; #endif -#ifdef DEBUG_COMMUNICATION +#ifdef DEBUG char MsgBuffer[CLOG]; sprintf( MsgBuffer, "Sent %d byte(s) of %d", RetVal, DataSize ); LOG( MsgBuffer ); @@ -469,19 +469,19 @@ int serialPort::recptBlock( unsigned char *Buffer, int *BufferLength ){ return -1;// RetVal; } else { //fWaitingOnRead = TRUE; - #ifdef DEBUG_SERIAL_COMMUNICATION + #ifdef DEBUG_EXTRA LOG("WREAD!"); #endif }; } else { // read completed immediately - #ifdef DEBUG_SERIAL_COMMUNICATION + #ifdef DEBUG_EXTRA LOG("IMREAD!"); #endif }; #endif // Linux -#ifdef DEBUG_SERIAL_COMMUNICATION +#ifdef DEBUG if( RetVal > 0 ){ char MsgBuffer[CLOG]; if( RetVal > 1 || RetVal == 0 ) { @@ -490,10 +490,12 @@ int serialPort::recptBlock( unsigned char *Buffer, int *BufferLength ){ sprintf( MsgBuffer, "Received 1 byte"); }; LOG( MsgBuffer ); +#ifdef DEBUG_SERIAL_COMMUNICATION for (int i = 0; i < RetVal; i++) { sprintf(MsgBuffer, "0x%02X", Buffer[i]); LOG(MsgBuffer); }; +#endif }; #endif diff --git a/lib/hardware/uart/serialPort.h b/lib/hardware/uart/serialPort.h index d20b5333..36ff6bfa 100644 --- a/lib/hardware/uart/serialPort.h +++ b/lib/hardware/uart/serialPort.h @@ -15,12 +15,13 @@ #endif +#include "../../data/transport/transportSerial.h" #ifdef DEBUG - //#define _DEBUG_SERIAL_COMMUNICATION_ + #ifdef DEBUG_COMMUNICATION + #define DEBUG_SERIAL_COMMUNICATION + #endif #endif -#include "../../data/transport/transportSerial.h" - /** * TODO: Add class description * diff --git a/lib/hardware/uart/serialSOL.cpp b/lib/hardware/uart/serialSOL.cpp index cec9175c..af97056b 100644 --- a/lib/hardware/uart/serialSOL.cpp +++ b/lib/hardware/uart/serialSOL.cpp @@ -406,7 +406,7 @@ int serialSOL::sendBlock(unsigned char* Data, int DataSize) { #endif socklen_t addr_len = sizeof(m_sClientAddr); - RetVal = sendto(m_nSocketFD, (const char*)Data, DataSize, MSG_CONFIRM, (const struct sockaddr*) & m_sClientAddr, addr_len); + RetVal = sendto(m_nSocketFD, (const char*)Data, DataSize, MSG_CONFIRM, (const struct sockaddr*) &m_sClientAddr, addr_len ); if ((RetVal == -1) && (errno != EINTR) && (errno != EWOULDBLOCK)) { LOG_ERROR("Error acures while writing data into the Socket"); @@ -451,8 +451,8 @@ int serialSOL::recptBlock( unsigned char *Buffer, int *BufferLength ){ if (m_eType == SOL_TCP_CLIENT) { //ACCEPT struct sockaddr ClientAddress; - size_t size = (size_t) sizeof(struct sockaddr_in); - int ClientSocket; + socklen_t size = sizeof(struct sockaddr_in); + //int ClientSocket; m_nSocketFD = accept(m_nMasterSocketFD, &ClientAddress, &size); if (m_nSocketFD < 0) { setConnectionStatus(CS_DISCONNECTED); diff --git a/lib/rgoose/rgooseCamera.cpp b/lib/rgoose/rgooseCamera.cpp index 44f0b6a6..4a86a787 100644 --- a/lib/rgoose/rgooseCamera.cpp +++ b/lib/rgoose/rgooseCamera.cpp @@ -10,6 +10,7 @@ #include "../data/protocol/protocolPTZ_PELCO.h" #include "rgooseKernel.h" +#include "rgooseHardwareResourceSerialProvider.h" #include "rgooseModuleEmbedVideo.h" #define LOG( X ) m_pLog->Log( "RCAM", this, X ) @@ -34,7 +35,7 @@ static float AC_imager_height[12] = { 3.0f, 3.416f, 3.6f, 3.96f, 4.8f, 5.319f, 6 ARGUS_Camera::ARGUS_Camera(): basicThread(){ m_pLog = basicLogCollection::getInstance(); - m_pEvtHeap = basicEventHeap::getInstance(); + m_pBEH = basicEventHeap::getInstance(); m_pDBC = argusDBC::getInstance(); m_tTimeTSeconds = 0; m_pPosition = NULL; @@ -152,53 +153,47 @@ bool ARGUS_Camera::create( uint32_t CameraID ){ #endif m_pProtocol = (protocolPTZ *) new protocolPTZ_VISCA( m_sCamData.protocol_aux ); if( m_pProtocol!= NULL ) { - DBC_UART_DATA *tData = NULL; - tData = m_pDBC->getUartData( m_sCamData.uart_id ); - if( tData!= NULL ) { - basicTransport *tTransport = NULL; - switch( tData->type ) { - case UART_TYPE_HARDWARE:{ // Hardware - serialPort *tT = NULL; - tT = new serialPort(); - if( tT!= NULL ){ - if( tT->create( tData->path, tData->speed ) ){ - tTransport = (basicTransport *) tT; + argusKernel * tKRNL = argusKernel::getInstance(); + basicTransport * tTransport = NULL; + if( tKRNL!= NULL ) { + argusHardwareManager * tHM = tKRNL->getHardwareManager(); + if ( tHM ) { + argusHardwareResource * tRES = tHM->requestResource( ARGUS_HARDWARE_PROVIDER_SERIAL, m_sCamData.uart_id ); + if( tRES != NULL ) { + if( tRES->isValid()) { + tTransport = static_cast(static_cast(tRES)); + if( m_pProtocol->setTransport( tTransport )){ + if( !m_pProtocol->create() ){ + LOG_ERROR("Protocol <<< Create >>> Failure!"); + }; } else { - delete( tT ); + LOG_ERROR("Binding Port Failure!"); }; }; - break; - }; - case UART_TYPE_SOL:{ // E2S - serialSOL *tT = NULL; - tT = new serialSOL( (SOL_TYPE) tData->mode ); - if( tT!= NULL ){ - if( tT->create( tData->path, tData->port, tData->speed ) ){ - tTransport = (basicTransport *) tT; - } else { - delete( tT ); - }; - }; - break; - }; - }; - if( tTransport!= NULL ) { - LOG( "Bind Transport Port!" ); - if( m_pProtocol->setTransport( tTransport )){ - if( !m_pProtocol->create() ){ - LOG_ERROR("Protocol <<< Create >>> Failure!"); - }; - } else { - LOG_ERROR("Binding Port Failure!"); - }; - } else { - LOG_ERROR("Transport Creation Failure!"); - delete( ( protocolPTZ_VISCA * )m_pProtocol ); - m_pProtocol = NULL; + } +#ifdef DEBUG + else { + LOG("HWM Has No UART PORT!"); + } +#endif + ; }; - free( tData ); - }; - }; + } +#ifdef DEBUG + else LOG_ERROR("Can not get Kernel!"); +#endif + if( tTransport!= NULL ) { + LOG( "Bind Transport Port!" ); + + } else { + LOG_ERROR("Transport Creation Failure!"); + delete( ( protocolPTZ_VISCA * )m_pProtocol ); + m_pProtocol = NULL; + } + } +#ifdef DEBUG + else LOG_ERROR("Protocol NEW failure!"); +#endif break; }; case CAM_CTRL_PROTO_PELCO:{ @@ -206,66 +201,45 @@ bool ARGUS_Camera::create( uint32_t CameraID ){ LOG("PELCO"); #endif m_pProtocol = (protocolPTZ *) new protocolPTZ_PELCO( m_sCamData.protocol_aux ); - if( m_pProtocol!= NULL ) { - DBC_UART_DATA *tData = NULL; - tData = m_pDBC->getUartData( m_sCamData.uart_id ); - if( tData!= NULL ) { - basicTransport *tTransport = NULL; - switch( tData->type ) { - case UART_TYPE_HARDWARE:{ -#ifdef DEBUG - LOG("HW Port"); -#endif - serialPort *tT = NULL; - tT = new serialPort(); - if( tT!= NULL ){ - if( tT->create( tData->path, tData->speed ) ){ - tTransport = (basicTransport *) tT; - } else { - delete( tT ); - }; - }; - break; - }; - case UART_TYPE_SOL:{ -#ifdef DEBUG - LOG("SOL Port"); -#endif - serialSOL *tT = NULL; - tT = new serialSOL( (SOL_TYPE)tData->mode ); - if( tT!= NULL ){ - if( tT->create( tData->path, tData->port, tData->speed ) ){ - tTransport = (basicTransport *) tT; + if( m_pProtocol!= NULL ) { + argusKernel * tKRNL = argusKernel::getInstance(); + basicTransport * tTransport = NULL; + if( tKRNL!= NULL ) { + argusHardwareManager * tHM = tKRNL->getHardwareManager(); + if ( tHM ) { + argusHardwareResource * tRES = tHM->requestResource( ARGUS_HARDWARE_PROVIDER_SERIAL, m_sCamData.uart_id ); + if( tRES != NULL ) { + if( tRES->isValid()) { + tTransport = static_cast(static_cast(tRES)); + if( m_pProtocol->setTransport( tTransport )){ + if( !m_pProtocol->create() ){ + LOG_ERROR("Protocol <<< Create >>> Failure!"); + }; } else { - delete( tT ); + LOG_ERROR("Binding Port Failure!"); }; }; - break; - }; + } #ifdef DEBUG - default: LOG_ERROR("Unknown Port Type!"); + else { + LOG("HWM Has No UART PORT!"); + } #endif + ; }; - if( tTransport!= NULL ) { - LOG( "Bind Transport Port!" ); - if( m_pProtocol->setTransport( tTransport )){ - if( !m_pProtocol->create() ){ - LOG_ERROR("Protocol <<< Create >>> Failure!"); - }; - } else { - LOG_ERROR("Binding Port Failure!"); - }; - } else { - LOG_ERROR("Transport Creation Failure!"); - delete( ( protocolPTZ_PELCO * )m_pProtocol ); - m_pProtocol = NULL; - }; - free( tData ); } #ifdef DEBUG - else LOG_ERROR("No Uart DATA loaddesd!"); + else LOG_ERROR("Can not get Kernel!"); #endif + if( tTransport!= NULL ) { + LOG( "Bind Transport Port!" ); + + } else { + LOG_ERROR("Transport Creation Failure!"); + delete( ( protocolPTZ_PELCO * )m_pProtocol ); + m_pProtocol = NULL; + } } #ifdef DEBUG else LOG_ERROR("Protocol NEW failure!"); @@ -351,21 +325,28 @@ bool ARGUS_Camera::relativeStop(){ return false; }; -bool ARGUS_Camera::absoluteMove( float PanPOS, float TiltPOS, float ZoomPOS ){ - if( m_sCamData.online ) { - CAM_PTZ_CMD *tCMD = (CAM_PTZ_CMD*) malloc( sizeof(CAM_PTZ_CMD)); - if( tCMD ) { - memset( tCMD, 0 , sizeof(CAM_PTZ_CMD)); - tCMD->CMD = PTZ_ABSOLUTE; - tCMD->PAN = PanPOS; - tCMD->TILT = TiltPOS; - tCMD->ZOOM = ZoomPOS; - m_mQPROTECTOR.lock(); - m_qCAM_CMD.push( tCMD ); - m_mQPROTECTOR.unlock(); - return true; +bool ARGUS_Camera::absoluteMove( uint32_t TargetRefID, float PanPOS, float TiltPOS, float ZoomPOS ){ + if( m_sCamData.online ){ + CAM_TASK *tTask = (CAM_TASK *)malloc(sizeof(CAM_TASK)); + if( tTask ){ + memset(tTask, 0, sizeof(CAM_TASK)); + tTask->CMD = (CAM_PTZ_CMD *)malloc(sizeof(CAM_PTZ_CMD)); + if( tTask->CMD ){ + tTask->CMD->CMD = PTZ_ABSOLUTE; + tTask->CMD->PAN = PanPOS; + tTask->CMD->TILT = TiltPOS; + tTask->CMD->ZOOM = ZoomPOS; + tTask->movemet_needed = true; + tTask->source_evt_id = TargetRefID; + m_mQPROTECTOR.lock(); + m_qCAM_TASK.push( tTask ); + m_mQPROTECTOR.unlock(); + return true; + } else { + free( tTask ); + }; }; - }; + } return false; }; @@ -501,53 +482,73 @@ void ARGUS_Camera::m_fThreadProc( void ){ break; } case CAM_WS_READY:{ + uint32_t tSLEEP = DEFAULT_THREAD_SLEEP_TIME; m_mQPROTECTOR.lock(); - if( m_qCAM_CMD.size() ){ + if( m_qCAM_TASK.size() ){ +#ifdef DEBUG char tB[128]; - sprintf( tB,"Queue: %d commands!", m_qCAM_CMD.size() ); + sprintf( tB,"Queue: %d commands!", m_qCAM_TASK.size() ); LOG( tB ); - CAM_PTZ_CMD *tCMD = m_qCAM_CMD.front(); - if( tCMD ) { - m_qCAM_CMD.pop(); +#endif + CAM_TASK *tTASK = m_qCAM_TASK.front(); + if ( tTASK ) { + m_qCAM_TASK.pop(); m_mQPROTECTOR.unlock(); - switch( tCMD->CMD ) { - case PTZ_STOP:{ - m_pProtocol->goStop(); - setBusy( false ); - break; - }; - case PTZ_MOVE:{ - uint32_t MoveMatrix = 0; - if( m_pProtocol->setPTZSpeed( tCMD->PAN, tCMD->TILT, tCMD->ZOOM ) ){ - SLEEP( 5 ); - m_pProtocol->move( MoveMatrix ); + if( tTASK->movemet_needed ){ + CAM_PTZ_CMD *tCMD = tTASK->CMD; + if( tCMD ) { + switch( tCMD->CMD ) { + case PTZ_STOP:{ + m_pProtocol->goStop(); + setBusy( false ); + break; + }; + case PTZ_MOVE:{ + uint32_t MoveMatrix = 0; + if( m_pProtocol->setPTZSpeed( tCMD->PAN, tCMD->TILT, tCMD->ZOOM ) ){ + tSLEEP = 5; + m_pProtocol->move( MoveMatrix ); + }; + break; + }; + case PTZ_ABSOLUTE:{ + setBusy( true ); + if( !m_pProtocol->goAbsolute( tCMD->PAN, tCMD->TILT, tCMD->ZOOM ) ) { + LOG_ERROR("Cannot Issue goAbsolute Command!"); + //tSLEEP= 1000; + }; + setBusy( false ); + if( m_pBEH ){ + EVENT_CONTAINER *tEVT = createBasicEvent( + m_sCamData.node_id, + EVT_CLASS_CAMERA_CTRL, + EVT_CAMERA_ON_POSITION, + NULL, NULL, NULL ); + if( tEVT ){ + tEVT->m_db_id = tTASK->source_evt_id; + m_pBEH->broadcast(tEVT); + }; + }; + break; + }; + case PTZ_RELOAD_CAMERA:{ + LOG("Exit Command Rcpt"); + m_bThreadStatus = TH_ENDED; + setBusy( true ); + }; }; - break; - }; - case PTZ_ABSOLUTE:{ - setBusy( true ); - if( !m_pProtocol->goAbsolute( tCMD->PAN, tCMD->TILT, tCMD->ZOOM ) ) { - LOG_ERROR("Cannot Issue goAbsolute Command!"); - //SLEEP( 1000 ); - }; - setBusy( false ); - break; - }; - case PTZ_RELOAD_CAMERA:{ - LOG("Exit Command Rcpt"); - m_bThreadStatus = TH_ENDED; - setBusy( true ); + free( tCMD ); + tTASK->CMD = NULL; }; }; - free( tCMD ); + free( tTASK ); } else { m_mQPROTECTOR.unlock(); - LOG_ERROR("Error Fetching CMD from Queue"); - SLEEP( DEFAULT_THREAD_SLEEP_TIME ); + LOG_ERROR("Error Fetching TASK from Queue"); }; - } else { - m_mQPROTECTOR.unlock(); - SLEEP( DEFAULT_THREAD_SLEEP_TIME ); + }; + if( tSLEEP ) { + SLEEP( tSLEEP ); }; break; }; @@ -683,7 +684,7 @@ bool ARGUS_Camera::lookAtWGS84( uint32_t TargetRefID, float lat, float lon, floa return false; }; // Exit for fixed Cam - if( ( m_sCamData.pan_model == 0 ) && ( m_sCamData.tilt_model == 0 ) ) return true; + if( ( m_sCamData.pan_model == 0 ) && ( m_sCamData.tilt_model == 0 ) ) return makeSnap(TargetRefID); // Exit for unpositioned Cam if( m_pPosition == NULL ) return false; @@ -733,32 +734,23 @@ bool ARGUS_Camera::lookAtWGS84( uint32_t TargetRefID, float lat, float lon, floa //sprintf(tB,"EVT:%d AM: %0.2f %0.2f %0.2f", TargetRefID, fP, fT, fZ ); //LOG( tB ); - if( absoluteMove( fP, fT, fZ ) ) { -#ifdef DEBUG - //LOG("CHECK CAMERA STREAMS"); -#endif - EVENT_CONTAINER *tEVT; - DBC_INT_LIST *tStreams; - tStreams = m_pDBC->listCamMediaStreams( m_sCamData.id ); - if( tStreams!= NULL ) { - for( uint32_t idx = 0; idx < tStreams->size(); idx++ ) { - tEVT = createBasicTargetedEvent( m_sCamData.node_id, tStreams->at(idx), EVT_CLASS_VIDEO, EVT_CAPTURE_START ); - if( tEVT != NULL ) { - tEVT->m_ref_id = TargetRefID; - m_pEvtHeap->broadcast( tEVT ); - }; - }; - delete( tStreams ); - }; - return true; - }; - return false; + return absoluteMove( TargetRefID, fP, fT, fZ ); }; -bool ARGUS_Camera::captureFrame( CSTR fileName, uint8_t compression ){ - if( m_bSourceConnected ) { - if( m_pSource != NULL ) { - +bool ARGUS_Camera::makeSnap( uint32_t TargetRefID ){ + CAM_TASK *tTask = (CAM_TASK *)malloc(sizeof(CAM_TASK)); + if( tTask ){ + memset(tTask, 0, sizeof(CAM_TASK)); + tTask->CMD = (CAM_PTZ_CMD *)malloc(sizeof(CAM_PTZ_CMD)); + if( tTask->CMD ){ + tTask->CMD->CMD = PTZ_CAPTURE_ONLY; + tTask->source_evt_id = TargetRefID; + m_mQPROTECTOR.lock(); + m_qCAM_TASK.push( tTask ); + m_mQPROTECTOR.unlock(); + return true; + } else { + free( tTask ); }; }; return false; @@ -855,9 +847,15 @@ bool ARGUS_Camera::disconnectFromStream( void ){ }; bool ARGUS_Camera::validateStream( void ){ + LOG("Stream Validation"); if( m_bSourceConnected ) { + LOG("Source is Connected"); if( m_pSource ) { - return !m_pSource->isFinished(); + LOG("Source is Created"); + return !(m_pSource->isFinished()); + } else { + LOG_ERROR("No Source Object! Set Disconnected!"); + m_bSourceConnected = false; }; }; return false; diff --git a/lib/rgoose/rgooseCamera.h b/lib/rgoose/rgooseCamera.h index 57f13e4e..94e3ba39 100644 --- a/lib/rgoose/rgooseCamera.h +++ b/lib/rgoose/rgooseCamera.h @@ -54,7 +54,8 @@ typedef enum E_CAM_PTZ_CMD{ PTZ_STOP = 0, PTZ_MOVE = 1, PTZ_ABSOLUTE = 2, - PTZ_RELOAD_CAMERA = 3 + PTZ_RELOAD_CAMERA = 3, + PTZ_CAPTURE_ONLY = 4 }PTZ_CMD; typedef std::queue CAM_PTZ_CMD_QUEUE; @@ -71,56 +72,63 @@ typedef enum E_CAM_WORKING_STATE{ CAM_WS_END = 255 }CAM_WORK_STATE; +typedef struct S_CAM_TASK{ + bool isDone; + uint32_t source_evt_id; + bool movemet_needed; + CAM_PTZ_CMD * CMD; +} CAM_TASK; + +typedef std::queue CAM_TASK_QUEUE; + class ARGUS_Camera: public basicThread { private: - basicLogCollection * m_pLog; - - basicPosition * m_pPosition; - basicEventHeap * m_pEvtHeap; - argusDBC * m_pDBC; - time_t m_tTimeTSeconds; + basicLogCollection * m_pLog; + basicPosition * m_pPosition; + argusDBC * m_pDBC; + time_t m_tTimeTSeconds; - uint8_t m_bState; - bool m_bBusy; + uint8_t m_bState; + bool m_bBusy; - float m_fMaxRange; - float m_fMinHFov; - float m_fMaxHFov; - float m_fMinVFov; - float m_fMaxVFov; + float m_fMaxRange; + float m_fMinHFov; + float m_fMaxHFov; + float m_fMinVFov; + float m_fMaxVFov; - protocolPTZ * m_pProtocol; - basicTransport * m_pTransport; + protocolPTZ * m_pProtocol; + basicTransport * m_pTransport; - CAM_PTZ_CMD_QUEUE m_qCAM_CMD; - basicMutex m_mQPROTECTOR; + CAM_TASK_QUEUE m_qCAM_TASK; + basicMutex m_mQPROTECTOR; - videoAVLIBSource * m_pSource; - uint32_t m_nRelativeMoveCounter; - uint8_t m_bRelativeMoveMatrix; - float m_fSpeedRise; - float m_fRM_Pan; - float m_fRM_Tilt; - float m_fRM_Zoom; + videoAVLIBSource * m_pSource; + uint32_t m_nRelativeMoveCounter; + uint8_t m_bRelativeMoveMatrix; + float m_fSpeedRise; + float m_fRM_Pan; + float m_fRM_Tilt; + float m_fRM_Zoom; /* Methotds Sutable to Control Camera */ bool relativeMove( float PanSPD, float TiltSPD, float ZoomSPD ); bool relativeStop(); - bool absoluteMove( float PanPOS, float TiltPOS, float ZoomPOS ); + bool absoluteMove( uint32_t RefID, float PanPOS, float TiltPOS, float ZoomPOS ); protected: DBC_CAM_DATA m_sCamData; MEDIA_SOURCE_DESC m_sMediaSource; + basicEventHeap * m_pBEH; bool m_bSourceConnected; - bool inTheFOV( float lat, float lon, float alt ); - bool lookAtWGS84( uint32_t TargetRefID, float lat, float lon, float alt ); - - bool captureFrame( CSTR fileName, uint8_t compression = 0 ); - void setBusy( bool Status ); - bool connectToStream( uint32_t id ); - bool disconnectFromStream( void ); - bool validateStream( void ); + bool inTheFOV( float lat, float lon, float alt ); + bool lookAtWGS84( uint32_t TargetRefID, float lat, float lon, float alt ); + bool makeSnap( uint32_t TargetRefID ); + void setBusy( bool Status ); + bool connectToStream( uint32_t id ); + bool disconnectFromStream( void ); + bool validateStream( void ); virtual void m_fThreadProc( void ); public: ARGUS_Camera(); diff --git a/lib/rgoose/rgooseDBConnector.cpp b/lib/rgoose/rgooseDBConnector.cpp index a52db98b..fca7e51a 100644 --- a/lib/rgoose/rgooseDBConnector.cpp +++ b/lib/rgoose/rgooseDBConnector.cpp @@ -89,13 +89,13 @@ bool argusDBC::connect( void ){ return m_bIsConnected; }; -bool argusDBC::cleanResources( uint32_t SiteID, uint32_t ServerNodeID, bool all ){ +bool argusDBC::cleanResources( uint32_t ServerNodeID, bool all ){ if(m_bIsConnected) { char tQBuf[MAX_PATH_LEN]; if( all ) { - sprintf( tQBuf, "UPDATE `resources` SET `active`=0 WHERE `site_id`=%d AND `node_id`=%d", SiteID, ServerNodeID ); + sprintf( tQBuf, "UPDATE `resources` SET `active`=0 WHERE `node_id`=%d", ServerNodeID ); } else { - sprintf( tQBuf, "UPDATE `resources` SET `active`=0 WHERE `site_id`=%d AND `node_id`=%d AND ( `type`=100 OR `type`=101 OR `type`=103 OR `type`=120 )", SiteID, ServerNodeID ); + sprintf( tQBuf, "UPDATE `resources` SET `active`=0 WHERE ( `node_id`=%d ) AND ( `type`=100 OR `type`=101 OR `type`=103 OR `type`=120 )", ServerNodeID ); }; #ifdef DEBUG_EXTRA LOG(tQBuf); @@ -614,6 +614,126 @@ DBC_INT_LIST *argusDBC::listNewNodes( uint32_t SiteID, DBC_INT_LIST *old_ids ){ return tVal; }; +void argusDBC::lazyEventArchiver( uint32_t DalayTime ){ + if( m_bIsConnected ){ + char tQBuf[CTEXT]; + AAssoc *result; + uint32_t LastID = 0; + sprintf( tQBuf, "SELECT * FROM `events_cloud` WHERE ( UNIX_TIMESTAMP(NOW()) - `ts` ) > %d ORDER BY `id` ASC LIMIT 10", DalayTime ); +#ifdef DEBUG_EXTRA + LOG(tQBuf); +#endif + result = m_pDatabase->Query( tQBuf ); + if( result!= NULL ) { + if( result->size() > 0 ) { + Assoc *cArr; + for(int i=0;isize();i++){ + uint32_t nodeid=0; + char uuid[64]={0}; + uint32_t ts=0; + uint32_t ts_ms=0; + uint32_t evt_t=0; + uint32_t range_d=0; + float az=.0f, el=.0f, ra=.0f, ar=.0f, lat=.0f, lon=.0f, alt=.0f; + uint32_t ref_id=0; + char ref_uuid[64]={0}; + Assoc::iterator it; + + cArr = result->at(i); + + it = cArr->find("id"); + if( it != cArr->end() ){ + LastID = atoi( it->second.c_str()); + }; + it = cArr->find("node_id"); + if( it != cArr->end() ){ + nodeid = atoi( it->second.c_str()); + }; + it = cArr->find("uuid"); + if( it != cArr->end() ){ + strncpy( uuid, it->second.c_str(), 64 ); + }; + it = cArr->find("ts"); + if( it != cArr->end() ){ + ts = atoi( it->second.c_str()); + }; + it = cArr->find("ts_ms"); + if( it != cArr->end() ){ + ts_ms = atoi( it->second.c_str()); + }; + it = cArr->find("evt_type"); + if( it != cArr->end() ){ + evt_t = atoi( it->second.c_str()); + }; + it = cArr->find("range_digital"); + if( it != cArr->end() ){ + range_d = atoi( it->second.c_str()); + }; + it = cArr->find("azimuth"); + if( it != cArr->end() ){ + az = (float)atof( it->second.c_str()); + }; + it = cArr->find("elevation"); + if( it != cArr->end() ){ + el = (float)atof( it->second.c_str()); + }; + it = cArr->find("range"); + if( it != cArr->end() ){ + ra = (float)atof( it->second.c_str()); + }; + it = cArr->find("area"); + if( it != cArr->end() ){ + ar = (float)atof( it->second.c_str()); + }; + it = cArr->find("lat"); + if( it != cArr->end() ){ + lat = (float)atof( it->second.c_str()); + }; + it = cArr->find("lon"); + if( it != cArr->end() ){ + lon = (float)atof( it->second.c_str()); + }; + it = cArr->find("alt"); + if( it != cArr->end() ){ + alt = (float)atof( it->second.c_str()); + }; + it = cArr->find("ref_id"); + if( it != cArr->end() ){ + ref_id = atoi( it->second.c_str()); + }; + it = cArr->find("ref_uuid"); + if( it != cArr->end() ){ + strncpy( ref_uuid, it->second.c_str(), 64 ); + }; + sprintf(tQBuf, "INSERT INTO `events_archive` SET `node_id`=%d, `uuid`='%s', `ts`=%d, `ts_ms`=%d, `evt_type`=%d, `range_digital`=%d, `azimuth`=%0.8f, `elevation`=%0.8f, `range`=%0.2f, `area`=%0.5f, `lat`=%0.8f, `lon`=%0.8f, `alt`=%0.3f, `ref_id`=%d, `ref_uuid`='%s'", + nodeid, + uuid, + ts, + ts_ms, + evt_t, + range_d, + az, + el, + ra, + ar, + lat, + lon, + alt, + ref_id, + ref_uuid + ); + uint32_t IID = (uint32_t) m_pDatabase->QueryID(tQBuf); + sprintf(tQBuf,"UPDATE `events_2_pictures` SET `event_id`=%d WHERE `event_id`=%d", IID, LastID ); + m_pDatabase->SilentQuery(tQBuf); + sprintf(tQBuf,"UPDATE `events_2_videos` SET `event_id`=%d WHERE `event_id`=%d", IID, LastID ); + m_pDatabase->SilentQuery(tQBuf); + }; + }; + }; + deleteResult( result ); + }; +}; + DBC_INT_LIST *argusDBC::listCamMediaStreams( uint32_t CAMID ){ DBC_INT_LIST * tVal = NULL; if(m_bIsConnected){ @@ -1428,9 +1548,9 @@ DBC_INT_LIST *argusDBC::listResources( uint32_t NodeID ){ if( NodeID ) { sprintf(tQBuf, "SELECT `id` FROM `resources` WHERE `node_id`=%d AND `active`=1", NodeID ); } else { - sprintf(tQBuf, "SELECT `id` FROM `resources` WHERE `site_id`=%d AND `active`=1", m_nSiteID ); + sprintf(tQBuf, "SELECT `re`.`id` FROM `resources` `re` LEFT JOIN `nodes` `no` ON( `re`.`node_id` = `no`.`id` ) WHERE `no`.`site_id`=%d AND `re`.`active`=1", m_nSiteID ); }; -#ifdef DEBUG_ALL +#ifdef DEBUG LOG(tQBuf); #endif result = m_pDatabase->Query( tQBuf ); @@ -2058,14 +2178,18 @@ void argusDBC::registerServer(uint32_t SiteID, CSTR identity, int PID ){ #endif m_pDatabase->SilentQuery( tQBuf ); - uint32_t sid = getServerID( identity ); - if( sid ) { - sprintf(tQBuf,"INSERT INTO nodes SET `site_id`=%d, `aux_id`='%d', `type`= 0, `online`=1, `name`='Server Node' ON DUPLICATE KEY UPDATE `online`=1", m_nSiteID, sid ); + uint32_t tServerID = getServerID( identity ); + if( tServerID ) { + sprintf(tQBuf,"INSERT INTO nodes SET `site_id`=%d, `aux_id`='%d', `type`= 0, `online`=1, `name`='Server Node' ON DUPLICATE KEY UPDATE `online`=1", m_nSiteID, tServerID ); #ifdef DEBUG_ALL LOG(tQBuf); #endif - m_pDatabase->SilentQuery( tQBuf ); - cleanResources( m_nSiteID, sid ); + uint32_t tServerNodeID = ( uint32_t ) m_pDatabase->QueryID( tQBuf ); + if( tServerNodeID == 0 ){ + tServerNodeID = getServerNode( tServerID ); + }; + //cleanResources( tServerNodeID ); + setNodeOnline( tServerNodeID ); }; }; }; @@ -2163,11 +2287,11 @@ DBC_RESOURCE_DATA *argusDBC::getResourceData( uint32_t ResourceID ){ return tVal; }; -uint32_t argusDBC::getResourceID( uint32_t SiteID, uint32_t NodeID, uint8_t type, uint32_t auxID ){ +uint32_t argusDBC::getResourceID( uint32_t NodeID, uint8_t type, uint32_t auxID ){ uint32_t RetVal = 0; if(m_bIsConnected){ char tQBuf[CTEXT]; - sprintf(tQBuf,"SELECT `id` FROM `resources` WHERE `site_id`=%d AND `node_id`=%d AND `type`=%d AND `aux_id`=%d", SiteID, NodeID, type, auxID ); + sprintf(tQBuf,"SELECT `id` FROM `resources` WHERE `node_id`=%d AND `type`=%d AND `aux_id`=%d", NodeID, type, auxID ); #ifdef DEBUG_ALL LOG(tQBuf); #endif @@ -2302,20 +2426,20 @@ bool argusDBC::addNotification( uint32_t MSG_ID, uint8_t DIS_LVL, uint32_t OBJ_I return false; }; -uint32_t argusDBC::addResource( uint32_t SiteID, uint32_t NodeID, uint8_t type, CSTR devName, uint32_t auxID ){ +uint32_t argusDBC::addResource( uint32_t NodeID, uint8_t type, CSTR devName, uint32_t auxID ){ uint32_t RetVal = 0; if( m_bIsConnected ){ char tQBuf[2048]; CSTR tMD5 = MD5String( devName ); if( tMD5 ) { - sprintf( tQBuf, "INSERT INTO `resources` SET `site_id`=%d, `node_id`=%d, `type`=%d, `md5`='%s', `aux_id`=%d, `device`='%s', `active`=1 ON DUPLICATE KEY UPDATE `active`=1, `aux_id`=%d, `device`='%s'", SiteID, NodeID, type, tMD5, auxID, devName, auxID, devName ); + sprintf( tQBuf, "INSERT INTO `resources` SET `node_id`=%d, `type`=%d, `md5`='%s', `aux_id`=%d, `device`='%s', `active`=1 ON DUPLICATE KEY UPDATE `active`=1, `aux_id`=%d, `device`='%s'", NodeID, type, tMD5, auxID, devName, auxID, devName ); free( tMD5 ); #ifdef DEBUG_ALL LOG(tQBuf); #endif RetVal = (uint32_t) m_pDatabase->QueryID( tQBuf ); if( RetVal == 0 ) { - RetVal = getResourceID( SiteID, NodeID, type, auxID ); + RetVal = getResourceID( NodeID, type, auxID ); }; }; }; @@ -2804,7 +2928,20 @@ uint32_t argusDBC::addEvent( uint32_t SRC, CSTR UUID, uint32_t tss, uint32_t tsm bool argusDBC::addVideoEvent( uint32_t evtID, uint32_t videoID ){ if( m_bIsConnected ) { char tQBuf[MAX_PATH_LEN]; - sprintf( tQBuf, "INSERT INTO `events_video_records` SET `evt_id`=%d, `video_id`=%d", evtID, videoID ); + sprintf( tQBuf, "INSERT INTO `events_2_videos` SET `evt_id`=%d, `video_id`=%d", evtID, videoID ); +#ifdef DEBUG_ALL + LOG(tQBuf); +#endif + m_pDatabase->SilentQuery( tQBuf ); + return true; + }; + return true; +}; + +bool argusDBC::addPictureEvent( uint32_t evtID, uint32_t pictureoID ){ + if( m_bIsConnected ) { + char tQBuf[MAX_PATH_LEN]; + sprintf( tQBuf, "INSERT INTO `events_2_pictures` SET `evt_id`=%d, `picture_id`=%d", evtID, pictureoID ); #ifdef DEBUG_ALL LOG(tQBuf); #endif @@ -2818,7 +2955,20 @@ uint32_t argusDBC::addVideoRecord( uint32_t streamID, CSTR md5, uint32_t partID uint32_t tID = 0; if( m_bIsConnected ) { char tQBuf[MAX_PATH_LEN]; - sprintf( tQBuf, "INSERT INTO `video_records` SET `media_stream_id`=%d, `ts`=NOW(), `md5`='%s', `part_id`=%d ", streamID, md5, partID ); + sprintf( tQBuf, "INSERT INTO `videos` SET `media_stream_id`=%d, `ts`=NOW(), `md5`='%s', `part_id`=%d ", streamID, md5, partID ); +#ifdef DEBUG_ALL + LOG(tQBuf); +#endif + tID = (uint32_t) m_pDatabase->QueryID( tQBuf ); + } + return tID; +}; + +uint32_t argusDBC::addPicture( uint32_t streamID, CSTR md5, CSTR ext ){ + uint32_t tID = 0; + if( m_bIsConnected ) { + char tQBuf[MAX_PATH_LEN]; + sprintf( tQBuf, "INSERT INTO `videos` SET `media_stream_id`=%d, `ts`=NOW(), `md5`='%s', `ext`='%s'", streamID, md5, ext ); #ifdef DEBUG_ALL LOG(tQBuf); #endif diff --git a/lib/rgoose/rgooseDBConnector.h b/lib/rgoose/rgooseDBConnector.h index f0919ee6..3c0bdb93 100644 --- a/lib/rgoose/rgooseDBConnector.h +++ b/lib/rgoose/rgooseDBConnector.h @@ -41,13 +41,15 @@ class argusDBC{ uint32_t addLocalNetInterface( CSTR address, CSTR mask, CSTR gateway, CSTR broadcast ); //uint32_t addNodeSocket( uint32_t NodeID, uint32_t auxID, uint8_t SocketType, uint8_t SocketMode, bool multidrop, CSTR path, CSTR name ); bool addNotification( uint32_t MSG_ID, uint8_t DIS_LVL = 0, uint32_t OBJ_ID=0 ); - - uint32_t addResource( uint32_t SiteID, uint32_t NodeID, uint8_t type, CSTR devName, uint32_t auxID = 0 ); + uint32_t addPicture( uint32_t streamID, CSTR md5, CSTR ext ); + bool addPictureEvent( uint32_t evtID, uint32_t pictureoID ); + uint32_t addResource( uint32_t NodeID, uint8_t type, CSTR devName, uint32_t auxID = 0 ); bool addVideoEvent( uint32_t evtID, uint32_t videoID ); uint32_t addVideoRecord( uint32_t streamID, CSTR md5, uint32_t partID ); - bool cleanResources( uint32_t SiteID, uint32_t ServerID, bool all = false ); + bool cleanResources( uint32_t ServerNodeID, bool all = false ); + void lazyEventArchiver( uint32_t DalayTime = 10 ); DBC_INT_LIST * listCamMediaStreams( uint32_t CAMID ); DBC_INT_LIST * listDetectionProfileIDs( uint32_t nodeID ); DBC_INT_LIST * listDetectionProfiles( uint32_t nodeID ); @@ -88,7 +90,7 @@ class argusDBC{ DBC_PUSHED_CMD * getNodePushedCMD( uint32_t NodeID ); //uint32_t getNodeSocketID( uint32_t NodeID, uint32_t auxID, uint8_t SocketType, CSTR path ); DBC_RESOURCE_DATA * getResourceData( uint32_t ResourceID ); - uint32_t getResourceID( uint32_t SiteID, uint32_t NodeID, uint8_t type, uint32_t auxID ); + uint32_t getResourceID( uint32_t NodeID, uint8_t type, uint32_t auxID ); uint32_t getServerID( CSTR identity ); uint32_t getServerNode( uint32_t SID ); KAFKA_SETTINGS * getSettingsKAFKA( uint32_t NodeID ); diff --git a/lib/rgoose/rgooseHardwareManager.cpp b/lib/rgoose/rgooseHardwareManager.cpp index 434a4ef4..f2e53ebc 100644 --- a/lib/rgoose/rgooseHardwareManager.cpp +++ b/lib/rgoose/rgooseHardwareManager.cpp @@ -55,6 +55,9 @@ argusHardwareManager::argusHardwareManager( bool cold_start ){ enumerateHardware(); } else { //enumerateHardware( !cold_start ); +#ifdef DEBUG + LOG("Loading Ressources..."); +#endif loadResources(); }; }; @@ -80,7 +83,8 @@ void argusHardwareManager::unloadResources( void ){ void argusHardwareManager::loadResources( void ){ if( m_pDBC == NULL ) return; DBC_INT_LIST *tVal; - tVal = m_pDBC->listResources();//load whole site resources + //tVal = m_pDBC->listResources( );//load whole site resources + tVal = m_pDBC->listResources( m_nServerNodeID );//Load Only Server Node resources if( tVal!= NULL ) { for( DBC_INT_LIST::iterator index = tVal->begin(); index < tVal->end(); index++ ) { DBC_RESOURCE_DATA *tData = m_pDBC->getResourceData( *index ); @@ -88,11 +92,15 @@ void argusHardwareManager::loadResources( void ){ argusHardwareResource *tPtr = NULL; switch( tData->type ){ case ARGUS_HARDWARE_UART:{ +#ifdef DEBUG + LOG("Construct HW UART"); +#endif argusHardwareResourceSerialProvider *tRes = new argusHardwareResourceSerialProvider( tData->id ); if( tRes != NULL ) { if( tRes->create() ) { tPtr = ( argusHardwareResource *) tRes; } else { + LOG_ERROR("Error Creating HW UART!"); delete( tRes ); }; }; @@ -100,32 +108,47 @@ void argusHardwareManager::loadResources( void ){ }; case ARGUS_HARDWARE_NETWORK_IPV4: case ARGUS_HARDWARE_NETWORK_IPV6:{ +#ifdef DEBUG + LOG("Construct NetIF"); +#endif argusHardwareResourceNetwork *tRes = new argusHardwareResourceNetwork( tData->id ); if( tRes != NULL ) { if( tRes->create() ) { tPtr = ( argusHardwareResource *) tRes; } else { + LOG_ERROR("Error Creating Network Ressource!"); delete( tRes ); }; }; break; }; case ARGUS_HARDWARE_IP_UART:{ +#ifdef DEBUG + LOG("Construct IP UART"); +#endif argusHardwareResourceSerialProvider *tRes = new argusHardwareResourceSerialProvider( tData->id ); if( tRes != NULL ) { - //if( tRes->create() ) { - tRes->create(); + if( tRes->create() ) { tPtr = ( argusHardwareResource *) tRes; - //} else { - // delete( tRes ); - //}; + } else { + LOG_ERROR("Error Creating IP UART!"); + delete( tRes ); + }; }; break; }; +#ifdef DEBUG + default:{ + char tB[128]; + sprintf( tB, "Unknown Ressource[%d] Type[%d]!", *index, tData->type ); + LOG_ERROR(tB); + break; + }; +#endif }; if( tPtr!= NULL ) { #ifdef DEBUG - LOG("ADD RESOURCE!"); + LOG("Resource Sucessfully Created!"); #endif m_vResources.push_back( tPtr ); }; @@ -208,7 +231,7 @@ void argusHardwareManager::enumerateHardware( void ){ //m_nSiteID = m_pKernel->getSiteId(); /* Add Network Interfaces */ - m_pDBC->cleanResources( m_nSiteID, m_nServerNodeID, true ); + m_pDBC->cleanResources( m_nServerNodeID, true ); if( -1 == getifaddrs(&ifaddr)) { LOG_ERROR("No NET INTERFACES?!"); @@ -252,7 +275,7 @@ void argusHardwareManager::enumerateHardware( void ){ //m_pDBC->addNodeSocket( m_nServerNodeID, m_nServerID, ARGUS_NODE_SOCK_TYPE_NETWORK_IPV4, ARGUS_NODE_SOCK_MODE_INOUT, true, ifa->ifa_name, addr ); uint32_t tID = m_pDBC->addLocalNetInterface( addr, mask, gw, bc ); if( tID ) { - m_pDBC->addResource( m_nSiteID, m_nServerNodeID, ARGUS_HARDWARE_NETWORK_IPV4, addr, tID ); + m_pDBC->addResource( m_nServerNodeID, ARGUS_HARDWARE_NETWORK_IPV4, addr, tID ); }; } else { // AF_INET6 // create IPv6 string @@ -303,7 +326,7 @@ void argusHardwareManager::enumerateHardware( void ){ //m_pDBC->addNodeSocket( m_nServerNodeID, m_nServerID, ARGUS_NODE_SOCK_TYPE_NETWORK_IPV6, ARGUS_NODE_SOCK_MODE_INOUT, true, ifa->ifa_name, addr ); uint32_t tID = m_pDBC->addLocalNetInterface( addr, mask, gw, bc ); if( tID ) { - m_pDBC->addResource( m_nSiteID, m_nServerNodeID, ARGUS_HARDWARE_NETWORK_IPV6, addr, tID ); + m_pDBC->addResource( m_nServerNodeID, ARGUS_HARDWARE_NETWORK_IPV6, addr, tID ); }; }; #ifdef DEBUG_EXTRA @@ -458,7 +481,7 @@ uint32_t argusHardwareManager::createResourceUART( CSTR devName ){ // Socket Allredy in DB - was just updated // dbid = m_pDBC->getNodeSocketID( m_nServerNodeID, m_nServerID, ARGUS_NODE_SOCK_TYPE_SERIAL_PORT, dev_name ); //}; - RetVal = m_pDBC->addResource( m_nSiteID, m_nServerNodeID, ARGUS_HARDWARE_UART, dev_name ); + RetVal = m_pDBC->addResource( m_nServerNodeID, ARGUS_HARDWARE_UART, dev_name ); if( RetVal ) { m_pDBC->updateResourceAUX( RetVal, m_pDBC->addLocalUART( RetVal, 1, 115200, 8, 'N', 1.0f, dev_name ) ); }; @@ -531,7 +554,7 @@ uint32_t argusHardwareManager::createResourceVIDEO( CSTR devName ){ #endif uint64_t mid = m_pDBC->addLocalMediaSource( m_nSiteID, dev_name, fmt.fmt.pix.width, fmt.fmt.pix.height ); //m_pDBC->addNodeSocket( m_nServerNodeID, mid, ARGUS_NODE_SOCK_TYPE_ANALOG_VIDEO_GRABBER, ARGUS_NODE_SOCK_MODE_OUT, false, dev_name, tBuffer ); - RetVal = m_pDBC->addResource( m_nSiteID, m_nServerNodeID, ARGUS_HARDWARE_ANALOG_VIDEO_IN, dev_name, mid ); + RetVal = m_pDBC->addResource( m_nServerNodeID, ARGUS_HARDWARE_ANALOG_VIDEO_IN, dev_name, mid ); }; close(fd); }; diff --git a/lib/rgoose/rgooseHardwareResourceSerialProvider.cpp b/lib/rgoose/rgooseHardwareResourceSerialProvider.cpp index e6c127e0..cdd2c63e 100644 --- a/lib/rgoose/rgooseHardwareResourceSerialProvider.cpp +++ b/lib/rgoose/rgooseHardwareResourceSerialProvider.cpp @@ -818,31 +818,36 @@ int argusHardwareResourceSerialProvider::recptBlock( unsigned char *Buffer, int switch( m_sUartData.type ) { case ARGUS_HARDWARE_UART:{ #ifdef __linux__ - do { + do{ RetVal = read( m_iInFID, Buffer, MAXIMAL_SERIAL_PACKET_LENGTH ); - if( RetVal == -1 && errno == EINTR ) SLEEP(1); - } while (RetVal == -1 && errno == EINTR); -#else + if( RetVal == -1 && errno == EINTR && m_bThreadAStatus == TH_WORKING ) SLEEP(1); + } while (RetVal == -1 && errno == EINTR && m_bThreadAStatus == TH_WORKING ); +#else //Windows OVERLAPPED osReader = {0}; - if (!ReadFile(m_ioFID, Buffer, MAXIMAL_SERIAL_PACKET_LENGTH, &RetVal, &osReader)) { + if( !ReadFile(m_ioFID, Buffer, MAXIMAL_SERIAL_PACKET_LENGTH, &RetVal, &osReader) ){ if (GetLastError() != ERROR_IO_PENDING){ // read not delayed? char tBuffer[256]; sprintf(tBuffer, "Communication Error %d!", GetLastError()); LOG_ERROR(tBuffer); // Error in communications; report it. return -1; - } else { - //fWaitingOnRead = TRUE; + } #ifdef DEBUG_SERIAL_COMMUNICATION + else { + //fWaitingOnRead = TRUE; LOG("WREAD!"); -#endif - }; - } else { - // read completed immediately + } +#endif + ; + } #ifdef DEBUG_SERIAL_COMMUNICATION + else { + // read completed immediately LOG("IMREAD!"); + + } #endif - }; + ; #endif // Linux break; }; @@ -967,24 +972,21 @@ int argusHardwareResourceSerialProvider::sendBlock(unsigned char* Data, int Data #ifdef __linux__ do{ RetVal = write( m_iOutFID, Data, DataSize ); - usleep(100); - } while (RetVal == -1 && (errno == EINTR || errno == EWOULDBLOCK)); + if( RetVal == DataSize ) usleep(100); + } while (RetVal == -1 && (errno == EINTR || errno == EWOULDBLOCK) && m_bThreadAStatus == TH_WORKING ); #else - - //OVERLAPPED ov; - //if (! - WriteFile(m_ioFID, Data, DataSize, &RetVal, NULL);//){ - // RetVal = 0; - // }; + WriteFile(m_ioFID, Data, DataSize, &RetVal, NULL); #endif -#ifdef DEBUG_COMMUNICATION +#ifdef DEBUG_EXTRA char MsgBuffer[CLOG]; sprintf( MsgBuffer, "Sent %d byte(s) of %d", RetVal, DataSize ); LOG( MsgBuffer ); + #ifdef DEBUG_COMMUNICATION for( int i = 0; i < DataSize; i++ ){ sprintf( MsgBuffer, "0x%02X", Data[i] ); LOG( MsgBuffer ); }; + #endif #endif break; }; @@ -992,7 +994,7 @@ int argusHardwareResourceSerialProvider::sendBlock(unsigned char* Data, int Data #ifdef __linux__ if( m_iDeviceFD > -1 ){ - #ifdef DEBUG_SERIAL_COMMUNICATION + #ifdef DEBUG_EXTRA char cBuffer[256]; sprintf(cBuffer, "Write into Port %d bytes", DataSize); LOG(cBuffer); @@ -1012,13 +1014,15 @@ int argusHardwareResourceSerialProvider::sendBlock(unsigned char* Data, int Data if (RetVal < 0) RetVal = 0; - #ifdef DEBUG_SERIAL_COMMUNICATION + #ifdef DEBUG_EXTRA sprintf(cBuffer, "Bytes Sent: %ld", RetVal); LOG(cBuffer); + #ifdef DEBUG_SERIAL_COMMUNICATION for(int zz=0; zz < RetVal; zz++ ) { sprintf(cBuffer, "SD: 0x%02X", (uint8_t)Data[zz]); LOG(cBuffer); }; + #endif #endif } else { @@ -1027,7 +1031,7 @@ int argusHardwareResourceSerialProvider::sendBlock(unsigned char* Data, int Data setConnectionStatus(CS_DISCONNECTED); return -1; }; -#else //Linux +#else // Windows if (sendto( m_sSocket, (char *)Data, DataSize, 0, (struct sockaddr*) &ReceiverAddr, sizeof(ReceiverAddr)) == SOCKET_ERROR) { char cBuffer[256]; sprintf(cBuffer, "sendto() failed with error code : %d", WSAGetLastError()); diff --git a/lib/rgoose/rgooseHardwareResourceSerialProvider.h b/lib/rgoose/rgooseHardwareResourceSerialProvider.h index 5c82f0e9..79329f26 100644 --- a/lib/rgoose/rgooseHardwareResourceSerialProvider.h +++ b/lib/rgoose/rgooseHardwareResourceSerialProvider.h @@ -15,8 +15,16 @@ #include // POSIX terminal control definitions #endif + +#ifdef DEBUG + //#define DEBUG_SERIAL_COMMUNICATION +#endif + #define MAXIMAL_SOCKET_PACKET_LENGTH 102400 -#define MAXIMAL_SERIAL_PACKET_LENGTH MAXIMAL_SOCKET_PACKET_LENGTH + +#ifndef MAXIMAL_SERIAL_PACKET_LENGTH + #define MAXIMAL_SERIAL_PACKET_LENGTH MAXIMAL_SOCKET_PACKET_LENGTH +#endif class argusHardwareResourceSerialProvider: public argusHardwareResource, public basicTransport, public basicDualThread { private: diff --git a/lib/rgoose/rgooseKernel.cpp b/lib/rgoose/rgooseKernel.cpp index a471a200..fdf85c45 100644 --- a/lib/rgoose/rgooseKernel.cpp +++ b/lib/rgoose/rgooseKernel.cpp @@ -185,6 +185,9 @@ bool argusKernel::create( void ){ LOG_ERROR("Failure to get HardwareManager Instance!"); return false; }; + + m_pDBC->setNodeOnline( m_nServerNodeID, ARGUS_NODE_STATUS_WORK ); + //m_pServiceAnnouncer = new ssdpAnnouncer( m_pSettings ); basicSettingsProvider::getInstance()->validate(); @@ -343,6 +346,7 @@ void argusKernel::m_fThreadProc( void ){ int lastTSS = 0; int lastTMS = 0; DBC_EVT_DATA * tEvtPtr; + uint32_t tLazyTimer = ARGUS_KERNEL_LAZY_SECONDS; char pidBuf[16]; sprintf(pidBuf,"pid: %d tid: %d", getpid(), gettid() ); LOG( pidBuf ); @@ -448,7 +452,13 @@ void argusKernel::m_fThreadProc( void ){ if( m_pNodeFactory != NULL ) { m_pNodeFactory->validate(); }; - + // Archive Events; + if( tLazyTimer ){ + tLazyTimer--; + } else { + tLazyTimer = ARGUS_KERNEL_LAZY_SECONDS; + m_pDBC->lazyEventArchiver( ARGUS_KERNEL_LAZY_SECONDS ); + }; };// ops loop SLEEP( SLEEP_KERNEL_INTERVAL ); diff --git a/lib/rgoose/rgooseKernel.h b/lib/rgoose/rgooseKernel.h index d6540e9e..56b02652 100644 --- a/lib/rgoose/rgooseKernel.h +++ b/lib/rgoose/rgooseKernel.h @@ -90,6 +90,7 @@ struct serial_struct { #define SLEEP_KERNEL_INTERVAL 10 #define ONVIF_DISCOVERY_INTERVAL 300 // 5 min #define ONVIF_DISCOVERY_RESULT_TIME 5 +#define ARGUS_KERNEL_LAZY_SECONDS 20 #define ARGUS_KERNEL_TAG_SITE_ID "SITE_ID" #define ARGUS_KERNEL_TAG_SERVER_IDENTITY "IDENTITY" diff --git a/lib/rgoose/rgooseModuleEmbedVideo.cpp b/lib/rgoose/rgooseModuleEmbedVideo.cpp index d962e690..89120caa 100644 --- a/lib/rgoose/rgooseModuleEmbedVideo.cpp +++ b/lib/rgoose/rgooseModuleEmbedVideo.cpp @@ -74,6 +74,8 @@ argusModuleEmbedVideo::argusModuleEmbedVideo( uint32_t moduleID ): argusKernelMo }; n_pNoSignalData = NULL; m_nNoSignalSize = 0; + char tBuff[1024]; + sprintf( m_pBaseSavePath, "%s/data/reports", getcwd(tBuff, 1024) ); #ifdef DEBUG char tB[64]; sprintf( tB, "Web Streams Port: %d", m_sEmbedVideoData.port ); @@ -858,35 +860,92 @@ void argusModuleEmbedVideo::dispatchEvent( EVENT_CONTAINER *Evt ){ #ifdef DEBUG LOG("Capture Event"); #endif - //cam_id - //parent_evt_id - char MD5[33]; - uint32_t id = 0; - if( saveStreamPicture( id, (CSTR*)&MD5) ) { - + if( Evt->m_ref_id && Evt->m_db_id ){ + uint32_t tPicID = saveStreamPicture( Evt->m_ref_id ); + if( tPicID ){ + m_pDBC->addPictureEvent( Evt->m_db_id, tPicID ); + } else { +#ifdef DEBUG + LOG_ERROR("No Picture is Saved!"); +#endif + }; + } else { +#ifdef DEBUG + LOG_ERROR("No Stream ID or Event ID in Event Data!"); +#endif }; break; }; }; break; }; + case EVT_CLASS_CAMERA_CTRL:{ + switch ( Evt->m_eType ) { + case EVT_CAMERA_ON_POSITION:{ +#ifdef DEBUG + LOG("Cam On Position After Event -> Capture Picture"); +#endif + if( Evt->m_ref_id && Evt->m_db_id ){ + uint32_t tPicID = saveStreamPicture( Evt->m_ref_id ); + if( tPicID ){ + m_pDBC->addPictureEvent( Evt->m_db_id, tPicID ); + } else { +#ifdef DEBUG + LOG_ERROR("No Picture is Saved!"); +#endif + }; + } else { +#ifdef DEBUG + LOG_ERROR("No Stream ID or Event ID in Event Data!"); +#endif + }; + break; + }; + }; + break; + }; }; }; }; -bool argusModuleEmbedVideo::saveStreamPicture( uint32_t id, CSTR *MD5 ){ +uint32_t argusModuleEmbedVideo::saveStreamPicture( uint32_t id ){ + uint32_t retVal = 0; if( m_mapCAPTURES.find( id ) != m_mapCAPTURES.end() ){ - CSTR cMD5 = NULL; FILE *tFD; m_mPictureProtector.lock(); - if( cMD5 ) { - strncpy( *MD5, cMD5, 32 ); - (*MD5)[32]=(char)0; + size_t tBufferSize = m_mapCAPTURES[id].size(); + uint8_t * tBuffer = (uint8_t *) malloc( tBufferSize ); + if( tBuffer ){ + memcpy( tBuffer, m_mapCAPTURES[id].data(), tBufferSize ); + m_mPictureProtector.unlock(); + CSTR MD5 = MD5Binary( tBuffer, tBufferSize ); + if( MD5 ){ + char tFileName[MAX_PATH]; + if( generateSavePicPath( MD5, (CSTR *)&tFileName ) ){ + FILE *fd = fopen( tFileName, "wb+" ); + if( fd ){ + fwrite(tBuffer, 1, tBufferSize, fd ); + fclose(fd); + retVal = m_pDBC->addPicture( id, MD5, "jpg" ); + } else { + LOG_ERROR("Can not open picture file!"); + }; + } else { + LOG_ERROR("Can not generate file name!"); + }; + free(MD5); + } else { + LOG_ERROR("no MD5 Hash!"); + }; + free(tBuffer); + } else { + m_mPictureProtector.unlock(); + LOG_ERROR("no memory to allocate!"); }; - m_mPictureProtector.unlock(); }; - return false; + return retVal; }; + int argusModuleEmbedVideo::getWidh( void ){ if( m_sEmbedVideoData.width ){ return m_sEmbedVideoData.width; @@ -901,6 +960,18 @@ int argusModuleEmbedVideo::getHeight( void ){ return -1; }; +bool argusModuleEmbedVideo::generateSavePicPath( CSTR MD5, CSTR *Output ){ + if( MD5 ){ + if( strlen(MD5)>4 ){ + if( Output && *Output ){ + sprintf( *Output,"%s/%c%c/%c%c/%s.jpg", m_pBaseSavePath, MD5[0], MD5[1], MD5[2], MD5[3], MD5 ); + return true; + }; + }; + }; + return false; +}; + #undef LOG #undef LOG_ERROR #undef TLOG diff --git a/lib/rgoose/rgooseModuleEmbedVideo.h b/lib/rgoose/rgooseModuleEmbedVideo.h index 53571441..8c3d8088 100644 --- a/lib/rgoose/rgooseModuleEmbedVideo.h +++ b/lib/rgoose/rgooseModuleEmbedVideo.h @@ -149,8 +149,10 @@ class argusModuleEmbedVideo: public argusKernelModule, public basicMediaDestinat uint32_t m_nNoSignalSize; cv::Mat m_mLogoPic; cv::Mat m_mLogoMask; + char m_pBaseSavePath[PATH_MAX]; bool registerForMediaStream( uint32_t id, WEB_CLIENT_CTX *&CTX ); - bool saveStreamPicture( uint32_t id, CSTR *MD5 ); + uint32_t saveStreamPicture( uint32_t id ); + bool generateSavePicPath( CSTR MD5, CSTR *Output ); protected: /* From Basic Thread */ virtual void m_fThreadProc( void ); diff --git a/lib/rgoose/rgooseModuleFlyHunter.cpp b/lib/rgoose/rgooseModuleFlyHunter.cpp index 1990c7d3..a402764b 100644 --- a/lib/rgoose/rgooseModuleFlyHunter.cpp +++ b/lib/rgoose/rgooseModuleFlyHunter.cpp @@ -59,7 +59,7 @@ bool argusModuleFlyHunter::startService(){ }; bool argusModuleFlyHunter::stopService( bool force ){ - + return true; }; void argusModuleFlyHunter::m_fThreadProc(){ diff --git a/lib/rgoose/rgooseModuleKafka.cpp b/lib/rgoose/rgooseModuleKafka.cpp index d93a0661..fc865a20 100644 --- a/lib/rgoose/rgooseModuleKafka.cpp +++ b/lib/rgoose/rgooseModuleKafka.cpp @@ -135,10 +135,21 @@ void argusModuleKafka::m_fThreadProc( void ){ LOG ( BUF ); try{ Json::Value root; +#ifdef OLD_WAY_JSON Json::Reader reader; if( !reader.parse( BUF, root ) ){ LOG_ERROR( "Error parsing the string" ); } else { +#else + JSONCPP_STRING err; + Json::CharReaderBuilder builder; + const std::unique_ptr reader(builder.newCharReader()); + if (!reader->parse(BUF, BUF + len, &root, &err)) { + LOG_ERROR( "Error parsing the string" ); + LOG_ERROR( err.c_str() ); + } else { +#endif + if (root.size()) { FH_CTRL_DATA * tData; basicEventTypeID evtID = EVT_NOINIT; @@ -148,14 +159,14 @@ void argusModuleKafka::m_fThreadProc( void ){ memset( tData, 0, sizeof(FH_CTRL_DATA)); tVal = root["id"]; - if (tVal != NULL) { + if (!tVal.isNull()) { #ifdef DEBUG LOG(tVal.asString().c_str()); #endif sprintf( tData->cmdUUID, "%s", tVal.asString().c_str() ); }; tVal = root["action"]; - if (tVal != NULL) { + if (!tVal.isNull()) { #ifdef DEBUG LOG( tVal.asString().c_str() ); #endif @@ -174,14 +185,14 @@ void argusModuleKafka::m_fThreadProc( void ){ }; }; tVal = root["event_id"]; - if (tVal != NULL) { + if (!tVal.isNull()) { #ifdef DEBUG LOG( tVal.asString().c_str() ); #endif sprintf( tData->evtUUID, "%s", tVal.asString().c_str() ); }; tVal = root["target_id"]; - if (tVal != NULL) { + if (!tVal.isNull()) { #ifdef DEBUG LOG( tVal.asString().c_str() ); #endif diff --git a/lib/rgoose/rgooseModuleOnvifObserver.cpp b/lib/rgoose/rgooseModuleOnvifObserver.cpp index fd5f3d7e..cbd9c492 100644 --- a/lib/rgoose/rgooseModuleOnvifObserver.cpp +++ b/lib/rgoose/rgooseModuleOnvifObserver.cpp @@ -74,7 +74,9 @@ argusModuleOnvifObserver::argusModuleOnvifObserver( uint32_t ModuleID ): argusKe m_bEnabled = false; m_pEventHeap = basicEventHeap::getInstance(); m_pIpAddresses = NULL; - m_nStatus = 0; + m_vResultPool.clear(); + m_nFinishedProbesCount = 0; + m_nNIFsCount = 0; #ifdef __linux__ m_bWSAOK = true; #else @@ -130,12 +132,14 @@ bool argusModuleOnvifObserver::stopService( bool force ){ #ifdef DEBUG LOG("No More Probes!"); #endif + m_mResultProtector.lock(); if (m_vResultPool.size()){ // Clear structures for( vectorOBSERVER_RESULT::iterator index = m_vResultPool.begin(); index < m_vResultPool.end(); index++){ free(*index); }; m_vResultPool.clear(); }; + m_mResultProtector.unlock(); #ifdef DEBUG LOG("Data is Cleared!"); #endif @@ -144,9 +148,6 @@ bool argusModuleOnvifObserver::stopService( bool force ){ }; void argusModuleOnvifObserver::m_fThreadProc(){ - double dStatus = 0, dStep = 30.0; - int id = 0; - dStatus = 0; m_bThreadStatus = TH_WORKING; if( !m_bEnabled ) { m_bThreadStatus = TH_ENDED; @@ -157,35 +158,37 @@ void argusModuleOnvifObserver::m_fThreadProc(){ #ifdef DEBUG LOG("Module Started!"); #endif + while( m_bThreadStatus < TH_ENDED ) { - id = 0; + LOG("...Loop..."); if( m_pKernel != NULL ){ -#ifdef DEBUG_EXTRA +#ifdef DEBUG LOG("Check IPS"); #endif argusHardwareManager *tHWM = m_pKernel->getHardwareManager(); if( tHWM != NULL ) { + LOG("...HWM..."); DBC_INT_LIST *rIDS = tHWM->requestResourcesByType( ARGUS_HARDWARE_PROVIDER_NETWORK ); if( rIDS != NULL ) { - dStep = 30.0 / (rIDS->size() + 1); + bool ProbeIsStarted = false; for( DBC_INT_LIST::iterator idx = rIDS->begin(); idx < rIDS->end(); idx++ ){ argusHardwareResourceNetwork *tRES = (argusHardwareResourceNetwork *) tHWM->requestResource( ARGUS_HARDWARE_PROVIDER_NETWORK, *idx ); if( tRES != NULL ) { CSTR BC = tRES->getBroadcast(); if( BC!= NULL ) { -#ifdef DEBUG_EXTRA +#ifdef DEBUG LOG("Have BC Address"); + LOG(BC); #endif - startProbe( BC, id, (int) dStep ); -#ifdef DEBUG_EXTRA + startProbe( BC, m_nNIFsCount ); + ProbeIsStarted = true; +#ifdef DEBUG LOG("Probe Started"); #endif - dStatus += dStep; - m_nStatus = (int)dStatus; - id++; + m_nNIFsCount++; free( BC ); } -#ifdef DEBUG_EXTRA +#ifdef DEBUG else { LOG("NO BC Address"); } @@ -196,40 +199,55 @@ void argusModuleOnvifObserver::m_fThreadProc(){ }; }; delete( rIDS ); - } -#ifdef DEBUG_EXTRA - else { + if(ProbeIsStarted == false ){ + LOG("No Networks Detected!"); + m_bEnabled = false; + }; + } else { LOG("No Networks Detected!"); - } -#endif - ; + m_bEnabled = false; + }; } else { LOG_ERROR("No HW Manager"); }; } else { LOG_ERROR("Kernel Not Assigned!" ); }; -#ifdef DEBUG_EXTRA +#ifdef DEBUG LOG("Start Default Probe"); + LOG( HTTPMU_HOST_ADDRESS ); #endif - startProbe(HTTPMU_HOST_ADDRESS, id, (int)dStep); - dStatus += dStep; - m_nStatus = (int)dStatus; - - // Check Finished Threads; - for( vectorOBSERVER_CTX::iterator index = m_vThreads.begin(); index < m_vThreads.end(); index++ ) { - if( (*index)->context->isFinished ){ + startProbe(HTTPMU_HOST_ADDRESS, m_nNIFsCount ); + m_nNIFsCount++; + while ( ( m_nFinishedProbesCount < m_nNIFsCount ) && ( m_bThreadStatus < TH_ENDED ) ) { + // Whait Till All Probes Finished + m_mThreadProtector.lock(); + for( vectorOBSERVER_CTX::iterator index = m_vThreads.begin(); index < m_vThreads.end(); index++ ) { + if( (*index)->context->isFinished ){ #ifdef DEBUG_EXTRA - LOG("Probe Exits!"); + LOG("Probe Ended!"); #endif - pthread_join( (*index)->m_hThreadHandle, NULL ); + pthread_join( (*index)->m_hThreadHandle, NULL ); + + }; + free((*index)->context); + free((*index)); + m_vThreads.erase( index ); + m_nFinishedProbesCount++; }; - free((*index)->context); - free((*index)); - m_vThreads.erase( index ); + m_mThreadProtector.unlock(); + + for( int i=300; i, m_bThreadStatus < TH_ENDED; i-- ) SLEEP( 100 ); +#ifdef DEBUG + char tT[128]; + sprintf( tT, "Finished %d Probes of %d ",m_nFinishedProbesCount, m_nNIFsCount ); + LOG( tT ); +#endif }; - for( int i=300; i, m_bThreadStatus < TH_ENDED; i-- ) SLEEP( 100 ); + m_nNIFsCount = 0; + m_nFinishedProbesCount = 0; }; + LOG("---LOOP-FINISHED----"); }; void argusModuleOnvifObserver::dispatchEvent(EVENT_CONTAINER *Evt){ @@ -245,38 +263,53 @@ bool argusModuleOnvifObserver::reloadSettings(){ return true; }; -PROBE_CTX *argusModuleOnvifObserver::init_PROBE_CTX(CSTR ADR, int ID, int stp){ +PROBE_CTX *argusModuleOnvifObserver::init_PROBE_CTX(CSTR ADR, int ID ){ PROBE_CTX *RetVal; RetVal = (PROBE_CTX*)malloc(sizeof(PROBE_CTX)); if (RetVal == NULL) return NULL; sprintf(RetVal->IpAddress, "%s", ADR); RetVal->Port = HTTPMU_HOST_PORT; RetVal->socketFD = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - RetVal->send_buff = (CSTR) SEARCH_REQUEST_STRING; - RetVal->r_address.sin_family = AF_INET; - RetVal->r_address.sin_port = htons(RetVal->Port); - RetVal->r_address.sin_addr.s_addr = inet_addr(RetVal->IpAddress); - RetVal->bOptVal = true; - RetVal->bOptLen = sizeof(bool); - RetVal->iOptLen = sizeof(int); - RetVal->AddressID = ID; - RetVal->step = stp; - RetVal->isFinished = false; - RetVal->observer = this; - return RetVal; + if( RetVal->socketFD !=-1 ){ + RetVal->send_buff = (CSTR)SEARCH_REQUEST_STRING; + RetVal->r_address.sin_family = AF_INET; + RetVal->r_address.sin_port = htons(RetVal->Port); + RetVal->r_address.sin_addr.s_addr = inet_addr(RetVal->IpAddress); + RetVal->bOptVal = true; + RetVal->bOptLen = sizeof(bool); + RetVal->iOptLen = sizeof(int); + RetVal->AddressID = ID; + RetVal->isFinished = false; + RetVal->observer = this; + return RetVal; + } else { + free( RetVal ); + }; + return NULL; }; void *argusModuleOnvifObserver::probeThreadProc( void *ptr ){ PROBE_CTX *me; if (ptr == NULL) return NULL; me = (PROBE_CTX *)ptr; - + if (me->observer == NULL ){ +#ifdef __linux__ + close(me->socketFD); +#else + closesocket(me->socketFD); +#endif +#ifdef DEBUG + TLOG_ERROR("No Observer OBJ -> Probe Finished"); +#endif + me->isFinished = true; + return NULL; + }; //Detach Self! //pthread_detach( pthread_self() ); #ifdef DEBUG //TLOG("Probe Request Sent"); #endif - me->RetVal = setsockopt(me->socketFD, SOL_SOCKET, SO_BROADCAST, (char*)&me->bOptVal, me->bOptLen); + me->RetVal = setsockopt(me->socketFD, SOL_SOCKET, SO_BROADCAST, (char*)&me->bOptVal, me->bOptLen ); me->RetVal = sendto(me->socketFD, me->send_buff, strlen(me->send_buff), 0, (struct sockaddr*)&me->r_address, sizeof(struct sockaddr_in)); #ifdef DEBUG //sprintf(me->buff, "Sent %d Bytes", me->RetVal ); @@ -290,9 +323,18 @@ void *argusModuleOnvifObserver::probeThreadProc( void *ptr ){ #endif for( me->index = 1; me->index <= 10; me->index++ ){ memset(me->buff, 0, sizeof(me->buff)); - me->RetVal = recvfrom(me->socketFD, me->buff, MAX_BUFF_SIZE, 0, NULL, NULL); +#ifdef DEBUG + struct sockaddr src_addr; + socklen_t addrlen = sizeof( src_addr ); + me->RetVal = recvfrom( me->socketFD, me->buff, MAX_BUFF_SIZE, 0, &src_addr, &addrlen ); + char TT[64]; + sprintf( TT, "{%d}MSG[%d] from %s", me->socketFD, me->RetVal, inet_ntoa(((struct sockaddr_in *)&src_addr)->sin_addr) ); + TLOG( TT ); +#else + me->RetVal = recvfrom( me->socketFD, me->buff, MAX_BUFF_SIZE, 0, NULL, NULL ); +#endif if( me->RetVal < 0 ){//SOCKET_ERROR){ - SLEEP(1000); + SLEEP(10); continue; }; if( me->RetVal == 0 ) continue; // No Data @@ -317,47 +359,60 @@ void *argusModuleOnvifObserver::probeThreadProc( void *ptr ){ TLOG_ERROR("The device descripe XML file is not a valid XML file. Cann't find root element."); continue; } else { - TLOG_ERROR("XML PARSED OK"); +#ifdef DEBUG + TLOG_ERROR("Probe XML parsed"); +#endif XMLNode Body = response.getChildNode( "Body", 0 ); if(!Body.isEmpty()){ + TLOG("Have Body elm"); XMLNode ProbeMatches = Body.getChildNode("ProbeMatches", 0);//EndpointReference if(!ProbeMatches.isEmpty()) { + TLOG("Have ProbeMathes elm"); int matches = ProbeMatches.nChildNode(); - OBSERVER_RESULT *tRecord; for(int index=0;indexresultID = me->AddressID; if(!ProbeMatch.isEmpty()) { + TLOG("Have ProbeMatch elm"); { XMLNode node = ProbeMatch.getChildNode("EndpointReference", 0); if(!node.isEmpty()) { + TLOG("Have ProbeMatch EndpointReference"); XMLNode nod = node.getChildNode("Address", 0); - char tBuf[CLOG]; - sprintf(tBuf,"%s", nod.getText(0)); - CArray *tArr; - tArr = explode(':',tBuf); - for(int j=0; jsize(); j++) { - if( strlen(tArr->at(j)) > 10 ) { - sprintf(tRecord->RefID,"%s",tArr->at(j)); - break; - }; - }; - tArr->clear(); - delete(tArr); + if(!nod.isEmpty()){ + char tBuf[CLOG]; + sprintf(tBuf,"%s", nod.getText(0)); + CArray *tArr; + TLOG("Before Explode"); + tArr = explode(':',tBuf); + TLOG("After Explode"); + for(int j=0; jsize(); j++) { + if( strlen(tArr->at(j)) > 10 ) { + sprintf(tRecord->RefID,"%s",tArr->at(j)); + break; + }; + }; + tArr->clear(); + delete(tArr); + + }; }; } { XMLNode node = ProbeMatch.getChildNode("Types", 0); - char tBuf[CLOG]; - sprintf(tBuf,"%s", node.getText(0)); - CArray *tArr; - tArr = explode(' ',tBuf); - sprintf(tRecord->Type,"%s",tArr->at(0)); - tArr->clear(); - delete(tArr); + if( !node.isEmpty() ){ + char tBuf[CLOG]; + sprintf(tBuf,"%s", node.getText(0)); + CArray *tArr; + tArr = explode(' ',tBuf); + sprintf(tRecord->Type,"%s",tArr->at(0)); + tArr->clear(); + delete(tArr); + } } { XMLNode node = ProbeMatch.getChildNode("Scopes", 0); @@ -411,33 +466,37 @@ void *argusModuleOnvifObserver::probeThreadProc( void *ptr ){ delete(tArr); } }; + me->observer->m_mResultProtector.lock(); + TLOG("FF"); me->observer->m_vResultPool.push_back(tRecord); + me->observer->m_mResultProtector.unlock(); + TLOG("FA"); }; }; }; }; }; }; - }; - me->observer->m_nStatus += me->step; + }; + TLOG("BB"); #ifdef __linux__ close(me->socketFD); #else closesocket(me->socketFD); #endif -#ifdef DEBUG_EXTRA +#ifdef DEBUG TLOG("Probe Finished"); #endif me->isFinished = true; return NULL; }; -bool argusModuleOnvifObserver::startProbe(CSTR IP, int ID, int stp){ +bool argusModuleOnvifObserver::startProbe( CSTR IP, int ID ){ #ifdef DEBUG_EXTRA LOG("Starting Probe!"); LOG( IP ); #endif - PROBE_CTX *tVal = init_PROBE_CTX(IP, ID, stp); + PROBE_CTX *tVal = init_PROBE_CTX( IP, ID ); if( tVal == NULL ) return false; OBSERVER_CTX *tThread; @@ -468,7 +527,9 @@ bool argusModuleOnvifObserver::startProbe(CSTR IP, int ID, int stp){ }; #endif tThread->context = tVal; + m_mThreadProtector.lock(); m_vThreads.push_back(tThread); + m_mThreadProtector.unlock(); #ifdef DEBUG_EXTRA LOG("Probe Created"); #endif @@ -481,6 +542,7 @@ bool argusModuleOnvifObserver::startProbe(CSTR IP, int ID, int stp){ }; bool argusModuleOnvifObserver::validate(){ + m_mResultProtector.lock(); if( m_vResultPool.size() ){ // Clear structures for( vectorOBSERVER_RESULT::iterator index = m_vResultPool.begin(); index < m_vResultPool.end(); index++){ #ifdef DEBUG_EXTRA @@ -513,6 +575,7 @@ bool argusModuleOnvifObserver::validate(){ LOG("No Online IP Cameras in Network"); #endif }; + m_mResultProtector.unlock(); return true; }; diff --git a/lib/rgoose/rgooseModuleOnvifObserver.h b/lib/rgoose/rgooseModuleOnvifObserver.h index fd6bb86d..dacd10b0 100644 --- a/lib/rgoose/rgooseModuleOnvifObserver.h +++ b/lib/rgoose/rgooseModuleOnvifObserver.h @@ -4,6 +4,7 @@ #include "../data/protocol/xmlParser.h" #include "rgooseModule.h" #include "../components/base/basicThread.h" +#include "../components/base/basicMutex.h" #include "../components/base/basicEventHeap.h" @@ -17,27 +18,26 @@ #define DEFAULT_HTTP_PORT 80 -typedef vector vectorOBSERVER_RESULT; +typedef std::vector vectorOBSERVER_RESULT; class argusModuleOnvifObserver; typedef struct S_PROBE_CTX{ - int AddressID; - char IpAddress[16]; - int Port; - int socketFD; - char buff[MAX_BUFF_SIZE + 1]; - CSTR send_buff; - CSTR recv_buff; - struct sockaddr_in r_address; - bool bOptVal; - int bOptLen; - int iOptLen; - int RetVal; - int index; - int step; - bool isFinished; - argusModuleOnvifObserver *observer; + int AddressID; + char IpAddress[16]; + int Port; + int socketFD; + char buff[MAX_BUFF_SIZE + 1]; + CSTR send_buff; + CSTR recv_buff; + struct sockaddr_in r_address; + bool bOptVal; + int bOptLen; + int iOptLen; + int RetVal; + int index; + bool isFinished; + argusModuleOnvifObserver * observer; }PROBE_CTX; typedef struct S_OBSERVER_CTX{ @@ -50,7 +50,7 @@ typedef struct S_OBSERVER_CTX{ PROBE_CTX * context; }OBSERVER_CTX; -typedef vector vectorOBSERVER_CTX; +typedef std::vector vectorOBSERVER_CTX; class argusModuleOnvifObserver: public argusKernelModule, public basicThread { @@ -60,15 +60,18 @@ class argusModuleOnvifObserver: public argusKernelModule, public basicThread { localIpAddresses * m_pIpAddresses; sourcePool m_vUsedDevices; + basicMutex m_mResultProtector; vectorOBSERVER_RESULT m_vResultPool; + basicMutex m_mThreadProtector; vectorOBSERVER_CTX m_vThreads; bool m_bWSAOK; - int m_nStatus; + int m_nFinishedProbesCount; + int m_nNIFsCount; - PROBE_CTX * init_PROBE_CTX( CSTR ADR, int ID, int stp = 1); + PROBE_CTX * init_PROBE_CTX( CSTR ADR, int ID ); bool loadAssignedSources(void); - bool startProbe( CSTR IP, int ID, int stp ); + bool startProbe( CSTR IP, int ID ); static void * probeThreadProc(void *); protected: virtual void m_fThreadProc( void ); diff --git a/lib/rgoose/rgooseModuleZLMedia.cpp b/lib/rgoose/rgooseModuleZLMedia.cpp index 0a3a6966..b0bff3fd 100644 --- a/lib/rgoose/rgooseModuleZLMedia.cpp +++ b/lib/rgoose/rgooseModuleZLMedia.cpp @@ -40,10 +40,10 @@ argusModuleZLMedia::argusModuleZLMedia( uint32_t id ): argusKernelModule( id, AR char tBuff[256]; sprintf( tBuff,"%s_pxd", m_sSettings.key ); //m_pDBC->addNodeSocket( m_pKernel->getServerNodeId(), m_nDBID, ARGUS_NODE_SOCK_TYPE_NETWORK_DVR, ARGUS_NODE_SOCK_MODE_IN, true, tBuff, "ZLMEDIA Digital" ); - m_pDBC->addResource( m_pKernel->getSiteId(), m_pKernel->getServerNodeId(), ARGUS_HARDWARE_IP_VIDEO_IN, tBuff ); + m_pDBC->addResource( m_pKernel->getServerNodeId(), ARGUS_HARDWARE_IP_VIDEO_IN, tBuff ); sprintf( tBuff,"%s_pxa", m_sSettings.key ); //m_pDBC->addNodeSocket( m_pKernel->getServerNodeId(), m_nDBID, ARGUS_NODE_SOCK_TYPE_AD_CONVERTER, ARGUS_NODE_SOCK_MODE_IN, true, tBuff, "ZLMEDIA Analog" ); - m_pDBC->addResource( m_pKernel->getSiteId(), m_pKernel->getServerNodeId(), ARGUS_HARDWARE_ANALOG_VIDEO_IN, tBuff ); + m_pDBC->addResource( m_pKernel->getServerNodeId(), ARGUS_HARDWARE_ANALOG_VIDEO_IN, tBuff ); }; }; updateMRLs(); diff --git a/lib/rgoose/rgooseNode2D.cpp b/lib/rgoose/rgooseNode2D.cpp index ff426a31..4a8fedcc 100644 --- a/lib/rgoose/rgooseNode2D.cpp +++ b/lib/rgoose/rgooseNode2D.cpp @@ -34,6 +34,7 @@ ARGUS_2DSensor::ARGUS_2DSensor( uint32_t id ):argusNetNode( id ), basicThread(), tUART = m_pDBC->getUartData( m_sLRF_DATA.uart_id ); if( tUART!= NULL ) { m_bPortType = tUART->type; + // in start service setDeviceID( m_sLRF_DATA.device_id ); free( tUART ); }; free( tDATA ); @@ -177,7 +178,13 @@ void ARGUS_2DSensor::m_fThreadProc( void ){ break; }; }; - }; + } +#ifdef DEBUG + else { + LOG("HWM Has No UART PORT!"); + } +#endif + ; } else { LOG_ERROR("Can not access Hardware Manager"); }; @@ -467,10 +474,11 @@ bool ARGUS_2DSensor::packetHandler( protocolPackage *Package ){ if( ( cDeviceID == m_sLRF_DATA.device_id ) || ( m_sLRF_DATA.device_id == 0 ) ) { #ifdef DEBUG char tBuff[256]; - //LOG("Device Reply"); - //sprintf( tBuff, "Code 0x%02X",Package->m_pData[CMD_IDX] ); - //LOG( tBuff ); - // PRINTOUT; + #ifdef DEBUG_EXTRA + LOG("Device Reply"); + sprintf( tBuff, "Code 0x%02X",Package->m_pData[CMD_IDX] ); + LOG( tBuff ); + #endif #endif m_bTimeOutCounter = LGS_DEFAULT_TO_COUNTER; @@ -631,8 +639,20 @@ bool ARGUS_2DSensor::packetHandler( protocolPackage *Package ){ m_pDBC->setNodeOnline( m_sNodeData.node_id, ARGUS_NODE_STATUS_WORK ); } else { m_sLRF_DATA.data_status = m_pDBC->getLRFDataStatus( m_sLRF_DATA.id ); - if( m_sLRF_DATA.data_status ) { - if( m_sLRF_DATA.data_status < ARGUS_DS_VALID ) { + switch ( m_sLRF_DATA.data_status ) { + case ARGUS_DS_NONE:{ + // Go Sleep and Restart in 2 seconds + m_bVersionStringValid = false; + m_nSleepTime = LGS_DEFAULT_SLEEP_TIME; + m_bTimeOutCounter = 6; // 2 sec + setWM( ANODE_WM_2D_SLEEP_AND_RECONNECT ); + + m_pDBC->addNotification( ARGUS_NM_DEVICE_MISTMATCH, ARGUS_NM_DISMISS_LEVEL_ADMIN, m_sNodeData.node_id ); + m_pDBC->setNodeOnline( m_sNodeData.node_id, ARGUS_NODE_STATUS_TROUBLE ); + break; + }; + case ARGUS_DS_CREATED: + case ARGUS_DS_GET_CONFIG:{ //In case Init new Device - updating SN and Version m_bVersionStringValid = true; m_bSerialStringValid = true; @@ -644,7 +664,10 @@ bool ARGUS_2DSensor::packetHandler( protocolPackage *Package ){ m_pDBC->setLRFDataStatus( m_sLRF_DATA.id, ARGUS_DS_VALID ); //m_pDBC->setLRFDataStatus( m_sLRF_DATA.id, ARGUS_DS_GET_CONFIG ); m_pDBC->setNodeOnline( m_sNodeData.node_id, ARGUS_NODE_STATUS_WORK ); - } else { + break; + }; + case ARGUS_DS_VALID: + case ARGUS_DS_CONF_MISTMATCH:{ // Go Sleep and Restart in 2 seconds m_bVersionStringValid = false; m_nSleepTime = LGS_DEFAULT_SLEEP_TIME; @@ -656,16 +679,8 @@ bool ARGUS_2DSensor::packetHandler( protocolPackage *Package ){ m_pDBC->setLRFDataStatus( m_sLRF_DATA.id, ARGUS_DS_CONF_MISTMATCH ); m_pDBC->addNotification( ARGUS_NM_DEVICE_MISTMATCH, ARGUS_NM_DISMISS_LEVEL_ADMIN, m_sNodeData.node_id ); m_pDBC->setNodeOnline( m_sNodeData.node_id, ARGUS_NODE_STATUS_TROUBLE ); + break; }; - } else { - // Go Sleep and Restart in 2 seconds - m_bVersionStringValid = false; - m_nSleepTime = LGS_DEFAULT_SLEEP_TIME; - m_bTimeOutCounter = 6; // 2 sec - setWM( ANODE_WM_2D_SLEEP_AND_RECONNECT ); - - m_pDBC->addNotification( ARGUS_NM_DEVICE_MISTMATCH, ARGUS_NM_DISMISS_LEVEL_ADMIN, m_sNodeData.node_id ); - m_pDBC->setNodeOnline( m_sNodeData.node_id, ARGUS_NODE_STATUS_TROUBLE ); }; }; break; diff --git a/lib/rgoose/rgooseNodeFactory.cpp b/lib/rgoose/rgooseNodeFactory.cpp index 2cbad326..b72c910b 100644 --- a/lib/rgoose/rgooseNodeFactory.cpp +++ b/lib/rgoose/rgooseNodeFactory.cpp @@ -509,10 +509,12 @@ void argusNodeFactory::m_fThreadProc( void ){ for( DBC_INT_LIST::iterator idz = tList->begin(); idz < tList->end(); idz++ ) if( (*idz) == (*idx)->getDbId() ) tRemoved = false; // If Not - check validation if( !tRemoved ){ + LOG("Node Among Active Nodes.... make Validation"); tRemoved = !(*idx)->validate(); }; // If Node is Invalid - Removing if( tRemoved ) { + LOG("Node not passed Validation!"); deleteNode((*idx)); }; }; diff --git a/lib/rgoose/rgooseNodePTZCamControl.cpp b/lib/rgoose/rgooseNodePTZCamControl.cpp index b1f79483..7bfd8fa8 100644 --- a/lib/rgoose/rgooseNodePTZCamControl.cpp +++ b/lib/rgoose/rgooseNodePTZCamControl.cpp @@ -152,6 +152,9 @@ bool ARGUS_PTZCAM::validate(){ if( !argusNetNode::m_pDBC ) return false; //Validate Node Settings { +#ifdef DEBUG + LOG("Validation Stage 1"); +#endif DBC_NODE_DATA *tDATA = argusNetNode::m_pDBC->getNodeData( m_sNodeData.node_id ); if( tDATA ) { if( memcmp( &m_sNodeData, tDATA, sizeof(DBC_NODE_DATA)) != 0 ){ @@ -182,6 +185,9 @@ bool ARGUS_PTZCAM::validate(){ }*/ // Validate Stream { +#ifdef DEBUG + LOG("Validation Stage 2"); +#endif if( !m_bSourceConnected ) { if( m_sNodeData.aux_parameter ) { // Has Choosed Stream if( connectToStream( m_sNodeData.aux_parameter ) ){ @@ -191,6 +197,9 @@ bool ARGUS_PTZCAM::validate(){ }; }; } else { +#ifdef DEBUG + LOG("Validation Stage 3"); +#endif return validateStream(); }; } diff --git a/lib/rgoose/rgooseNodeStaticCamControl.cpp b/lib/rgoose/rgooseNodeStaticCamControl.cpp index c94c6274..c9bf6034 100644 --- a/lib/rgoose/rgooseNodeStaticCamControl.cpp +++ b/lib/rgoose/rgooseNodeStaticCamControl.cpp @@ -41,7 +41,6 @@ ARGUS_CAM::ARGUS_CAM( DBC_NODE_DATA *Data ): basicEventHandler(), argusNetNode( ARGUS_CAM::ARGUS_CAM( uint32_t id ): basicEventHandler(), argusNetNode( id ), ARGUS_Camera(){ m_pLog = basicLogCollection::getInstance(); m_sMediaSource.mediaSourceId = m_sNodeData.aux_id; - memset( &m_sCtrlData, 0, sizeof( CAMERA_CTRL_DATA )); }; ARGUS_CAM::~ARGUS_CAM(){ @@ -59,7 +58,7 @@ bool ARGUS_CAM::stopService(){ void ARGUS_CAM::dispatchEvent( EVENT_CONTAINER *E ){ if( E == NULL ) return; - //if( !m_sCamData.online ) return; + if( !m_bSourceConnected ) return; //if( m_bBusy ) return; switch( E->m_eClass ) { case EVT_CLASS_SENSOR_CLD: @@ -87,7 +86,7 @@ void ARGUS_CAM::dispatchEvent( EVENT_CONTAINER *E ){ #ifdef DEBUG_EXTRA LOG("TARGET IN CAMERA FOV"); #endif - + makeSnap(E->m_db_id); }; }; break; @@ -124,6 +123,7 @@ void ARGUS_CAM::dispatchEvent( EVENT_CONTAINER *E ){ }; }; }; + bool ARGUS_CAM::validate(){ if( m_bThreadStatus == TH_ENDED ) return false; if( !argusNetNode::m_pDBC ) return false; diff --git a/lib/rgoose/rgooseTypes.h b/lib/rgoose/rgooseTypes.h index 1452e160..a7def9a8 100644 --- a/lib/rgoose/rgooseTypes.h +++ b/lib/rgoose/rgooseTypes.h @@ -130,6 +130,7 @@ typedef enum E_ARGUS_HARDWARE_TYPE{ ARGUS_HARDWARE_DIGITAL_VIDEO_IN = 33, ARGUS_HARDWARE_NETWORK_IPV4 = 100, ARGUS_HARDWARE_NETWORK_IPV6 = 101, + ARGUS_HARDWARE_NETWORK_WIFI_AP = 120, ARGUS_HARDWARE_IP_UART = 129, ARGUS_HARDWARE_IP_VIDEO_OUT = 130, ARGUS_HARDWARE_IP_VIDEO_IN = 131