class WQueue: method 'T remove(const long delay)' added.
This commit is contained in:
+41
-24
@@ -96,22 +96,27 @@ std::string BaseLoop::decodeMessage(const std::string& data)
|
||||
m_ebusloop->addBusCommand(new BusCommand(type, ebusCommand));
|
||||
BusCommand* busCommand = m_ebusloop->getBusCommand();
|
||||
|
||||
if (busCommand->getResult().c_str()[0] != '-') {
|
||||
// decode data
|
||||
Command* command = new Command(index, (*m_commands)[index], busCommand->getResult());
|
||||
if (busCommand != NULL) {
|
||||
if (busCommand->getResult().c_str()[0] != '-') {
|
||||
// decode data
|
||||
Command* command = new Command(index, (*m_commands)[index], busCommand->getResult());
|
||||
|
||||
// return result
|
||||
result << command->calcResult(cmd);
|
||||
// return result
|
||||
result << command->calcResult(cmd);
|
||||
|
||||
delete command;
|
||||
delete command;
|
||||
} else {
|
||||
L.log(bas, error, " %s", busCommand->getResult().c_str());
|
||||
result << busCommand->getResult();
|
||||
}
|
||||
|
||||
|
||||
delete busCommand;
|
||||
} else {
|
||||
L.log(bas, error, " %s", busCommand->getResult().c_str());
|
||||
result << busCommand->getResult();
|
||||
L.log(bas, error, " busCommand timeout reached");
|
||||
result << "busCommand timeout reached";
|
||||
}
|
||||
|
||||
|
||||
delete busCommand;
|
||||
|
||||
} else {
|
||||
result << "ebus command not found";
|
||||
}
|
||||
@@ -150,19 +155,25 @@ std::string BaseLoop::decodeMessage(const std::string& data)
|
||||
m_ebusloop->addBusCommand(new BusCommand(type, ebusCommand));
|
||||
BusCommand* busCommand = m_ebusloop->getBusCommand();
|
||||
|
||||
if (busCommand->getResult().c_str()[0] != '-') {
|
||||
// decode result
|
||||
if (busCommand->getResult().substr(busCommand->getResult().length()-8) == "00000000")
|
||||
result << "done";
|
||||
else
|
||||
result << "error";
|
||||
if (busCommand != NULL) {
|
||||
if (busCommand->getResult().c_str()[0] != '-') {
|
||||
// decode result
|
||||
if (busCommand->getResult().substr(busCommand->getResult().length()-8) == "00000000")
|
||||
result << "done";
|
||||
else
|
||||
result << "error";
|
||||
|
||||
} else {
|
||||
L.log(bas, error, " %s", busCommand->getResult().c_str());
|
||||
result << busCommand->getResult();
|
||||
}
|
||||
|
||||
delete busCommand;
|
||||
} else {
|
||||
L.log(bas, error, " %s", busCommand->getResult().c_str());
|
||||
result << busCommand->getResult();
|
||||
L.log(bas, error, " busCommand timeout reached");
|
||||
result << "busCommand timeout reached";
|
||||
}
|
||||
|
||||
delete busCommand;
|
||||
delete command;
|
||||
|
||||
} else {
|
||||
@@ -220,12 +231,18 @@ std::string BaseLoop::decodeMessage(const std::string& data)
|
||||
m_ebusloop->addBusCommand(new BusCommand(type, ebusCommand));
|
||||
BusCommand* busCommand = m_ebusloop->getBusCommand();
|
||||
|
||||
if (busCommand->getResult().c_str()[0] == '-')
|
||||
L.log(bas, error, " %s", busCommand->getResult().c_str());
|
||||
if (busCommand != NULL) {
|
||||
if (busCommand->getResult().c_str()[0] == '-')
|
||||
L.log(bas, error, " %s", busCommand->getResult().c_str());
|
||||
|
||||
result << busCommand->getResult();
|
||||
result << busCommand->getResult();
|
||||
|
||||
delete busCommand;
|
||||
} else {
|
||||
L.log(bas, error, " busCommand timeout reached");
|
||||
result << "busCommand timeout reached";
|
||||
}
|
||||
|
||||
delete busCommand;
|
||||
} else {
|
||||
result << "specified message type is incorrect";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user