diff --git a/Makefile b/Makefile index 8d507e1..54c1e6e 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ ## with HCAN; if not, write to the Free Software Foundation, Inc., 51 ## Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -## (c) 2010 by Martin Kramer and Ingo Lages, i (dot) lages (at) gmx (dot) de +## (c) 2017 by Ingo Lages, i (dot) lages (at) gmx (dot) de ############################################################################## include ./ARCH.inc @@ -26,68 +26,69 @@ alles: make dep make all make install - make tools xx=all - + make tools xx="sudo make all" clean: - make cDienste xx=clean - make cppDienste xx=clean - make firmware xx=clean parm2=MCU=atmega32 - make firmware xx=clean parm2=MCU=atmega644 - make firmwareOhneEds xx=clean - make strukturen xx=clean - make tools xx=clean + make strukturen xx="sudo make clean" + make cDienste xx="sudo make clean" + make cppDienste xx="sudo make clean" + make firmware xx="sudo make clean" parm2=MCU=atmega32 + make firmware xx="sudo make clean" parm2=MCU=atmega644 + make firmwareOhneEds xx="sudo make clean" + make tools xx="sudo make clean" # sudo find -type f -name ".depend" | xargs rm -f dep: - make cppDienste xx=dep + make cppDienste xx="sudo make dep" all: - make strukturen xx=all - make cDienste xx=all - make cppDienste xx=all - make firmware xx=all parm2=MCU=atmega32 - make firmware xx=clean MCU=atmega644; make firmware xx=all MCU=atmega644 - make firmwareOhneEds xx=clean; make firmwareOhneEds xx=all + make strukturen xx="make all" + make cDienste xx="make all" + make cppDienste xx="make all" + make firmware xx="make all" parm2=MCU=atmega32 + make firmware xx="sudo make clean" MCU=atmega644; make firmware xx="make all" MCU=atmega644 + make firmwareOhneEds xx="sudo make clean"; make firmwareOhneEds xx="make all" install: - make strukturen xx=install - make cDienste xx=install - make cppDienste xx=install + make strukturen xx="sudo make install" + make cDienste xx="sudo make install" + make cppDienste xx="sudo make install" ############################################################################## # Nun kann die Firmware geladen werden (Bootloader flashen, Firmware loaden) # ############################################################################## +staticAnalyse: + make cDienste xx="scan-build -o ./scanBuild make all -j4" strukturen: - cd xml; sudo make $(xx) + cd xml; $(xx) cDienste: - cd hcand; sudo make $(xx) - cd hcanaddressd; sudo make $(xx) - cd hcansocketd; sudo make $(xx) - cd hcan4mqttpc; sudo make $(xx) + cd hcand; $(xx) + cd hcanaddressd; $(xx) + cd hcansocketd; $(xx) + cd hcan4mqttpc; $(xx) cppDienste: - cd libhcan++; test -d .depend || sudo echo "" > .depend; sudo make $(xx) - cd telican; test -d .depend || sudo echo "" > .depend; sudo make $(xx) - cd libhcandata; test -d .depend || sudo echo "" > .depend; make $(xx) - cd check_hcan; test -d .depend || sudo echo "" > .depend; sudo make $(xx) - cd hcanswd; test -d .depend || sudo echo "" > .depend; make $(xx) - cd hcandq; test -d .depend || sudo echo "" > .depend; make $(xx) + cd libhcan++; test -d .depend || sudo echo "" > .depend; $(xx) + cd telican; test -d .depend || sudo echo "" > .depend; $(xx) + cd libhcandata; test -d .depend || sudo echo "" > .depend; $(xx) + cd check_hcan; test -d .depend || sudo echo "" > .depend; $(xx) + cd hcanswd; test -d .depend || sudo echo "" > .depend; $(xx) + cd hcandq; test -d .depend || sudo echo "" > .depend; $(xx) firmware: - cd hcanbl; sudo make $(xx) $(parm2) - cd firmwares/controllerboard-1612-v01; sudo make $(xx) $(parm2) - cd firmwares/userpanel-v01; sudo make $(xx) $(parm2) + cd hcanbl; $(xx) $(parm2) + cd firmwares/controllerboard-1612-v01; $(xx) $(parm2) + cd firmwares/userpanel-v01; $(xx) $(parm2) firmwareOhneEds: - cd firmwares/usv-modul; sudo make $(xx) + cd firmwares/usv-modul; $(xx) tools: - cd tools; sudo make $(xx) - cd tools/hcanextid; sudo make $(xx) + cd tools; $(xx) + cd tools/hcanextid; $(xx) release: cd firmwares/controllerboard-1612-v01; sudo make release MCU=atmega32 diff --git a/check_hcan/README.md b/check_hcan/README.md index 3e880c0..3bf6aa7 100644 --- a/check_hcan/README.md +++ b/check_hcan/README.md @@ -1 +1 @@ -[Wiki -> check_hcan](https://github.com/hcanIngo/openHCAN/wiki/check_hcan) +[check_hcan: Ueberwachen einer HCAN-Installation via Nagios](https://github.com/hcanIngo/openHCAN/wiki/check_hcan) diff --git a/hcan4mqttpc/Makefile b/hcan4mqttpc/Makefile index 6e0b7e7..23d5a86 100644 --- a/hcan4mqttpc/Makefile +++ b/hcan4mqttpc/Makefile @@ -1,39 +1,28 @@ TARGET = hcan4mqttpc -OBJ = main.o mqttClient.o mqttHcan.o -OBJ += ./MQTTPacket/src/MQTTConnectClient.o -OBJ += ./MQTTPacket/src/MQTTSerializePublish.o -OBJ += ./MQTTPacket/src/MQTTPacket.o -OBJ += ./MQTTPacket/src/MQTTSubscribeClient.o -OBJ += ./MQTTPacket/src/MQTTDeserializePublish.o + +SRC = main.c mqttClient.c mqttHcan.c +SRC += ./MQTTPacket/src/MQTTConnectClient.c +SRC += ./MQTTPacket/src/MQTTSerializePublish.c +SRC += ./MQTTPacket/src/MQTTPacket.c +SRC += ./MQTTPacket/src/MQTTSubscribeClient.c +SRC += ./MQTTPacket/src/MQTTDeserializePublish.c CXX = clang CFLAGS = -I. -Wall -g -Os -CFLAGS += -DDEBUG -CFLAGS += -I ./MQTTPacket/src - -all: $(TARGET) - -$(TARGET): $(OBJ) - $(CXX) -o $@ $(OBJ) +#CFLAGS += -DDEBUG +#CFLAGS += -I ./MQTTPacket/src -$(OBJ): %.o:%.c - $(CXX) $(CFLAGS) -o $@ -c $< +all: + $(CXX) $(CFLAGS) -o $(TARGET) $(SRC) clean: - rm -f *.o $(TARGET) - cd ./MQTTPacket/src; rm -f *.o - -ctags: - ctags *.c *.h + rm -f $(TARGET) + test -d ./scanBuild || sudo rm -R ./scanBuild install: - strip ./$(TARGET) + strip $(TARGET) sudo install $(TARGET) /usr/sbin - -analyse: # clang Static Analyzer -> Report - # scan-build ./configure” (für autoconf-Projekte) - scan-build make run: - ./$(TARGET) -D + $(TARGET) -D diff --git a/hcan4mqttpc/README b/hcan4mqttpc/README deleted file mode 100644 index df51a69..0000000 --- a/hcan4mqttpc/README +++ /dev/null @@ -1,18 +0,0 @@ -socketCAN - MQTT-Paho-Client - -Installationsabhaendigkeiten: ------------------------------ -1. Der MQTTPaho-Client (Embedded MQTTPacket) benoetigt keine Shared lib. - -2. mosquitto MQTT-Broker (Datenvermittlungszentrale): -sudo apt-get install mosquitto --> mosquitto startet automatisch. Kontrolle: ps -A | grep mosq ------------------------------ - -Testmoeglichkeit z.B. per MQTTLens -1. subscribe a topic="cb>" -2. publish a topic="cb<", Msg=ON/2 - -... -tt@bananapi:~/openHCAN/hcan4mqttc$ ./hcan4mqttc -D -... \ No newline at end of file diff --git a/hcan4mqttpc/README.md b/hcan4mqttpc/README.md index d2a0db5..bf56c7b 100644 --- a/hcan4mqttpc/README.md +++ b/hcan4mqttpc/README.md @@ -1 +1,20 @@ socketCAN - MQTT-Paho-Client: HCAN-socketCAN <-> mqtt + + +Installationsabhaendigkeiten: +----------------------------- +1. Der MQTTPaho-Client (Embedded MQTTPacket) benoetigt keine Shared lib. + +2. mosquitto MQTT-Broker (Datenvermittlungszentrale): +sudo apt-get install mosquitto +-> mosquitto startet automatisch. Kontrolle: ps -A | grep mosq +----------------------------- + +Testmoeglichkeit z.B. per MQTTLens +1. subscribe a topic="cb>" +2. publish a topic="cb<", Msg=ON/2 + + +... +tt@bananapi:~/openHCAN/hcan4mqttc$ ./hcan4mqttc -D +... \ No newline at end of file diff --git a/hcanaddressd/Makefile b/hcanaddressd/Makefile index 8e4bb2c..d3e8803 100644 --- a/hcanaddressd/Makefile +++ b/hcanaddressd/Makefile @@ -1,23 +1,16 @@ TARGET = hcanaddressd -OBJ = main.o socket.o +SRC = main.c socket.c CXX = clang CFLAGS = -O2 -I. -Wall -g #-DDEBUG0 -all: $(TARGET) - -$(TARGET): $(OBJ) - $(CXX) $(LDFLAGS) -o $@ $(OBJ) - -$(OBJ): %.o:%.c - $(CXX) $(CFLAGS) -o $@ -c $< +all: + $(CXX) $(CFLAGS) -o $(TARGET) $(SRC) clean: - rm -f *.o $(TARGET) - -ctags: - ctags *.c *.h + rm -f $(TARGET) + test -d ./scanBuild || sudo rm -R ./scanBuild install: - strip ./$(TARGET) - sudo install ./$(TARGET) /usr/sbin + strip $(TARGET) + sudo install $(TARGET) /usr/sbin diff --git a/hcand/Makefile b/hcand/Makefile index 834b08d..5c45705 100644 --- a/hcand/Makefile +++ b/hcand/Makefile @@ -1,23 +1,16 @@ TARGET = hcand -OBJ = main.o socket.o -CFLAGS = -O2 -I. -Wall -g #-DDEBUG0 +SRC = main.c socket.c CXX = clang +CFLAGS = -O2 -I. -Wall -g #-DDEBUG0 -all: $(TARGET) - -$(TARGET): $(OBJ) - $(CXX) $(LDFLAGS) -o $@ $(OBJ) - -$(OBJ): %.o:%.c - $(CXX) $(CFLAGS) -o $@ -c $< +all: + $(CXX) $(CFLAGS) -o $(TARGET) $(SRC) clean: - rm -f *.o $(TARGET) - -ctags: - ctags *.c *.h + rm -f $(TARGET) + test -d ./scanBuild || sudo rm -R ./scanBuild install: - strip ./$(TARGET) - sudo install ./$(TARGET) /usr/sbin + strip $(TARGET) + sudo install $(TARGET) /usr/sbin diff --git a/hcand/main.c b/hcand/main.c index 0dd95fe..797e9e9 100644 --- a/hcand/main.c +++ b/hcand/main.c @@ -140,14 +140,13 @@ int main() while (1) { int i; - int nread; CANFrame f; size_t size; struct sockaddr_in peer; bzero(&peer,sizeof(peer)); size = sizeof(peer); - nread = recvfrom(sock_fd, &f, sizeof(f), 0, (struct sockaddr*)&peer, + recvfrom(sock_fd, &f, sizeof(f), 0, (struct sockaddr*)&peer, &size); // 1. Schauen, ob wir von diesem schon mal was bekommen haben diff --git a/hcansocketd/Makefile b/hcansocketd/Makefile index a05cdef..43ccc58 100644 --- a/hcansocketd/Makefile +++ b/hcansocketd/Makefile @@ -1,25 +1,16 @@ TARGET = hcansocketd -OBJ = main.o +SRC = main.c CXX = clang - CFLAGS = -O2 -I. -Wall -g #-DDEBUG0 - -all: $(CONDITIONAL_CLEAN) $(TARGET) - -$(TARGET): $(OBJ) - $(CXX) $(LDFLAGS) -o $@ $(OBJ) - -$(OBJ): %.o:%.c - $(CXX) $(CFLAGS) -o $@ -c $< - +all: + $(CXX) $(CFLAGS) -o $(TARGET) $(SRC) + clean: - rm -f *.o $(TARGET) - -ctags: - ctags *.c *.h + rm -f $(TARGET) + test -d ./scanBuild || sudo rm -R ./scanBuild install: - strip ./$(TARGET) + strip $(TARGET) sudo install $(TARGET) /usr/sbin diff --git a/liesmich.txt b/liesmich.txt index 2bc480c..561a298 100644 --- a/liesmich.txt +++ b/liesmich.txt @@ -1,41 +1,18 @@ -/* - * This file is part of the HCAN tools suite. - * - * HCAN is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * HCAN is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with HCAN; if not, write to the Free Software Foundation, Inc., 51 - * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * (c) 2006 by Martin Haller, mah (at) iuse (dot) org - * (c) 2010 by Martin Kramer and Ingo Lages, i (dot) lages (at) gmx (dot) de - */ - + + Zum Compilieren und Linken der Dienste und Firmwares reicht ein - - make - + + make + auf der Verzeichnisebene dieser liesmich.txt. - - - - + ______________________________________________________ + + In der Datei ARCH.inc ggf. zuvor die gewuenschte/verwendete Architektur einstellen. - - - - Getestet mit folgender Compiler-Versionen: - - clang-4.0 - - libclang1-4.0 - - libclang-common-4.0-dev - - llvm-4.0 - - avr-gcc-4.9.2 - + + ______________________________________________________ + Aktuell verwendete Compiler-Versionen (Ubuntu 17.04): + - clang 4.0 + - gcc 6.3.0 + - avr-gcc 4.9.2 + \ No newline at end of file