|
@@ -136,11 +136,11 @@ int parse_cmd_param_from_file(TCHAR *file_name, std::vector<CommandParam> &vtCom
|
|
|
std::string value;
|
|
|
parse_key(value, option, _T("Option"));
|
|
|
if ( !_tcsicmp(value.c_str(), _T("None")) )
|
|
|
- cp.nOption = 0;
|
|
|
+ cp.nOption = CMDOPT_None;
|
|
|
else if (!_tcsicmp(value.c_str(), _T("Get")))
|
|
|
- cp.nOption = 1;
|
|
|
+ cp.nOption = CMDOPT_Get;
|
|
|
else if (!_tcsicmp(value.c_str(), _T("Set")))
|
|
|
- cp.nOption = 2;
|
|
|
+ cp.nOption = CMDOPT_Set;
|
|
|
|
|
|
parse_key(value, multicode, _T("MultiParams"));
|
|
|
cp.bMulticode = !_tcsicmp(value.c_str(), _T("true")) ? true : false;
|
|
@@ -340,4 +340,26 @@ std::string PackingCommand(CommandParam &cmdPara, std::string data, const int &d
|
|
|
command.append((char *)szcrc, 2);
|
|
|
|
|
|
return command;
|
|
|
+}
|
|
|
+
|
|
|
+void ParseResultString(CommandParam& cmdPara, std::string data, const int& dataLen)
|
|
|
+{
|
|
|
+ if ( data.size() < 5) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ byte rtnCode = 0xAB;
|
|
|
+ std::string head = cmdPara.head.substr(0, 2);
|
|
|
+ if ( !_tcsicmp(_T("AA"), head.c_str()) ) { // 调试用命令代码引导码;
|
|
|
+ rtnCode = 0xAB;
|
|
|
+ }
|
|
|
+ else if (!_tcsicmp(_T("AC"), head.c_str())) {// 软件配屏参数调整命令代码引导码;
|
|
|
+ rtnCode = 0xAD;
|
|
|
+ }
|
|
|
+ else if (!_tcsicmp(_T("AE"), head.c_str())) {// 保留命令发送类型引导码;
|
|
|
+ rtnCode = 0xAF;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nTakenLen = 0; // 已取出的长度;
|
|
|
+ unsigned short usCRCValue; // CRC验证值;
|
|
|
}
|