Permalink
Browse files

Aufraeumarbeiten im Zuge der Einfuehrung von statischer Codeanalyse.

  • Loading branch information...
ingo ingo
ingo authored and ingo committed Nov 11, 2017
1 parent ec581fb commit 498206e38e717683b7bd0fb6419df14e6ed86bc0
Showing with 111 additions and 167 deletions.
  1. +38 −37 Makefile
  2. +1 −1 check_hcan/README.md
  3. +15 −26 hcan4mqttpc/Makefile
  4. +0 −18 hcan4mqttpc/README
  5. +19 −0 hcan4mqttpc/README.md
  6. +7 −14 hcanaddressd/Makefile
  7. +8 −15 hcand/Makefile
  8. +1 −2 hcand/main.c
  9. +7 −16 hcansocketd/Makefile
  10. +15 −38 liesmich.txt
View
@@ -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
View
@@ -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)
View
@@ -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
View

This file was deleted.

Oops, something went wrong.
View
@@ -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
...
View
@@ -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
View
@@ -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
View
@@ -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
View
@@ -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
View
@@ -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

0 comments on commit 498206e

Please sign in to comment.