adjusted to libebus udpates, start using SymbolString

This commit is contained in:
john30
2014-10-20 21:46:53 +02:00
parent b40d9bd236
commit bb79aa9462
2 changed files with 10 additions and 10 deletions
Regular → Executable
+3 -3
View File
@@ -159,7 +159,7 @@ std::string BaseLoop::decodeMessage(const std::string& data)
if (!busCommand->isErrorResult()) {
// decode data
Command* command = new Command(index, (*m_commands)[index], busCommand->getResult());
Command* command = new Command(index, (*m_commands)[index], busCommand->getResultStr()); // TODO use getResult()
// return result
result << command->calcResult(cmd);
@@ -214,7 +214,7 @@ std::string BaseLoop::decodeMessage(const std::string& data)
// decode result
if (busCommand->getType()==broadcast)
result << "done";
else if (busCommand->getResult().substr(busCommand->getResult().length()-8) == "00000000")
else if (busCommand->getResultStr().substr(busCommand->getResultStr().length()-8) == "00000000") // TODO use getResult()
result << "done";
else
result << "error";
@@ -286,7 +286,7 @@ std::string BaseLoop::decodeMessage(const std::string& data)
L.log(bas, error, " %s", busCommand->getResultCodeCStr());
result << busCommand->getResultCodeCStr();
} else {
result << busCommand->getResult();
result << busCommand->getResultStr(); // TODO use getResult()
}
delete busCommand;
Regular → Executable
+7 -7
View File
@@ -80,15 +80,15 @@ void* EBusLoop::run()
// new cyc message arrived
if (busResult == RESULT_SYN || busResult == RESULT_BUS_LOCKED) {
std::string data = m_bus->getCycData();
SymbolString data = m_bus->getCycData();
if (data.size() == 0 && m_logAutoSyn == true)
L.log(bus, trace, "%s", "aa");
L.log(bus, trace, "aa");
if (data.size() != 0) {
L.log(bus, trace, "%s", data.c_str());
L.log(bus, trace, "%s", data.getDataStr().c_str());
int index = m_commands->storeCycData(data);
int index = m_commands->storeCycData(data.getDataStr());
if (index == -1) {
L.log(bus, debug, " command not found");
@@ -116,7 +116,7 @@ void* EBusLoop::run()
if (busResult == RESULT_SYN && busCommandActive == false && m_sendBuffer.size() != 0) {
BusCommand* busCommand = m_sendBuffer.remove();
L.log(bus, debug, " type: %s msg: %s",
busCommand->getTypeCStr(), busCommand->getCommand().c_str());
busCommand->getTypeCStr(), busCommand->getCommandStr().c_str());
m_bus->addCommand(busCommand);
L.log(bus, debug, " addCommand success");
busCommandActive = true;
@@ -168,7 +168,7 @@ void* EBusLoop::run()
lookbusretries = 0;
m_bus->sendCommand();
BusCommand* busCommand = m_bus->recvCommand();
L.log(bus, trace, " %s", busCommand->getResult().c_str());
L.log(bus, trace, " %s", busCommand->getResultStr().c_str());
if (busCommand->isErrorResult() && retries < m_retries) {
retries++;
@@ -180,7 +180,7 @@ void* EBusLoop::run()
if (pollCommandActive == true) {
// only save correct results
if (!busCommand->isErrorResult())
m_commands->storePolData(busCommand->getResult().c_str());
m_commands->storePolData(busCommand->getResultStr().c_str()); // TODO use getResult()
delete busCommand;
pollCommandActive = false;