summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-05 10:45:01 +0200
committerYuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>2017-08-31 14:58:56 +0000
commitc320e8202d3347b1513be57786d4d70b55551351 (patch)
tree39d01acd55eeb46a2aa14a6e53c2f56bd376af3e /app/main.cpp
parent632e86c88bd34725cceec27c1b4b03b07fca0f63 (diff)
support CAN information(VehicleSpeed and EngineSpeed)eel_4.99.2eel_4.99.1eel/4.99.2eel/4.99.14.99.24.99.1
This patch is support CAN inforamion(VehicleSpeed and EngineSpeed). CAN data is sent from can binder using websocket. Change-Id: I26cc6afa5f5f6cea2e6c77e40c324cca5fc00516 Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/main.cpp b/app/main.cpp
index a86082e..1d73689 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -14,7 +14,10 @@
* limitations under the License.
*/
+#include <QUrlQuery>
+#include <QQmlContext>
#include <QtCore/QDebug>
+#include <QCommandLineParser>
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlApplicationEngine>
#include <QtQuickControls2/QQuickStyle>
@@ -35,10 +38,36 @@ int main(int argc, char *argv[])
#endif
QGuiApplication app(argc, argv);
+ app.setApplicationName(QStringLiteral("Dashboard"));
+ app.setApplicationVersion(QStringLiteral("3.99.3"));
+ app.setOrganizationDomain(QStringLiteral("automotivelinux.org"));
+ app.setOrganizationName(QStringLiteral("AutomotiveGradeLinux"));
QQuickStyle::setStyle("AGL");
+ QCommandLineParser parser;
+ parser.addPositionalArgument("port", app.translate("main", "port for binding"));
+ parser.addPositionalArgument("secret", app.translate("main", "secret for binding"));
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.process(app);
+ QStringList positionalArguments = parser.positionalArguments();
+
QQmlApplicationEngine engine;
+ if (positionalArguments.length() == 2) {
+ int port = positionalArguments.takeFirst().toInt();
+ QString secret = positionalArguments.takeFirst();
+ QUrl bindingAddress;
+ bindingAddress.setScheme(QStringLiteral("ws"));
+ bindingAddress.setHost(QStringLiteral("localhost"));
+ bindingAddress.setPort(port);
+ bindingAddress.setPath(QStringLiteral("/api"));
+ QUrlQuery query;
+ query.addQueryItem(QStringLiteral("token"), secret);
+ bindingAddress.setQuery(query);
+ QQmlContext *context = engine.rootContext();
+ context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress);
+ }
engine.load(QUrl(QStringLiteral("qrc:/Dashboard.qml")));
return app.exec();
Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
The security framework
======================

NOT STARTED !!!!!!

Setting Smack rules for the application
---------------------------------------

For Tizen, the following rules are set by the security manager for each application.

    System ~APP~             rwx
    System ~PKG~             rwxat
    System ~PKG~::RO         rwxat
    ~APP~  System            wx
    ~APP~  System::Shared    rxl
    ~APP~  System::Run       rwxat
    ~APP~  System::Log       rwxa
    ~APP~  _                 l
    User   ~APP~             rwx
    User   ~PKG~             rwxat
    User   ~PKG~::RO         rwxat
    ~APP~  User              wx
    ~APP~  User::Home        rxl
    ~APP~  User::App::Shared rwxat
    ~APP~  ~PKG~             rwxat
    ~APP~  ~PKG~::RO         rxl

Here, ~PKG~ is the identifier of the package and ~APP~ is the identifier of the application.

What user can run an application?
---------------------------------------

Not all user are able to run all applications.
How to manage that?




[meta-intel]:       https://github.com/01org/meta-intel-iot-security                "A collection of layers providing security technologies"
[widgets]:          http://www.w3.org/TR/widgets                                    "Packaged Web Apps"
[widgets-digsig]:   http://www.w3.org/TR/widgets-digsig                             "XML Digital Signatures for Widgets"
[libxml2]:          http://xmlsoft.org/html/index.html                              "libxml2"
[openssl]:          https://www.openssl.org                                         "OpenSSL"
[xmlsec]:           https://www.aleksey.com/xmlsec                                  "XMLSec"
[json-c]:           https://github.com/json-c/json-c                                "JSON-c"
[d-bus]:            http://www.freedesktop.org/wiki/Software/dbus                   "D-Bus"
[libzip]:           http://www.nih.at/libzip                                        "libzip"
[cmake]:            https://cmake.org                                               "CMake"
[security-manager]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Security_Manager "Security-Manager"
[app-manifest]:     http://www.w3.org/TR/appmanifest                                "Web App Manifest"
[tizen-security]:   https://wiki.tizen.org/wiki/Security                            "Tizen security home page"
[tizen-secu-3]:     https://wiki.tizen.org/wiki/Security/Tizen_3.X_Overview         "Tizen 3 security overview"