From bb79aa94628257850ef9cc208c4a78af5ff6a4b1 Mon Sep 17 00:00:00 2001 From: john30 Date: Mon, 20 Oct 2014 21:46:53 +0200 Subject: [PATCH] adjusted to libebus udpates, start using SymbolString --- src/baseloop.cpp | 6 +++--- src/ebusloop.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 src/baseloop.cpp mode change 100644 => 100755 src/ebusloop.cpp diff --git a/src/baseloop.cpp b/src/baseloop.cpp old mode 100644 new mode 100755 index 26c13a02..8ec416c2 --- a/src/baseloop.cpp +++ b/src/baseloop.cpp @@ -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; diff --git a/src/ebusloop.cpp b/src/ebusloop.cpp old mode 100644 new mode 100755 index df14d78b..0c8ac33b --- a/src/ebusloop.cpp +++ b/src/ebusloop.cpp @@ -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;