kopia lustrzana https://github.com/weetmuts/wmbusmeters
Experiment with generating deb package.
rodzic
ab5567d2e9
commit
accdb1c0e9
34
Makefile
34
Makefile
|
@ -1,3 +1,17 @@
|
||||||
|
# Copyright (C) 2017-2019 Fredrik Öhrström
|
||||||
|
#
|
||||||
|
# This program 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 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# To compile for Raspberry PI ARM:
|
# To compile for Raspberry PI ARM:
|
||||||
# make HOST=arm
|
# make HOST=arm
|
||||||
|
@ -10,10 +24,12 @@ ifeq "$(HOST)" "arm"
|
||||||
CXX=arm-linux-gnueabihf-g++
|
CXX=arm-linux-gnueabihf-g++
|
||||||
STRIP=arm-linux-gnueabihf-strip
|
STRIP=arm-linux-gnueabihf-strip
|
||||||
BUILD=build_arm
|
BUILD=build_arm
|
||||||
|
DEBARCH=armhf
|
||||||
else
|
else
|
||||||
CXX=g++
|
CXX=g++
|
||||||
STRIP=strip
|
STRIP=strip
|
||||||
BUILD=build
|
BUILD=build
|
||||||
|
DEBARCH=amd64
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(DEBUG)" "true"
|
ifeq "$(DEBUG)" "true"
|
||||||
|
@ -54,7 +70,23 @@ METERS_OBJS:=\
|
||||||
$(BUILD)/wmbus_utils.o
|
$(BUILD)/wmbus_utils.o
|
||||||
|
|
||||||
all: $(BUILD)/wmbusmeters $(BUILD)/testinternals
|
all: $(BUILD)/wmbusmeters $(BUILD)/testinternals
|
||||||
$(STRIP_BINARY)
|
@$(STRIP_BINARY)
|
||||||
|
|
||||||
|
dist: wmbusmeters_0.8_$(DEBARCH).deb
|
||||||
|
|
||||||
|
wmbusmeters_0.8_$(DEBARCH).deb:
|
||||||
|
@mkdir -p $(BUILD)/debian/wmbusmeters/DEBIAN
|
||||||
|
@mkdir -p $(BUILD)/debian/wmbusmeters/usr/local/bin
|
||||||
|
@cp $(BUILD)/wmbusmeters $(BUILD)/debian/wmbusmeters/usr/local/bin
|
||||||
|
@rm -f $(BUILD)/debian/wmbusmeters/DEBIAN/control
|
||||||
|
@echo "Package: wmbusmeters" >> $(BUILD)/debian/wmbusmeters/DEBIAN/control
|
||||||
|
@echo "Version: 0.8" >> $(BUILD)/debian/wmbusmeters/DEBIAN/control
|
||||||
|
@echo "Maintainer: Fredrik Öhrström" >> $(BUILD)/debian/wmbusmeters/DEBIAN/control
|
||||||
|
@echo "Architecture: $(DEBARCH)" >> $(BUILD)/debian/wmbusmeters/DEBIAN/control
|
||||||
|
@echo "Description: A tool to read wireless mbus telegrams from utility meters." >> $(BUILD)/debian/wmbusmeters/DEBIAN/control
|
||||||
|
@(cd $(BUILD)/debian; dpkg-deb --build wmbusmeters .)
|
||||||
|
@mv $(BUILD)/debian/wmbusmeters_0.8_$(DEBARCH).deb .
|
||||||
|
@echo Built package $@
|
||||||
|
|
||||||
$(BUILD)/wmbusmeters: $(METERS_OBJS) $(BUILD)/main.o
|
$(BUILD)/wmbusmeters: $(METERS_OBJS) $(BUILD)/main.o
|
||||||
$(CXX) -o $(BUILD)/wmbusmeters $(METERS_OBJS) $(BUILD)/main.o $(DEBUG_LDFLAGS) -lpthread
|
$(CXX) -o $(BUILD)/wmbusmeters $(METERS_OBJS) $(BUILD)/main.o $(DEBUG_LDFLAGS) -lpthread
|
||||||
|
|
|
@ -127,6 +127,11 @@ Binary generated: `./build_debug/wmbusmeters`
|
||||||
|
|
||||||
Binary generated: `./build_arm_debug/wmbusmeters`
|
Binary generated: `./build_arm_debug/wmbusmeters`
|
||||||
|
|
||||||
|
`make HOST=arm dist`
|
||||||
|
|
||||||
|
(Work in progress...)
|
||||||
|
Binary generated: `./wmbusmeters_0.8_armhf.deb`
|
||||||
|
|
||||||
# System configuration
|
# System configuration
|
||||||
|
|
||||||
Add yourself to the dialout group to get access to the newly plugged in im871A USB stick.
|
Add yourself to the dialout group to get access to the newly plugged in im871A USB stick.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2017-2018 Fredrik Öhrström
|
Copyright (C) 2017-2019 Fredrik Öhrström
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -245,8 +245,10 @@ void MeterMultical21::processContent(Telegram *t)
|
||||||
|
|
||||||
if (frame_type == 0x79)
|
if (frame_type == 0x79)
|
||||||
{
|
{
|
||||||
|
// This is a "compact frame" in wmbus lingo.
|
||||||
|
// (Other such frame_types are Ci=0x69, 0x6a, 0x6b and Ci=0x79, 0x7b, compact frames and format frames)
|
||||||
// 0,1 = crc for format signature = hash over DRH (Data Record Header)
|
// 0,1 = crc for format signature = hash over DRH (Data Record Header)
|
||||||
// The DRH is the dif(dife)vif(vife) bytes for all the records...
|
// The DRH is the dif(difes)vif(vifes) bytes for all the records...
|
||||||
// This hash should be used to pick up a suitable format string.
|
// This hash should be used to pick up a suitable format string.
|
||||||
// Below, DRH is hardcoded to 02FF2004134413
|
// Below, DRH is hardcoded to 02FF2004134413
|
||||||
uchar ecrc0 = t->content[3];
|
uchar ecrc0 = t->content[3];
|
||||||
|
|
Ładowanie…
Reference in New Issue