diff options
author | Milan Srdinko <msrdinko@alps.cz> | 2017-02-01 13:31:05 +0100 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2017-02-06 20:18:32 +0000 |
commit | 92a31d3d0e2c3ad8c05d341764896a2644c84cf5 (patch) | |
tree | 4f30ef881a060c76f3061060fdbd6849a2de272e /app/main.cpp | |
parent | d8a1bcaaae2b43ffac66b76a681ae1ea406f808d (diff) |
WiFi: reworked to support websockets and subscriptions for events
Change-Id: I2d1f2724d7c1efd64c12b7fa639436946209196e
Signed-off-by: Milan Srdinko <msrdinko@alps.cz>
Diffstat (limited to 'app/main.cpp')
-rw-r--r-- | app/main.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/main.cpp b/app/main.cpp index a55ebad..381b936 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -79,17 +79,25 @@ int main(int argc, char *argv[]) if (!positionalArguments.isEmpty()) { port = positionalArguments.takeFirst().toInt(); } -// QString secret = positionalArguments.takeFirst(); + QString secret = positionalArguments.takeFirst(); QUrl bindingAddress; bindingAddress.setScheme(QStringLiteral("http")); bindingAddress.setHost(QStringLiteral("localhost")); bindingAddress.setPort(port); bindingAddress.setPath(QStringLiteral("/api")); -// QUrlQuery query; -// query.addQueryItem(QStringLiteral("token"), secret); -// bindingAddress.setQuery(query); + QUrlQuery query; + query.addQueryItem(QStringLiteral("token"), secret); + //bindingAddress.setQuery(query); + + QUrl bindingAddressWS; + bindingAddressWS.setScheme(QStringLiteral("ws")); + bindingAddressWS.setHost(QStringLiteral("localhost")); + bindingAddressWS.setPort(port); + bindingAddressWS.setPath(QStringLiteral("/api")); + bindingAddressWS.setQuery(query); QQmlContext *context = engine.rootContext(); context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress); + context->setContextProperty(QStringLiteral("bindingAddressWS"), bindingAddressWS); QFile version("/proc/version"); if (version.open(QFile::ReadOnly)) { |