mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
[FSD] Preparations of FSD send message for queued messages
* messageToFSDString function * sendMessageString in FSDClient to send the message itself
This commit is contained in:
committed by
Mat Sutcliffe
parent
f38bfc5cf9
commit
02e1427210
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user