From a7f3ae4daf5bf1be94743a9acb888016977c4cc8 Mon Sep 17 00:00:00 2001 From: Bartosz Cichocki Date: Wed, 24 Nov 2021 14:10:12 +0100 Subject: [PATCH] [EGD-7697] Fix BT names in all files Some fallback names were incorrect --- .idea/modules.xml | 1 + module-bluetooth/Bluetooth/BluetoothWorker.cpp | 2 +- module-bluetooth/Bluetooth/interface/profiles/HFP/HFP.cpp | 4 ++-- module-bluetooth/Bluetooth/interface/profiles/HFP/HFPImpl.hpp | 2 +- module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp | 4 ++-- module-bluetooth/Bluetooth/interface/profiles/HSP/HSPImpl.hpp | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.idea/modules.xml b/.idea/modules.xml index 8460d4b6cc36bc93957152a9a79c712b9f76ae1d..79c22bb9112a52a6dd8ba0b2f856c5d5d2217c63 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,6 +2,7 @@ + diff --git a/module-bluetooth/Bluetooth/BluetoothWorker.cpp b/module-bluetooth/Bluetooth/BluetoothWorker.cpp index 40d7cc330a1bd8667eaad22e91fcd4e57dadd852..6290bf7e22a77aebb2d0d5ea692a138e85b2d87b 100644 --- a/module-bluetooth/Bluetooth/BluetoothWorker.cpp +++ b/module-bluetooth/Bluetooth/BluetoothWorker.cpp @@ -54,7 +54,7 @@ namespace auto settingsName = std::get(settings->getValue(bluetooth::Settings::DeviceName)); if (settingsName.empty()) { LOG_WARN("Settings name is empty!"); - constexpr auto name = "PurePhone"; + constexpr auto name = "Mudita Pure"; settings->setValue(bluetooth::Settings::DeviceName, name); settingsName = name; } diff --git a/module-bluetooth/Bluetooth/interface/profiles/HFP/HFP.cpp b/module-bluetooth/Bluetooth/interface/profiles/HFP/HFP.cpp index 01758ee59ac28605bde2bf8bc443f00651395bf1..b9ebc4c3a396baf28969717dff5a1825e2c41a08 100644 --- a/module-bluetooth/Bluetooth/interface/profiles/HFP/HFP.cpp +++ b/module-bluetooth/Bluetooth/interface/profiles/HFP/HFP.cpp @@ -112,7 +112,7 @@ namespace bluetooth std::unique_ptr HFP::HFPImpl::cellularInterface = nullptr; std::unique_ptr HFP::HFPImpl::audioInterface = nullptr; const sys::Service *HFP::HFPImpl::ownerService; - std::string HFP::HFPImpl::agServiceName = "PurePhone HFP"; + const std::string_view HFP::HFPImpl::agServiceName = "Mudita Pure HFP"; SCOCodec HFP::HFPImpl::codec = SCOCodec::CVSD; std::shared_ptr HFP::HFPImpl::audioDevice; @@ -356,7 +356,7 @@ namespace bluetooth hfp_ag_create_sdp_record(serviceBuffer.data(), hspSdpRecordHandle, rfcommChannelNr, - agServiceName.c_str(), + agServiceName.data(), 0, supported_features, wide_band_speech); diff --git a/module-bluetooth/Bluetooth/interface/profiles/HFP/HFPImpl.hpp b/module-bluetooth/Bluetooth/interface/profiles/HFP/HFPImpl.hpp index 79e3abf1c76f18c3e25a9852a5e0416153217423..161141be5003e1d9d2881f645ce736627f4da9f9 100644 --- a/module-bluetooth/Bluetooth/interface/profiles/HFP/HFPImpl.hpp +++ b/module-bluetooth/Bluetooth/interface/profiles/HFP/HFPImpl.hpp @@ -40,7 +40,7 @@ namespace bluetooth static void dump_supported_codecs(void); static std::array serviceBuffer; static constexpr uint8_t rfcommChannelNr = 1; - static std::string agServiceName; + static const std::string_view agServiceName; static hci_con_handle_t scoHandle; static hci_con_handle_t aclHandle; static std::unique_ptr sco; diff --git a/module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp b/module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp index 05e7486f7577370571dc1d4b07d54852e3d5cf62..026f025db3fe039472b4bec8f9e8a37ed80080fb 100644 --- a/module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp +++ b/module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp @@ -106,7 +106,7 @@ namespace bluetooth std::unique_ptr HSP::HSPImpl::cellularInterface = nullptr; std::unique_ptr HSP::HSPImpl::audioInterface = nullptr; const sys::Service *HSP::HSPImpl::ownerService; - std::string HSP::HSPImpl::agServiceName = "PurePhone HSP"; + const std::string_view HSP::HSPImpl::agServiceName = "Mudita Pure HSP"; bool HSP::HSPImpl::isConnected = false; bool HSP::HSPImpl::callAnswered = false; bool HSP::HSPImpl::isRinging = false; @@ -288,7 +288,7 @@ namespace bluetooth serviceBuffer.fill(0); constexpr uint32_t hspSdpRecordHandle = 0x10004; - hsp_ag_create_sdp_record(serviceBuffer.data(), hspSdpRecordHandle, rfcommChannelNr, agServiceName.c_str()); + hsp_ag_create_sdp_record(serviceBuffer.data(), hspSdpRecordHandle, rfcommChannelNr, agServiceName.data()); if (const auto status = sdp_register_service(serviceBuffer.data()); status != ERROR_CODE_SUCCESS) { LOG_ERROR("Can't register service. Status %x", status); diff --git a/module-bluetooth/Bluetooth/interface/profiles/HSP/HSPImpl.hpp b/module-bluetooth/Bluetooth/interface/profiles/HSP/HSPImpl.hpp index 95e436a55a8fde8dcece10a9c6aab1dcff47e22d..ca3fe393bd122dd820858723d3003bbafcd405d5 100644 --- a/module-bluetooth/Bluetooth/interface/profiles/HSP/HSPImpl.hpp +++ b/module-bluetooth/Bluetooth/interface/profiles/HSP/HSPImpl.hpp @@ -36,7 +36,7 @@ namespace bluetooth static void establishAudioConnection(); static std::array serviceBuffer; static constexpr uint8_t rfcommChannelNr = 1; - static std::string agServiceName; + static const std::string_view agServiceName; static uint16_t scoHandle; static std::unique_ptr sco; static std::unique_ptr cellularInterface;