[FSD] Preparations of FSD send message for queued messages

* messageToFSDString function
* sendMessageString in FSDClient to send the message itself
This commit is contained in:
Klaus Basan
2019-11-13 23:19:16 +01:00
committed by Mat Sutcliffe
parent f38bfc5cf9
commit 02e1427210

View File

@@ -14,7 +14,9 @@
#include "blackcore/blackcoreexport.h"
#include <QString>
#include <QStringBuilder>
#include <QStringList>
#include <QDebug>
//! Message type
//! \remark FSD Server docu https://studentweb.uvic.ca/~norrisng/fsd-doc/
@@ -86,4 +88,14 @@ namespace BlackCore
bool m_isValid = true; //!< is valid?
};
//! String which will be send
template <class T>
QString messageToFSDString(const T &message)
{
if (!message.isValid()) return {};
return message.pdu() % message.toTokens().join(':') % QStringLiteral("\r\n");
}
} // ns
} // ns
#endif // guard