Open taimooralam opened 7 years ago
Hard to say without the whole code. You could try to use a lambda function like this (if you use at least c++11
):
CoapReply *reply = m_coap->get(CoapRequest(url));
connect(reply, &CoapReply::finished, [reply]() {
if (reply->error() != CoapReply::NoError) {
qWarning() << "Could not get resource" << reply->request().url().toString() << ":" << reply->errorString();
reply->deleteLater();
return;
}
qDebug() << reply->payload();
// Do something
reply->deleteLater();
});
The Core::onReplyFinished(CoapReply *reply) finished method does not recognize one of the replies of a get request and instead executes the last else of the method. What might be the problem here?