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:
parent
248799f999
commit
43660b1925
@ -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 ) );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user