PathDataRtnPkg.cs
1.5 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
53
54
55
56
57
58
59
60
61
62
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mushiny.Model
{
/// <summary>
/// 路径应答包:主要用于路径包的应答
/// AGV->RCS
/// </summary>
internal class PathDataRtnPkg : PkgData
{
public PathDataRtnPkg() : base()
{
}
public bool IsOK()
{
if (CmdWord == 0xa0)
return false;
else if (CmdWord == 0xa1)
return true;
return false;
}
/// <summary>
/// 保留
/// </summary>
public byte Reserved { get; set; }
/// <summary>
/// 路径的时间戳
/// </summary>
public uint PathTimeStamp { get; set; }
public override bool Parse(byte[] bytes)
{
bool result = false;
try
{
if (base.Parse(bytes))
{
if (bytes.Length < 19)
{
return false;
}
Reserved = Common.GetSubBytes(bytes, 12, 1)[0];
PathTimeStamp = Common.ConvertToUInt(Common.GetSubBytes(bytes, 13, 4));
result = true;
}
else
{
result = false;
}
}
catch (Exception ex)
{
throw ex;
}
return result;
}
}
}