87e3c22f85
Implement Type I CP48 (date and time)
2016-07-23 09:38:41 +00:00
094c9ef453
Fix year handling in mbus_data_tm_decode
...
According to ANSI C the member tm_year saves the years since
1900.
2016-07-23 09:38:14 +00:00
0e5b5b46a8
Fix regression with XML output.
...
Copy-paste error from 9edcc44
.
Spotted with `cd test && ./generate-xml.sh test-frames`
--- test-frames/manual_frame2.xml 2016-05-09 00:19:44.000000000 +0200
+++ test-frames/manual_frame2.xml.new 2016-05-09 01:09:09.000000000 +0200
@@ -17,7 +17,7 @@
<DataRecord id="1">
<Function>Actual value</Function>
<Unit>reserved but historic</Unit>
- <Value>135</Value>
+ <Value>1</Value>
</DataRecord>
</MBusData>
2016-05-09 01:11:23 +02:00
9edcc44eeb
Fix several format string issues
2016-04-01 19:20:00 +00:00
9906723447
Fix IEEE754 conversion
...
It seems that the endianness handling was broken in
ef6c4be655
("Safer IEEE754 conversion."). So drop it.
2016-04-01 18:19:32 +00:00
b6cbb1de1e
merge rscada/master with arska/feature-ignoretestbinaries
2016-03-25 23:20:34 +01:00
b9b131d064
Order device detection by manufacurer
...
merging ELS so that TMP-A is detected again
2016-02-08 14:06:24 +01:00
ed87f62a87
Add product strings for devices from ABB, Elster and Relay
...
This patch adds product identification for:
* ABB Delta-Meter
* Elster Falcon
* Relay PadPuls M1
* Relay PadPuls M4
* Relay Padin 4
* Relay AnDi 4
* Relay PadPuls M2
2016-02-06 12:04:13 +00:00
eaeb6e5502
retab and remove trailing whitespace
2016-02-05 14:42:16 +01:00
8b1c012a91
Add product strings of Janitza UMG 96S
2016-02-02 18:57:57 +00:00
db40010b93
Add product strings of Berg DCMi, BLMi and BMB-10S0
2016-01-31 18:09:21 +00:00
04eae740b4
Add product strings of Carlo Gavazzi EM21,EM24,EM33
2016-01-31 18:00:02 +00:00
0927f23ee7
Let mbus_str_xml_encode return a resultcode
2016-01-31 17:55:09 +00:00
ef6c4be655
Safer IEEE754 conversion.
...
The conversion given assumed two things:
1. the pointer was either 32-bit aligned or that unaligned word access
was safe. (Not the case on ARM)
We avoid this by using memcpy to copy to a buffer that *is*
32-bit-word-aligned.
2. the word was in native-endian format.
The original code appeared to assume the given word would be in
big-endian format (aka "network" byte order), so we convert it to the
host's native format before casting.
We re-instate the original implementation, controlled by a compiler
switch to allow easy rollback if problems are encountered.
2015-12-03 08:08:22 +10:00
583a397e8e
Needless math.h include
2015-12-03 07:52:23 +10:00
7e1be93dbd
Needless IEEE754 conversion, float pointer cast instead
2015-12-03 07:51:26 +10:00
5f0b5d5dd1
Beautify: replace tabs with spaces and remove trailing spaces
2014-02-24 15:20:42 +01:00
f47caf151e
add manufacturer id / product string of some meters:
...
Aquametro CALEC MB
Aquametro CALEC ST
Elster SensoStar 2
Elster F96 Plus
Elster F4
EMU Professional 3/75 M-Bus
Deltamess F2
Sensus PolluTherm
Sensus PolluStat E
NZR IC-M2
Saia-Burgess ALE3
Saia-Burgess AWD3
2014-02-24 11:22:40 +01:00
781736fe4c
add codepage to XML output
2014-02-24 11:02:26 +01:00
8197874fe7
bugfix, the functions
...
mbus_data_record_storage_number()
mbus_data_record_tariff()
mbus_data_record_device()
did return bogus random values, because of uninitialized variables
2014-02-20 11:26:31 +01:00
f262138572
mbus_manufacturer_id: add error checking code
...
Signed-off-by: Michael Heimpold <mhei@heimpold.de >
2014-01-18 20:43:57 +01:00
0fccc0e337
Add a function to calculate the manufacturer ID from the 3 byte ASCII
...
code. The formula can be found at http://www.m-bus.com/files/w4b21021.pdf ,
chapter 3.3 at page 6.
This obsoletes the static defines, so remove them.
Signed-off-by: Michael Heimpold <mhei@heimpold.de >
2014-01-18 13:44:01 +01:00
0d9f83ba88
Extend XML output with storage number, tariff and device
2013-11-07 00:32:01 +01:00
58778ba9bc
Add functions to decode storage number, tariff and device from DIF
2013-11-07 00:24:11 +01:00
d79cb1c998
Fix BCD decoding bug
2013-11-07 00:13:56 +01:00
e9d39d4708
Extend DIF debug output (storage number LSB)
...
Fix DIFE debug output (storage number, tariff, device unit)
Fix typos in comments
Replace magic bit masks with defines
2013-11-06 11:11:43 +01:00
4b82502c06
Add product name mapping for GMC-I EMMOD206
2013-10-31 23:01:06 +01:00
6afe7a10dc
fix wrong decoding of integer / type B (now handle signedness correctly)
...
separate result code und decoded value for integer decoding (new
parameter)
refactor variable names
2013-10-31 22:25:34 +01:00
7ca329ee40
Add product name mapping for Rossweiner Modularis
2013-10-18 17:32:22 +02:00
0cf57bfc35
Move event handling from global variable to handle
...
- remove global event function pointer
- add event function pointer to handle structure
- add handle parameter to register functions
- move all register functions to mbus-protocol-aux.c
2013-10-13 21:49:40 +02:00
55d4c0fba2
Remove trailing whitespace
...
Signed-off-by: Stefan Wahren <info@lategoodbye.de >
2013-09-13 17:53:33 +02:00
d9dd055bea
Fix mbus_vib_unit_lookup
...
remove unreachable code
add missing unit password
fix typo
Signed-off-by: Stefan Wahren <info@lategoodbye.de >
2013-08-03 16:35:09 +02:00
5b83cad8fb
only show timestamp in XML output if it is set (not all frames that goes into mbus_parse passes through timestamp), to avoid a lot of '<Timestamp>1970-01-01T00:00:00</Timestamp>'
2013-07-04 23:47:06 +09:00
1fee3d9a5a
bug fix: don't assume that frame->next is zeroed before mbus_parse is called
2013-07-04 23:30:27 +09:00
70f23567a8
fix potential segmentation fault
2013-07-03 20:36:43 +02:00
551176911f
fix memory leaks in error case
2013-07-03 20:34:30 +02:00
8dd1d4e4ae
bugfix for +1 error in VIFE parser
...
now VIFE and DIFE behave equal
2013-07-03 20:30:20 +02:00
88b2b9fafa
bugfix in VIFE parser
2013-07-03 22:50:03 +09:00
31f17ab4c2
use error_str instead of direct console output
2013-07-03 22:18:06 +09:00
dd56a08811
Improve data parsing
...
- add length defines for variable data header and fixed data
- add size check for fixed data
- avoid problems with memory alignment / padding in mbus structures
(improve portability)
- abort parsing if there are too many DIFE or VIFEs
- check for premature end of variable data
- check size of variable length VIF
2013-06-22 11:50:36 +02:00
c59e763a84
minor fixes
...
remove unreachable code
add parameter checks to mbus_data_bcd_encode
init time structure in mbus_data_tm_decode as possible
mark falltrough for splint
remove unused variable val
fix removed realloc
2013-05-04 22:43:23 +02:00
ee209023b8
fix memleaks
...
avoid memleak if memory is full
fix "memleak" at the end of mbus_parse_hex
2013-05-04 19:17:27 +02:00
3935b4013e
make parseable for splint
...
- replace non standard u_char with unsigned char (ANSI)
- advice splint to ignore variadic macros
- move declarations from the middle to top of functions (C90)
- replace local library includes <> to ""
2013-05-04 18:14:18 +02:00
0d6bb583c2
add missing initialization (thanks to valgrind)
2013-05-03 17:23:18 +02:00
5500db0898
add missing checks after memory allocation
...
add missing memset after memory allocation
2013-04-11 22:05:08 +02:00
6166553755
Make my last change more readable.
...
As suggested by lategoodbye. Also make it more in line with the way
everything else is written.
2013-03-17 09:19:29 +01:00
363f59a149
Ignore filler DIF (= 0x2F)
2013-03-11 09:27:16 +01:00
b1063db3bc
replace magic numbers with defines
...
fix MBUS_MAX_PRIMARY_SLAVES to 250
2013-03-02 18:03:31 +01:00
61fd2aa1c7
add new helper functions to check primary and secondary addresses
2012-12-31 13:37:17 +01:00
2335deb742
Fix segmentation fault
...
- check if L Field is at least 3 to avoid crash (MBDOC48.PDF, page 23)
2012-12-22 00:08:59 +01:00