Index: CloudConnect/CloudConnectController.cpp =================================================================== diff -u -rc6a4b63a37f3beb1e8a51702ec3a56a1c32cfe8f -r6d2ef8c97f4bb34204e95811839b3995000c47c1 --- CloudConnect/CloudConnectController.cpp (.../CloudConnectController.cpp) (revision c6a4b63a37f3beb1e8a51702ec3a56a1c32cfe8f) +++ CloudConnect/CloudConnectController.cpp (.../CloudConnectController.cpp) (revision 6d2ef8c97f4bb34204e95811839b3995000c47c1) @@ -38,43 +38,27 @@ _canInterface.init(_canThread); connect(&_canInterface, &Can::CanInterface::didFrameReceive, this, &CloudConnectController::onFrameReceive); connect(&_dispatcher, &Can::MessageDispatcher::didActionReceive, this, &CloudConnectController::onMessageReceive); - connect(&_agentInterface, &CloudConnectClient::didDisconnect, this, &CloudConnectController::onAgentDisconnect); } /*! * \brief CloudConnectController::~CloudConnectController - * \details Destructor. Stops and joins the CAN and Agent worker threads. + * \details Destructor. Stops and joins the CAN worker thread. */ CloudConnectController::~CloudConnectController() { _canThread.quit(); _canThread.wait(); - - _agentThread.quit(); - _agentThread.wait(); } /*! - * \brief CloudConnectController::connectToAgent - * \details Initialises the CloudConnectClient using the socket path and reconnect - * interval from the settings file. - */ -void CloudConnectController::connectToAgent() -{ - const QString socketPath = _settings.value("Socket/AgentSocketName", "/tmp/cloudconnect_agent.sock").toString(); - const int reconnectIntervalMs = _settings.value("Socket/ReconnectIntervalMs", 5000).toInt(); - _agentInterface.init(socketPath, reconnectIntervalMs, _agentThread); -} - -/*! * \brief CloudConnectController::listenForApp * \details Starts the local-socket server that the Luis application connects to, * using the app socket path from the settings file. * \return true if the server bound successfully, false otherwise. */ bool CloudConnectController::listenForApp() { - const QString appSocketPath = _settings.value("Socket/AppSocketName", "/tmp/cloudconnect_app.sock").toString(); + const QString appSocketPath = _settings.value("Socket/AppSocketName", "/tmp/cloudconnect.sock").toString(); return _appServer.listen(appSocketPath); } @@ -193,20 +177,8 @@ QStringLiteral("test_device"), msg); const quint16 sequence = _txSequence++; - _agentInterface.send(it->topic, sequence, payload); + _appServer.send(it->topic, sequence, payload); received = true; cachedMsg = msg; } - -/*! - * \brief CloudConnectController::onAgentDisconnect - * \details Resets the received flag on all cache entries so that send_delta - * messages are treated as new on the next connection. - */ -void CloudConnectController::onAgentDisconnect() -{ - for (auto &[received, msg] : _msgCache) { - received = false; - } -}