2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

Fix for EMGZ address above 9

git-svn-id: https://svn.fhem.de/fhem/trunk@548 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2010-01-15 16:35:21 +00:00
parent ec118e2204
commit aad677d2b8

View File

@ -35,7 +35,7 @@ CUL_EM_Define($$)
"[corr1 corr2 CostPerUnit BasicFeePerMonth]" "[corr1 corr2 CostPerUnit BasicFeePerMonth]"
if(int(@a) < 3 || int(@a) > 7); if(int(@a) < 3 || int(@a) > 7);
return "Define $a[0]: wrong CODE format: valid is 1-12" return "Define $a[0]: wrong CODE format: valid is 1-12"
if($a[2] !~ m/^\d$/ || $a[2] < 1 || $a[2] > 12); if($a[2] !~ m/^\d+$/ || $a[2] < 1 || $a[2] > 12);
$hash->{CODE} = $a[2]; $hash->{CODE} = $a[2];
@ -86,7 +86,7 @@ CUL_EM_Parse($$)
# E01012471B80100B80B -> Type 01, Code 01, Cnt 10 # E01012471B80100B80B -> Type 01, Code 01, Cnt 10
my @a = split("", $msg); my @a = split("", $msg);
my $tpe = ($a[1].$a[2])+0; my $tpe = ($a[1].$a[2])+0;
my $cde = ($a[3].$a[4])+0; my $cde = hex($a[3].$a[4]);
# seqno = number of received datagram in sequence, runs from 2 to 255 # seqno = number of received datagram in sequence, runs from 2 to 255
# total_cnt= total (cumulated) value in ticks as read from the device # total_cnt= total (cumulated) value in ticks as read from the device