mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
calculate register size from endpoint sizes
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@5421 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
8f938dda99
commit
7b10244f29
@ -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…
x
Reference in New Issue
Block a user