2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

calculate register size from endpoint sizes

git-svn-id: https://svn.fhem.de/fhem/trunk@5421 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-04-03 14:52:27 +00:00
parent 248799f999
commit 43660b1925

View File

@ -487,7 +487,16 @@ SWAP_Set($@)
return "value has to be ". $len ." byte(s) in size" if( $len*2 != length( $arg2 ) );
}
} else {
my $len = $register->{endpoints}->[0]->{size};
my $len = 0;
foreach my $endpoint ( @{$register->{endpoints}} ) {
if( !defined($endpoint->{position}) ) {
$len = $endpoint->{size};
last;
}
$len += $endpoint->{size};
}
return "value has to be ". $len ." byte(s) in size" if( $len*2 != length( $arg2 ) );
}
}