|
@@ -494,11 +494,11 @@ void TCLCommand::PackingCommand(CommandParam& cmdPara, std::string data, const i
|
|
utils::_dprintf(_T("指令:%s = %s"), cmdPara.name.c_str(), utils::BytesToHexString((byte*)command.c_str(), command.size(), ' ').c_str());
|
|
utils::_dprintf(_T("指令:%s = %s"), cmdPara.name.c_str(), utils::BytesToHexString((byte*)command.c_str(), command.size(), ' ').c_str());
|
|
}
|
|
}
|
|
|
|
|
|
-void TCLCommand::ParseResultString(CommandParam& cmdPara, std::string data, const int& dataLen)
|
|
|
|
|
|
+bool TCLCommand::ParseResultString(CommandParam& cmdPara, std::string data, const int& dataLen)
|
|
{
|
|
{
|
|
// Tag:[返回头][全数据长度][返回码]<返回码子项><附加数据>[crc16]
|
|
// Tag:[返回头][全数据长度][返回码]<返回码子项><附加数据>[crc16]
|
|
if (!TheFirstPart(cmdPara, data.substr(0, 5)))
|
|
if (!TheFirstPart(cmdPara, data.substr(0, 5)))
|
|
- return;
|
|
|
|
|
|
+ return false;
|
|
|
|
|
|
if (cmdPara._rtnStatus != 0x0A) {
|
|
if (cmdPara._rtnStatus != 0x0A) {
|
|
#if _MSC_VER >= 1200 && _MSC_VER < 1500
|
|
#if _MSC_VER >= 1200 && _MSC_VER < 1500
|
|
@@ -506,7 +506,7 @@ void TCLCommand::ParseResultString(CommandParam& cmdPara, std::string data, cons
|
|
#elif _MSC_VER >= 1500
|
|
#elif _MSC_VER >= 1500
|
|
utils::_dprintf("[%s] 执行结果错误:%02X", __FUNCTION__, cmdPara._rtnStatus);
|
|
utils::_dprintf("[%s] 执行结果错误:%02X", __FUNCTION__, cmdPara._rtnStatus);
|
|
#endif
|
|
#endif
|
|
- return;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
switch (cmdPara.nOption)
|
|
switch (cmdPara.nOption)
|
|
@@ -515,11 +515,13 @@ void TCLCommand::ParseResultString(CommandParam& cmdPara, std::string data, cons
|
|
break;
|
|
break;
|
|
case CMDOPT_Get:
|
|
case CMDOPT_Get:
|
|
case CMDOPT_Set:
|
|
case CMDOPT_Set:
|
|
- TheSecondPart(cmdPara, data.substr(5));
|
|
|
|
|
|
+ return TheSecondPart(cmdPara, data.substr(5));
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
bool TCLCommand::SendCommand(CommandParam& cmdPara)
|
|
bool TCLCommand::SendCommand(CommandParam& cmdPara)
|