1
0
Fork 0

swift: Add version number check

This commit is contained in:
Lars Toenning 2019-04-30 10:03:20 +02:00 committed by Florent Rougon
parent cea342a064
commit ff7db27cd1
2 changed files with 13 additions and 0 deletions

View file

@ -49,6 +49,12 @@ const std::string& CService::ObjectPath()
return s; return s;
} }
// Static method
std::string CService::getVersionNumber()
{
return fgGetString("/sim/version/flightgear");
}
void CService::addTextMessage(const std::string& text) void CService::addTextMessage(const std::string& text)
{ {
if (text.empty()) { return; } if (text.empty()) { return; }
@ -320,6 +326,10 @@ DBusHandlerResult CService::dbusMessageHandler(const CDBusMessage& message_)
reply.appendArgument(pressAlt); reply.appendArgument(pressAlt);
sendDBusMessage(reply); sendDBusMessage(reply);
}); });
} else if (message.getMethodName() == "getVersionNumber") {
queueDBusCall([=]() {
sendDBusReply(sender, serial, getVersionNumber());
});
} else if (message.getMethodName() == "getAircraftModelPath") { } else if (message.getMethodName() == "getAircraftModelPath") {
queueDBusCall([=]() { queueDBusCall([=]() {
sendDBusReply(sender, serial, getAircraftModelPath()); sendDBusReply(sender, serial, getAircraftModelPath());

View file

@ -64,6 +64,9 @@ public:
//! DBus object path //! DBus object path
static const std::string& ObjectPath(); static const std::string& ObjectPath();
//! Getting flightgear version
static std::string getVersionNumber();
////! Add a text message to the on-screen display, with RGB components in the range [0,1] ////! Add a text message to the on-screen display, with RGB components in the range [0,1]
void addTextMessage(const std::string& text); void addTextMessage(const std::string& text);