mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-26 16:28:31 -04:00
Merge pull request #1249 from knnniggett/pelcop
Fix PelcoP checksum calculation
This commit is contained in:
commit
52e16dbdd0
1 file changed
+3
-1
@@ -133,8 +133,10 @@ sub sendCmd
|
||||
|
||||
my $result = undef;
|
||||
|
||||
# Pelco P protocol checksum is created by XOR'ing the first seven bytes in the message
|
||||
# including the first byte, the STX sync packet
|
||||
my $checksum = 0x00;
|
||||
for ( my $i = 1; $i < int(@$cmd); $i++ )
|
||||
for ( my $i = 0; $i < int(@$cmd); $i++ )
|
||||
{
|
||||
$checksum ^= $cmd->[$i];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user