Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Pelco/D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public byte[] RemoteReset(uint deviceAddress)

public byte[] Zone(uint deviceAddress, byte zone, Action action)
{
if ((zone < 0x01) & (zone > 0x08))
if ((zone < 0x01) || (zone > 0x08))
throw new Exception("Zone should be between 0x01 and 0x08");
var mAction = action == Action.Start ? (byte) 0x11 : (byte) 0x13;

Expand Down Expand Up @@ -169,7 +169,7 @@ public struct Message

public static byte[] GetMessage(uint address, byte command1, byte command2, byte data1, byte data2)
{
if ((address < 1) & (address > 256))
if ((address < 1) || (address > 256))
throw new Exception("Pelco D protocol supports 256 devices only");

Address = byte.Parse(address.ToString(CultureInfo.InvariantCulture));
Expand Down
2 changes: 1 addition & 1 deletion Pelco/P.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public byte[] RemoteReset(uint deviceAddress)

public byte[] Zone(uint deviceAddress, byte zone, Action action)
{
if ((zone < 0x01) & (zone > 0x08))
if ((zone < 0x01) || (zone > 0x08))
throw new Exception("Zone value should be between 0x01 and 0x08 include");
byte mAction;
if (action == Action.Start)
Expand Down