init
This commit is contained in:
41
DataPRO/SLICEDBCommands/CommandPacket.cs
Normal file
41
DataPRO/SLICEDBCommands/CommandPacket.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user