-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCommand.cs
More file actions
53 lines (48 loc) · 1.38 KB
/
Command.cs
File metadata and controls
53 lines (48 loc) · 1.38 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
namespace ThreeByte.LinkLib.ProjectorLink.Commands
{
public abstract class Command
{
protected CommandResponse _cmdResponse;
internal virtual string GetCommandString()
{
//NOOP
return "";
}
internal virtual bool ProcessAnswerString(string a)
{
if (a.IndexOf("=ERR1") >= 0)
{
_cmdResponse = CommandResponse.UNDEFINED_CMD;
}
else if (a.IndexOf("=ERR2") >= 0)
{
_cmdResponse = CommandResponse.UNDEFINED_CMD;
}
else if (a.IndexOf("=ERR3") >= 0)
{
_cmdResponse = CommandResponse.UNAVAILABLE_TIME;
}
else if (a.IndexOf("=ERR4") >= 0)
{
_cmdResponse = CommandResponse.PROJECTOR_FAILURE;
}
else if (a.IndexOf(" ERRA") >= 0)
{
_cmdResponse = CommandResponse.AUTH_FAILURE;
}
else //OK or query answer...
{
_cmdResponse = CommandResponse.SUCCESS;
}
return _cmdResponse == CommandResponse.SUCCESS;
}
public CommandResponse CmdResponse
{
get { return _cmdResponse; }
}
public virtual string DumpToString()
{
return "";
}
}
}