From 05a4a0a7d7f4af541a0ecc09a5914b5007f67ba9 Mon Sep 17 00:00:00 2001 From: SonOfGib Date: Wed, 26 Feb 2025 20:02:23 -0500 Subject: [PATCH] Various tweaks * Fix bluetooth service issues when running on linux pc (experimental.) * Service factory changes to disable bluetooth and wifi (commented out) * Include boost logs library. --- CMakeLists.txt | 2 +- .../f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp | 8 ++++---- src/autoapp/Service/ServiceFactory.cpp | 6 +++--- src/btservice/AndroidBluetoothServer.cpp | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c50f447..007e179 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ endif () find_package(aap_protobuf REQUIRED) find_package(aasdk REQUIRED) -find_package(Boost REQUIRED COMPONENTS system log OPTIONAL_COMPONENTS unit_test_framework) +find_package(Boost REQUIRED COMPONENTS system log_setup log OPTIONAL_COMPONENTS unit_test_framework) find_package(libusb-1.0 REQUIRED) find_package(Qt5 COMPONENTS DBus Multimedia MultimediaWidgets Bluetooth Network) find_package(OpenSSL REQUIRED) diff --git a/include/f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp b/include/f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp index d68b82d..597af50 100644 --- a/include/f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp +++ b/include/f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp @@ -19,10 +19,10 @@ #pragma once #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/src/autoapp/Service/ServiceFactory.cpp b/src/autoapp/Service/ServiceFactory.cpp index 89dd266..6c04ab2 100644 --- a/src/autoapp/Service/ServiceFactory.cpp +++ b/src/autoapp/Service/ServiceFactory.cpp @@ -62,7 +62,6 @@ namespace f1x::openauto::autoapp::service { this->createMediaSinkServices(serviceList, messenger); this->createMediaSourceServices(serviceList, messenger); serviceList.emplace_back(this->createSensorService(messenger)); - serviceList.emplace_back(this->createBluetoothService(messenger)); serviceList.emplace_back(this->createInputService(messenger)); if (configuration_->getWirelessProjectionEnabled()) { @@ -71,7 +70,8 @@ namespace f1x::openauto::autoapp::service { * The btservice seems to handle connecting over bluetooth and allow AA to establish a WiFi connection for Projection * If WifiProjection is a legitimate service, then it seems clear it is not what we think it actually is. */ - serviceList.emplace_back(this->createWifiProjectionService(messenger)); + serviceList.emplace_back(this->createBluetoothService(messenger)); + // serviceList.emplace_back(this->createWifiProjectionService(messenger)); } return serviceList; @@ -204,7 +204,7 @@ namespace f1x::openauto::autoapp::service { IService::Pointer ServiceFactory::createWifiProjectionService(aasdk::messenger::IMessenger::Pointer messenger) { OPENAUTO_LOG(info) << "[ServiceFactory] createWifiProjectionService()"; - return std::make_shared(ioService_, messenger); + return std::make_shared(ioService_, messenger, configuration_); } } diff --git a/src/btservice/AndroidBluetoothServer.cpp b/src/btservice/AndroidBluetoothServer.cpp index 3eaa8a7..13fe638 100644 --- a/src/btservice/AndroidBluetoothServer.cpp +++ b/src/btservice/AndroidBluetoothServer.cpp @@ -49,6 +49,7 @@ namespace f1x::openauto::btservice { /// Start Server listening on Address uint16_t AndroidBluetoothServer::start(const QBluetoothAddress &address) { OPENAUTO_LOG(debug) << "[AndroidBluetoothServer::start]"; + rfcommServer_->close(); // Close should always be called before listen. if (rfcommServer_->listen(address)) { return rfcommServer_->serverPort();