Files
ClientServerProject/CommonLibrary/ProtocolSupport/CustomerCode.cs

152 lines
7.9 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HslCommunication;
namespace CommonLibrary
{
/*********************************************************************************************
*
*
*
* NetHandle
* intint数据无缝的转化
* 4int数据拆分成了三个属性ushort和两个byte访
*
* 2
* [byte1][byte2] [byte3] [byte4]
* CodeIdentifier CodeMinor CodeMajor
*
*********************************************************************************************/
/// <summary>
/// 用于网络通信的二级协议头说明
/// </summary>
public class CommonHeadCode
{
/// <summary>
/// 同步通信的指令头说明从1.1.x到1.255.x
/// </summary>
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Auto)]
public class SimplifyHeadCode
{
/*******************************************************************************************
*
* 1.1.*
*
*******************************************************************************************/
2017-10-02 11:04:37 +08:00
#region 1.1.X
public static NetHandle { get; } = new NetHandle(1, 1, 00001);
public static NetHandle { get; } = new NetHandle(1, 1, 00002);
public static NetHandle { get; } = new NetHandle(1, 1, 00003);
public static NetHandle { get; } = new NetHandle(1, 1, 00004);
public static NetHandle { get; } = new NetHandle(1, 1, 00005);
public static NetHandle { get; } = new NetHandle(1, 1, 00006);
public static NetHandle { get; } = new NetHandle(1, 1, 00007);
public static NetHandle { get; } = new NetHandle(1, 1, 00008);
public static NetHandle { get; } = new NetHandle(1, 1, 00009);
public static NetHandle { get; } = new NetHandle(1, 1, 00010);
public static NetHandle { get; } = new NetHandle(1, 1, 00011);
public static NetHandle { get; } = new NetHandle(1, 1, 00012);
public static NetHandle { get; } = new NetHandle(1, 1, 00013);
public static NetHandle { get; } = new NetHandle(1, 1, 00014);
public static NetHandle { get; } = new NetHandle(1, 1, 00015);
public static NetHandle MD5 { get; } = new NetHandle(1, 1, 00016);
public static NetHandle { get; } = new NetHandle(1, 1, 00017);
public static NetHandle { get; } = new NetHandle(1, 1, 00018);
public static NetHandle { get; } = new NetHandle(1, 1, 00019);
public static NetHandle { get; } = new NetHandle(1, 1, 00020);
public static NetHandle { get; } = new NetHandle(1, 1, 00021);
public static NetHandle { get; } = new NetHandle(1, 1, 00022);
2017-10-02 11:04:37 +08:00
#endregion
/*******************************************************************************************
*
* 1.2.*
*
*******************************************************************************************/
2017-10-02 11:04:37 +08:00
#region 1.2.X
public static NetHandle { get; } = new NetHandle(1, 2, 00001);//1.2.开头的是日志请求和清空
public static NetHandle { get; } = new NetHandle(1, 2, 00002);
public static NetHandle { get; } = new NetHandle(1, 2, 00003);
public static NetHandle { get; } = new NetHandle(1, 2, 00004);
public static NetHandle { get; } = new NetHandle(1, 2, 00005);
public static NetHandle { get; } = new NetHandle(1, 2, 00006);
public static NetHandle { get; } = new NetHandle(1, 2, 00007);
public static NetHandle { get; } = new NetHandle(1, 2, 00008);
public static NetHandle { get; } = new NetHandle(1, 2, 00009);
public static NetHandle { get; } = new NetHandle(1, 2, 00010);
public static NetHandle { get; } = new NetHandle(1, 2, 00011);
public static NetHandle { get; } = new NetHandle(1, 2, 00012);
public static NetHandle UDP日志查看 { get; } = new NetHandle(1, 2, 00013);
public static NetHandle UDP日志清空 { get; } = new NetHandle(1, 2, 00014);
public static NetHandle { get; } = new NetHandle(1, 2, 00015);
public static NetHandle { get; } = new NetHandle(1, 2, 00016);
public static NetHandle { get; } = new NetHandle(1, 2, 00017);
public static NetHandle { get; } = new NetHandle(1, 2, 00018);
2017-10-02 11:04:37 +08:00
#endregion
/**************************************************************************************
*
* 1.3.x及之后开头
*
**************************************************************************************/
}
/// <summary>
/// 异步通信的头说明从2.1.x到2.255.x
/// </summary>
public class MultiNetHeadCode
{
/*******************************************************************************************
*
* 2.1.*
*
*******************************************************************************************/
public static NetHandle 线 { get; } = new NetHandle(2, 1, 00001);
public static NetHandle { get; } = new NetHandle(2, 1, 00002);
public static NetHandle { get; } = new NetHandle(2, 1, 00003);
public static NetHandle { get; } = new NetHandle(2, 1, 00004);
public static NetHandle { get; } = new NetHandle(2, 1, 00005);
public static NetHandle { get; } = new NetHandle(2, 1, 00006);
public static NetHandle { get; } = new NetHandle(2, 1, 00007);
/**************************************************************************************
*
* 2.2.x 2.3.x开头
*
**************************************************************************************/
}
//可以在下面进行扩展,需要保证长度都是统一的,新建您自己的类型 可以用3.1.x 4.1.x开头的指令
}
}