ReadParamRtnPkg.cs
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mushiny.Model
{
/// <summary>
/// 参数回读数据包:RCS后台发下配置回读请求后立即发送一次
/// </summary>
internal class ReadParamRtnPkg:PkgData
{
public ReadParamRtnPkg() :base()
{
}
public byte[] MatchWord { get; set; }
public byte[] ParamGroup { get; set; }
public byte[] Data { get; set; }
public override bool Parse(byte[] bytes)
{
bool result = false;
try
{
if (base.Parse(bytes))
{
if (bytes.Length < 15)
{
return false;
}
MatchWord = Common.GetSubBytes(bytes, 12, 2);
ParamGroup = Common.GetSubBytes(bytes, 14, 1);
if(bytes.Length >17)
{
Data = Common.GetSubBytes(bytes, 15, bytes.Length - 15 - 2);
}
result = true;
}
else
{
result = false;
}
result = true;
}
catch (Exception ex)
{
throw ex;
}
return result;
}
}
}