option(WITH_ENCRYPTION "Enable encryption" ON)
add_feature_info(Encryption WITH_ENCRYPTION "ENCRYPT command support (requires QCA)")
+option(WITH_CLIENT_DEBUG "Enable client debug logs" ON)
+add_feature_info(ClientDebug WITH_CLIENT_DEBUG "Print extra logs for debug purposes")
+
set(QT_MIN_VERSION "5.8.0")
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core
add_definitions(-DANIDBUDPCLIENT_NO_ENCRYPT)
endif()
+if (WITH_CLIENT_DEBUG)
+ add_definitions(-DANIDBUDPCLIENT_CLIENT_MISC_DEBUG)
+ add_definitions(-DANIDBUDPCLIENT_CLIENT_COMMAND_DEBUG)
+endif()
+
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
{
// If we got the first command sent, we update the replyTimeoutTimer to count the remaining time untill timeout.
resetReplyTimeoutTimer(sentCommands[sentCommandOrder.head()]);
-#ifdef ANIDBUDPCLIENT_CLIENT_MISC_DEBUG
-qDebug() << "Starting replyTimeoutTimer" << newTimeout;
-#endif
}
}
else
int newTimeout = qBound(qint64(0), qint64(Client::UDP_API_COMMAND_TIMEOUT - cmd->timeSent().secsTo(QDateTime::currentDateTime())), qint64(Client::UDP_API_COMMAND_TIMEOUT));
newTimeout *= 1000;
replyTimeoutTimer->start(newTimeout);
+#ifdef ANIDBUDPCLIENT_CLIENT_MISC_DEBUG
+qDebug() << "Starting replyTimeoutTimer" << newTimeout;
+#endif
}
void Client::init()
if (!sentCommandOrder.isEmpty())
{
resetReplyTimeoutTimer(sentCommands[sentCommandOrder.head()]);
-#ifdef ANIDBUDPCLIENT_CLIENT_MISC_DEBUG
-qDebug() << "Starting replyTimeoutTimer" << newTimeout;
-#endif
}
// If it's empty thereis no need to start replyTimeoutTimer again, as there are no commands waiting.