42 lines
1015 B
C#
42 lines
1015 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace DTS.DASLib.Command.SLICEDB
|
|
{
|
|
public class CommandPacket : SliceCommandPacketBase
|
|
{
|
|
public enum CommandType
|
|
{
|
|
Reserved = 0x00,
|
|
Diagnostics,
|
|
GPIO,
|
|
Information,
|
|
Network,
|
|
Power,
|
|
Arm,
|
|
};
|
|
|
|
private static UInt16 GlobalSequenceNumber = 0;
|
|
private static object GlobalSequenceNumberLock = new object();
|
|
|
|
public CommandPacket() { }
|
|
|
|
public override void GetNextSequenceNumber()
|
|
{
|
|
lock (GlobalSequenceNumberLock)
|
|
{
|
|
SequenceNumber = GlobalSequenceNumber;
|
|
GlobalSequenceNumber++;
|
|
}
|
|
}
|
|
|
|
public CommandPacket(byte[] Bytes) : base(Bytes) { }
|
|
|
|
public override object ConvertByteToCommandType(byte b)
|
|
{
|
|
return (CommandType)b;
|
|
}
|
|
}
|
|
}
|