init
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace DTS.DASLib.Command.SLICE
|
||||
{
|
||||
public class CommandPacket : SliceCommandPacketBase
|
||||
{
|
||||
public enum CommandType
|
||||
{
|
||||
Reserved = 0,
|
||||
Arm = 1,
|
||||
Attribute = 2,
|
||||
Diagnostics = 3,
|
||||
EventData = 4,
|
||||
FirmwareUpdate = 5,
|
||||
Information = 6,
|
||||
QAandUtility = 7,
|
||||
Realtime = 8,
|
||||
Bulk = 9,
|
||||
StackFirmwareUpdate = 10,
|
||||
Ptp1588 = 11,
|
||||
Multicast = 12,
|
||||
};
|
||||
|
||||
private static UInt16 GlobalSequenceNumber = 0;
|
||||
private static object GlobalSequenceNumberLock = new object();
|
||||
|
||||
public CommandPacket() : base() { }
|
||||
|
||||
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